diff options
author | Austin Seipp <austin@well-typed.com> | 2014-01-15 18:56:55 -0600 |
---|---|---|
committer | Austin Seipp <austin@well-typed.com> | 2014-01-15 19:15:28 -0600 |
commit | d0ed1ff1185981d2e827a18696f7caa53eef4af3 (patch) | |
tree | 05c68182e03be5d8c1644d2188dec5306bcd6996 /compiler/main/DriverPipeline.hs | |
parent | 3428f76e50508be4cbc85c8f72b0ad1dc784b0d4 (diff) | |
download | haskell-d0ed1ff1185981d2e827a18696f7caa53eef4af3.tar.gz |
Don't pass -nodefaultlibs to Clang
This fixes a large majority of the testsuite failures on Mavericks with
Clang.
Signed-off-by: Austin Seipp <austin@well-typed.com>
Diffstat (limited to 'compiler/main/DriverPipeline.hs')
-rw-r--r-- | compiler/main/DriverPipeline.hs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs index a95c17901e..19fb717aef 100644 --- a/compiler/main/DriverPipeline.hs +++ b/compiler/main/DriverPipeline.hs @@ -2124,11 +2124,12 @@ joinObjectFiles :: DynFlags -> [FilePath] -> FilePath -> IO () joinObjectFiles dflags o_files output_fn = do let mySettings = settings dflags ldIsGnuLd = sLdIsGnuLd mySettings - ld_r args = SysTools.runLink dflags ([ + ld_r args ccInfo = SysTools.runLink dflags ([ SysTools.Option "-nostdlib", - SysTools.Option "-nodefaultlibs", SysTools.Option "-Wl,-r" ] + ++ (if ccInfo == Clang then [] + else [SysTools.Option "-nodefaultlibs"]) -- gcc on sparc sets -Wl,--relax implicitly, but -- -r and --relax are incompatible for ld, so -- disable --relax explicitly. @@ -2147,19 +2148,20 @@ joinObjectFiles dflags o_files output_fn = do ld_build_id | sLdSupportsBuildId mySettings = ["-Wl,--build-id=none"] | otherwise = [] + ccInfo <- getCompilerInfo dflags if ldIsGnuLd then do script <- newTempName dflags "ldscript" writeFile script $ "INPUT(" ++ unwords o_files ++ ")" - ld_r [SysTools.FileOption "" script] + ld_r [SysTools.FileOption "" script] ccInfo else if sLdSupportsFilelist mySettings then do filelist <- newTempName dflags "filelist" writeFile filelist $ unlines o_files ld_r [SysTools.Option "-Wl,-filelist", - SysTools.FileOption "-Wl," filelist] + SysTools.FileOption "-Wl," filelist] ccInfo else do - ld_r (map (SysTools.FileOption "") o_files) + ld_r (map (SysTools.FileOption "") o_files) ccInfo -- ----------------------------------------------------------------------------- -- Misc. |