Commit b2cae55f authored by Ian Lynagh's avatar Ian Lynagh

We actually need to use -threaded/-debug when linking /all/ DLLs

Not just base, integer-gmp and ghc-prim.
parent ba00c33b
......@@ -556,24 +556,6 @@ $(error Unknown integer library: $(INTEGER_LIBRARY))
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
......
......@@ -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
......
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