summaryrefslogtreecommitdiff
path: root/iserv
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2016-10-14 10:43:10 -0400
committerBen Gamari <ben@smart-cactus.org>2016-10-14 13:27:33 -0400
commit3ce0e0baad05352e2e1ca439794b6f9f2325ef2b (patch)
tree23dcbe749216376b32c72afc919b1db47867bf8e /iserv
parentd5a4e49d657682eeb6e86ae464d281974ce2f5e2 (diff)
downloadhaskell-3ce0e0baad05352e2e1ca439794b6f9f2325ef2b.tar.gz
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
Diffstat (limited to 'iserv')
-rw-r--r--iserv/ghc.mk10
1 files changed, 10 insertions, 0 deletions
diff --git a/iserv/ghc.mk b/iserv/ghc.mk
index 83691bc131..cab432a3d6 100644
--- a/iserv/ghc.mk
+++ b/iserv/ghc.mk
@@ -24,6 +24,16 @@ iserv_stage2_MORE_HC_OPTS += -threaded
iserv_stage2_p_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
# program for each way. Note that it's important to do this even for
# the vanilla version, otherwise we get a dynamic executable when