summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compiler/ghci/Linker.hs2
-rw-r--r--compiler/main/SysTools.hs13
2 files changed, 8 insertions, 7 deletions
diff --git a/compiler/ghci/Linker.hs b/compiler/ghci/Linker.hs
index edd947d94f..10e789acc3 100644
--- a/compiler/ghci/Linker.hs
+++ b/compiler/ghci/Linker.hs
@@ -1422,7 +1422,7 @@ searchForLibUsingGcc :: DynFlags -> String -> [FilePath] -> IO (Maybe FilePath)
searchForLibUsingGcc dflags so dirs = do
-- GCC does not seem to extend the library search path (using -L) when using
-- --print-file-name. So instead pass it a new base location.
- str <- askCc dflags (map (FileOption "-B") dirs
+ str <- askLd dflags (map (FileOption "-B") dirs
++ [Option "--print-file-name", Option so])
let file = case lines str of
[] -> ""
diff --git a/compiler/main/SysTools.hs b/compiler/main/SysTools.hs
index 1b567e966a..fd3faf1851 100644
--- a/compiler/main/SysTools.hs
+++ b/compiler/main/SysTools.hs
@@ -31,7 +31,7 @@ module SysTools (
linkDynLib,
- askCc,
+ askLd,
touch, -- String -> String -> IO ()
copy,
@@ -480,11 +480,12 @@ runCc dflags args = do
isContainedIn :: String -> String -> Bool
xs `isContainedIn` ys = any (xs `isPrefixOf`) (tails ys)
-askCc :: DynFlags -> [Option] -> IO String
-askCc dflags args = do
- let (p,args0) = pgm_c dflags
- args1 = map Option (getOpts dflags opt_c)
- args2 = args0 ++ args1 ++ args
+-- | Run the linker with some arguments and return the output
+askLd :: DynFlags -> [Option] -> IO String
+askLd dflags args = do
+ let (p,args0) = pgm_l dflags
+ args1 = map Option (getOpts dflags opt_l)
+ args2 = args0 ++ args1 ++ args
mb_env <- getGccEnv args2
runSomethingWith dflags "gcc" p args2 $ \real_args ->
readCreateProcessWithExitCode' (proc p real_args){ env = mb_env }