Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tobias Decking
GHC
Commits
a651264d
Commit
a651264d
authored
Mar 16, 2010
by
Ian Lynagh
Browse files
Don't use -Bsymbolic when linking the RTS
This makes the RTS hooks work when doing dynamic linking
parent
f69bf6be
Changes
2
Hide whitespace changes
Inline
Side-by-side
compiler/main/DriverPipeline.hs
View file @
a651264d
...
...
@@ -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
...
...
rts/ghc.mk
View file @
a651264d
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment