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