summaryrefslogtreecommitdiff
path: root/ghc.mk
diff options
context:
space:
mode:
authorIan Lynagh <ian@well-typed.com>2013-05-09 15:28:51 +0100
committerIan Lynagh <ian@well-typed.com>2013-05-09 15:28:51 +0100
commita5a52d794ac38df35187780f4671e2ae317e93a0 (patch)
treeb170de9b89d82add191280c6734538192532502a /ghc.mk
parent4be70f9361f536ec18625833a2e9c156a4cf8ef4 (diff)
downloadhaskell-a5a52d794ac38df35187780f4671e2ae317e93a0.tar.gz
Fix dynamically linked GHC on Windows
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.
Diffstat (limited to 'ghc.mk')
-rw-r--r--ghc.mk18
1 files changed, 18 insertions, 0 deletions
diff --git a/ghc.mk b/ghc.mk
index 4bd2de3474..fcf3a7325a 100644
--- a/ghc.mk
+++ b/ghc.mk
@@ -557,6 +557,24 @@ 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"