diff options
author | Ian Lynagh <igloo@earth.li> | 2013-05-12 16:25:08 +0100 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2013-05-12 16:27:50 +0100 |
commit | b2cae55fdd2b4b331bd609380b2667904d8a2eda (patch) | |
tree | ce81701af85cc6678124946bba1f85390ec3b67a | |
parent | ba00c33b8b2116a8f3ee13d28e5b5085ff265d58 (diff) | |
download | haskell-b2cae55fdd2b4b331bd609380b2667904d8a2eda.tar.gz |
We actually need to use -threaded/-debug when linking /all/ DLLs
Not just base, integer-gmp and ghc-prim.
-rw-r--r-- | ghc.mk | 18 | ||||
-rw-r--r-- | rules/distdir-way-opts.mk | 12 |
2 files changed, 12 insertions, 18 deletions
@@ -557,24 +557,6 @@ endif endif # ---------------------------------------- -# Special magic for the packages which link to the RTS -# This is a rather ugly hack to fix dynamically linked GHC on Windows. -# If GHC is linked with -threaded, then it links against libHSrts_thr. -# But if base is linked against libHSrts, then both end up getting -# loaded, and things go wrong. We therefore link the libraries that -# link against the RTS with the same RTS flags that we link GHC with. -ifeq "$(GhcThreaded)" "YES" -libraries/ghc-prim_dist-install_MORE_HC_OPTS += -threaded -libraries/integer-gmp_dist-install_MORE_HC_OPTS += -threaded -libraries/base_dist-install_MORE_HC_OPTS += -threaded -endif -ifeq "$(GhcDebugged)" "YES" -libraries/ghc-prim_dist-install_MORE_HC_OPTS += -debug -libraries/integer-gmp_dist-install_MORE_HC_OPTS += -debug -libraries/base_dist-install_MORE_HC_OPTS += -debug -endif - -# ---------------------------------------- # Workarounds for problems building DLLs on Windows ifeq "$(TargetOS_CPP)" "mingw32" diff --git a/rules/distdir-way-opts.mk b/rules/distdir-way-opts.mk index acf68823e4..f288d3919e 100644 --- a/rules/distdir-way-opts.mk +++ b/rules/distdir-way-opts.mk @@ -132,6 +132,18 @@ $1_$2_$3_GHC_LD_OPTS += \ else ifeq "$$(TargetOS_CPP)" "darwin" $1_$2_$3_GHC_LD_OPTS += -optl-Wl,-headerpad_max_install_names endif + +# This is a rather ugly hack to fix dynamically linked GHC on Windows. +# If GHC is linked with -threaded, then it links against libHSrts_thr. +# But if base is linked against libHSrts, then both end up getting +# loaded, and things go wrong. We therefore link the libraries with the +# same RTS flags that we link GHC with. +ifeq "$$(GhcThreaded)" "YES" +$1_$2_$3_GHC_LD_OPTS += -threaded +endif +ifeq "$$(GhcDebugged)" "YES" +$1_$2_$3_GHC_LD_OPTS += -debug +endif endif endif |