Commit 3ce0e0ba authored by Simon Marlow's avatar Simon Marlow Committed by Ben Gamari

Build ghc-iserv with --export-dynamic

This enables loading dynamic libraries that refer to the RTS.  I just
came across somewhere I needed to do that, and without
`--export-dynamic` it's impossible.

For now we'll only support that when using `-fexternal-interpreter`,
because the dynamic symbol table for GHC itself is much bigger.

Test Plan: validate

Reviewers: niteria, austin, erikd, bgamari

Reviewed By: bgamari

Subscribers: Phyx, thomie

Differential Revision: https://phabricator.haskell.org/D2590
parent d5a4e49d
...@@ -24,6 +24,16 @@ iserv_stage2_MORE_HC_OPTS += -threaded ...@@ -24,6 +24,16 @@ iserv_stage2_MORE_HC_OPTS += -threaded
iserv_stage2_p_MORE_HC_OPTS += -threaded iserv_stage2_p_MORE_HC_OPTS += -threaded
iserv_stage2_dyn_MORE_HC_OPTS += -threaded iserv_stage2_dyn_MORE_HC_OPTS += -threaded
# Add -Wl,--export-dynamic enables GHCi to load dynamic objects that
# refer to the RTS. This is harmless if you don't use it (adds a bit
# of overhead to startup and increases the binary sizes) but if you
# need it there's no alternative.
ifeq "$(TargetElf)" "YES"
iserv_stage2_MORE_HC_OPTS += -optl-Wl,--export-dynamic
iserv_stage2_p_MORE_HC_OPTS += -optl-Wl,--export-dynamic
iserv_stage2_dyn_MORE_HC_OPTS += -optl-Wl,--export-dynamic
endif
# Override the default way, because we want a specific version of this # Override the default way, because we want a specific version of this
# program for each way. Note that it's important to do this even for # program for each way. Note that it's important to do this even for
# the vanilla version, otherwise we get a dynamic executable when # the vanilla version, otherwise we get a dynamic executable when
......
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