[commit: ghc] master: Fix dynamically linked GHC on Windows (a5a52d7)

Ian Lynagh igloo at earth.li
Thu May 9 22:07:15 CEST 2013


Repository : http://darcs.haskell.org/ghc.git/

On branch  : master

https://github.com/ghc/ghc/commit/a5a52d794ac38df35187780f4671e2ae317e93a0

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

commit a5a52d794ac38df35187780f4671e2ae317e93a0
Author: Ian Lynagh <ian at well-typed.com>
Date:   Thu May 9 15:28:51 2013 +0100

    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.

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

 ghc.mk | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/ghc.mk b/ghc.mk
index 4bd2de3..fcf3a73 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"





More information about the ghc-commits mailing list