[commit: ghc] master: Build ghc-iserv with --export-dynamic (3ce0e0b)

git at git.haskell.org git at git.haskell.org
Fri Oct 14 17:27:49 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/3ce0e0baad05352e2e1ca439794b6f9f2325ef2b/ghc

>---------------------------------------------------------------

commit 3ce0e0baad05352e2e1ca439794b6f9f2325ef2b
Author: Simon Marlow <marlowsd at gmail.com>
Date:   Fri Oct 14 10:43:10 2016 -0400

    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


>---------------------------------------------------------------

3ce0e0baad05352e2e1ca439794b6f9f2325ef2b
 iserv/ghc.mk | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/iserv/ghc.mk b/iserv/ghc.mk
index 83691bc..cab432a 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



More information about the ghc-commits mailing list