Commit a651264d authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Don't use -Bsymbolic when linking the RTS

This makes the RTS hooks work when doing dynamic linking
parent f69bf6be
......@@ -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
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment