diff options
author | Ian Lynagh <ian@well-typed.com> | 2012-11-23 16:54:15 +0000 |
---|---|---|
committer | Ian Lynagh <ian@well-typed.com> | 2012-11-23 16:55:09 +0000 |
commit | 9ef4d48e296d4b96492a839f9ee569f8f90c617b (patch) | |
tree | e5eb182d1e6468bfaed9382e94fe0b354ab965f2 | |
parent | eb5196c48480c7dbec25aa175e43b9c20277f29c (diff) | |
download | haskell-9ef4d48e296d4b96492a839f9ee569f8f90c617b.tar.gz |
Fix building on Sparc/Solaris with non-GNU linker; fixes #5407
Patch from maeder.
-rw-r--r-- | compiler/main/DriverPipeline.hs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs index 2326e57403..da4f674514 100644 --- a/compiler/main/DriverPipeline.hs +++ b/compiler/main/DriverPipeline.hs @@ -1955,6 +1955,7 @@ hsSourceCppOpts = 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 ([ SysTools.Option "-nostdlib", SysTools.Option "-nodefaultlibs", @@ -1964,6 +1965,7 @@ joinObjectFiles dflags o_files output_fn = do -- -r and --relax are incompatible for ld, so -- disable --relax explicitly. ++ (if platformArch (targetPlatform dflags) == ArchSPARC + && ldIsGnuLd then [SysTools.Option "-Wl,-no-relax"] else []) ++ map SysTools.Option ld_build_id @@ -1977,7 +1979,7 @@ joinObjectFiles dflags o_files output_fn = do ld_build_id | sLdSupportsBuildId mySettings = ["-Wl,--build-id=none"] | otherwise = [] - if sLdIsGnuLd mySettings + if ldIsGnuLd then do script <- newTempName dflags "ldscript" writeFile script $ "INPUT(" ++ unwords o_files ++ ")" |