From e58e1c1954481ff73fec507b916f8f9e0c1a7f69 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Wed, 18 Mar 2020 17:31:17 +0100 Subject: [PATCH] Force LD=ld.bfd for ghc compilation --- lib/GHCup.hs | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/lib/GHCup.hs b/lib/GHCup.hs index 54fc2e9..3391750 100644 --- a/lib/GHCup.hs +++ b/lib/GHCup.hs @@ -503,17 +503,21 @@ GhcWithLlvmCodeGen = YES|] () compile bghc ghcdir workdir = do lift $ $(logInfo) [i|configuring build|] + + -- force ld.bfd for build (others seem to misbehave, like lld from FreeBSD) + newEnv <- addToCurrentEnv [([s|LD|], [s|ld.bfd|])] + if | tver >= [vver|8.8.0|] -> do spaths <- catMaybes . fmap parseAbs <$> liftIO getSearchPath bghcPath <- (liftIO $ searchPath spaths bghc) !? NoDownload - newEnv <- addToCurrentEnv [([s|GHC|], toFilePath bghcPath)] - lEM $ liftIO $ execLogged [s|./configure|] - False - [[s|--prefix=|] <> toFilePath ghcdir] - [rel|ghc-configure.log|] - (Just workdir) - (Just newEnv) + lEM $ liftIO $ execLogged + [s|./configure|] + False + [[s|--prefix=|] <> toFilePath ghcdir] + [rel|ghc-configure.log|] + (Just workdir) + (Just (([s|GHC|], toFilePath bghcPath) : newEnv)) | otherwise -> do lEM $ liftIO $ execLogged [s|./configure|] @@ -523,7 +527,7 @@ GhcWithLlvmCodeGen = YES|] ] [rel|ghc-configure.log|] (Just workdir) - Nothing + (Just newEnv) case mbuildConfig of Just bc -> liftIOException