summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compiler/main/DriverPipeline.hs11
-rw-r--r--rts/ghc.mk4
2 files changed, 12 insertions, 3 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
diff --git a/rts/ghc.mk b/rts/ghc.mk
index b238728e11..a7a2c1145f 100644
--- a/rts/ghc.mk
+++ b/rts/ghc.mk
@@ -165,7 +165,7 @@ ifneq "$$(findstring dyn, $1)" ""
ifeq "$$(HOSTPLATFORM)" "i386-unknown-mingw32"
$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(ALL_RTS_DEF_LIBS) rts/libs.depend
"$$(RM)" $$(RM_OPTS) $$@
- "$$(rts_dist_HC)" -shared -dynamic -dynload deploy \
+ "$$(rts_dist_HC)" -package-name rts -shared -dynamic -dynload deploy \
-no-auto-link-packages `cat rts/libs.depend` $$(rts_$1_OBJS) $$(ALL_RTS_DEF_LIBS) -o $$@
ifeq "$$(darwin_TARGET_OS)" "1"
# Ensure library's install name is correct before anyone links with it.
@@ -174,7 +174,7 @@ endif
else
$$(rts_$1_LIB) : $$(rts_$1_OBJS) rts/libs.depend
"$$(RM)" $$(RM_OPTS) $$@
- "$$(rts_dist_HC)" -shared -dynamic -dynload deploy \
+ "$$(rts_dist_HC)" -package-name rts -shared -dynamic -dynload deploy \
-no-auto-link-packages `cat rts/libs.depend` $$(rts_$1_OBJS) -o $$@
endif
else