summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2010-03-16 23:33:57 +0000
committerIan Lynagh <igloo@earth.li>2010-03-16 23:33:57 +0000
commita651264d58fdcd8d37e0215adc95444c41213525 (patch)
tree8e209561a2543a0b8f2cd82333da3e62a41c34fe /compiler
parentf69bf6be6101d6b5d7952c384dd5eeb1917b4cdb (diff)
downloadhaskell-a651264d58fdcd8d37e0215adc95444c41213525.tar.gz
Don't use -Bsymbolic when linking the RTS
This makes the RTS hooks work when doing dynamic linking
Diffstat (limited to 'compiler')
-rw-r--r--compiler/main/DriverPipeline.hs11
1 files changed, 10 insertions, 1 deletions
diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs
index 0ca76a299d..12925ad028 100644
--- a/compiler/main/DriverPipeline.hs
+++ b/compiler/main/DriverPipeline.hs
@@ -1731,6 +1731,14 @@ linkDynLib dflags o_files dep_packages = do
-----------------------------------------------------------------------------
let output_fn = case o_file of { Just s -> s; Nothing -> "a.out"; }
+ let buildingRts = thisPackage dflags == rtsPackageId
+ let bsymbolicFlag = if buildingRts
+ then -- -Bsymbolic breaks the way we implement
+ -- hooks in the RTS
+ []
+ else -- we need symbolic linking to resolve
+ -- non-PIC intra-package-relocations
+ ["-Wl,-Bsymbolic"]
SysTools.runLink dflags
([ SysTools.Option verb
@@ -1740,7 +1748,8 @@ linkDynLib dflags o_files dep_packages = do
++ map SysTools.Option (
md_c_flags
++ o_files
- ++ [ "-shared", "-Wl,-Bsymbolic" ] -- we need symbolic linking to resolve non-PIC intra-package-relocations
+ ++ [ "-shared" ]
+ ++ bsymbolicFlag
++ [ "-Wl,-soname," ++ takeFileName output_fn ] -- set the library soname
++ extra_ld_inputs
++ lib_path_opts