summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabor Pali <pali.gabor@gmail.com>2014-01-18 03:02:21 +0100
committerGabor Pali <pali.gabor@gmail.com>2014-01-18 03:20:20 +0100
commit1ad599ea241626f47006fa386e4aaf38dc91fdbb (patch)
treeb72ba92879bfc8b5498d1a9f3f6cccf998a8fde5
parentbcc5c953f80c53732172345639f30974b9862043 (diff)
downloadhaskell-1ad599ea241626f47006fa386e4aaf38dc91fdbb.tar.gz
Fix #8451
On FreeBSD, /usr/lib has to be added to the library path on linking when libthr is needed but -nostdlib is used (which is the case when the -prof and -threaded flags are combined).
-rw-r--r--compiler/main/DriverPipeline.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs
index 19fb717aef..b2f182a7d7 100644
--- a/compiler/main/DriverPipeline.hs
+++ b/compiler/main/DriverPipeline.hs
@@ -2124,12 +2124,16 @@ joinObjectFiles :: DynFlags -> [FilePath] -> FilePath -> IO ()
joinObjectFiles dflags o_files output_fn = do
let mySettings = settings dflags
ldIsGnuLd = sLdIsGnuLd mySettings
+ osInfo = platformOS (targetPlatform dflags)
ld_r args ccInfo = SysTools.runLink dflags ([
SysTools.Option "-nostdlib",
SysTools.Option "-Wl,-r"
]
++ (if ccInfo == Clang then []
else [SysTools.Option "-nodefaultlibs"])
+ ++ (if osInfo == OSFreeBSD
+ then [SysTools.Option "-L/usr/lib"]
+ else [])
-- gcc on sparc sets -Wl,--relax implicitly, but
-- -r and --relax are incompatible for ld, so
-- disable --relax explicitly.