[commit: ghc] master: ghc: tweak cross-compilation to mingw32 (8908ba3)

git at git.haskell.org git at git.haskell.org
Sun Apr 23 14:20:09 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/8908ba31c4dcb6ce619ec46e88fbbac78651a04b/ghc

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

commit 8908ba31c4dcb6ce619ec46e88fbbac78651a04b
Author: Sergei Trofimovich <slyfox at gentoo.org>
Date:   Sun Apr 23 15:10:26 2017 +0100

    ghc: tweak cross-compilation to mingw32
    
    The build failure when cross-compiling from
    linux to windows looks like:
    
        HC [stage 1] ghc/stage2/build/tmp/ghc-stage2.exe
          Call hs_init_ghc() from your main() function to set these options.
      /usr/libexec/gcc/i686-w64-mingw32/ld: cannot find -lHSghc-8.3-0
    
    Similar to commit 745032dd02da511067c2939259ed212852187e0f
    ("rts: tweak cross-compilation to mingw32") decision to split
    stage2 should be done based based on TargetOS, not HostOS.
    
    Signed-off-by: Sergei Trofimovich <slyfox at gentoo.org>


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

8908ba31c4dcb6ce619ec46e88fbbac78651a04b
 rules/build-package-way.mk | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/rules/build-package-way.mk b/rules/build-package-way.mk
index f230ef5..7775856 100644
--- a/rules/build-package-way.mk
+++ b/rules/build-package-way.mk
@@ -27,7 +27,7 @@ $1_$2_$3_LIB_FILE = libHS$$($1_$2_COMPONENT_ID)$$($3_libsuf)
 $1_$2_$3_LIB = $1/$2/build/$$($1_$2_$3_LIB_FILE)
 $$($1_$2_COMPONENT_ID)_$2_$3_LIB = $$($1_$2_$3_LIB)
 
-ifeq "$$(HostOS_CPP)" "mingw32"
+ifeq "$$(TargetOS_CPP)" "mingw32"
 ifneq "$$($1_$2_dll0_HS_OBJS)" ""
 $1_$2_$3_LIB0_ROOT = HS$$($1_$2_COMPONENT_ID)-0$$($3_libsuf)
 $1_$2_$3_LIB0_NAME = lib$$($1_$2_$3_LIB0_ROOT)
@@ -75,7 +75,7 @@ $1/$2/dll-split.stamp: $$($1_$2_depfile_haskell) $$$$(dll-split_INPLACE)
 
 # Link a dynamic library
 # On windows we have to supply the extra libs this one links to when building it.
-ifeq "$$(HostOS_CPP)" "mingw32"
+ifeq "$$(TargetOS_CPP)" "mingw32"
 $$($1_$2_$3_LIB) : $$($1_$2_$3_ALL_OBJS) $$(ALL_RTS_LIBS) $$($1_$2_$3_DEPS_LIBS)
 ifneq "$$($1_$2_$3_LIB0)" ""
 	$$(call build-dll,$1,$2,$3,-L$1/$2/build -l$$($1_$2_$3_LIB0_ROOT),$$(filter-out $$($1_$2_dll0_HS_OBJS),$$($1_$2_$3_HS_OBJS)) $$($1_$2_$3_NON_HS_OBJS),$$@)
@@ -89,14 +89,14 @@ $$($1_$2_$3_LIB0) : $$($1_$2_$3_ALL_OBJS) $$(ALL_RTS_LIBS) $$($1_$2_$3_DEPS_LIBS
 	$$(call build-dll,$1,$2,$3,,$$($1_$2_dll0_HS_OBJS) $$($1_$2_$3_NON_HS_OBJS),$$($1_$2_$3_LIB0))
 endif
 
-else # ifneq "$$(HostOS_CPP)" "mingw32"
+else # ifneq "$$(TargetOS_CPP)" "mingw32"
 $$($1_$2_$3_LIB) : $$($1_$2_$3_ALL_OBJS) $$(ALL_RTS_LIBS) $$($1_$2_$3_DEPS_LIBS)
 	$$(call cmd,$1_$2_HC) $$($1_$2_$3_ALL_HC_OPTS) $$($1_$2_$3_GHC_LD_OPTS) $$($1_$2_$3_ALL_OBJS) \
          -shared -dynamic -dynload deploy \
 	 $$(addprefix -l,$$($1_$2_EXTRA_LIBRARIES)) $$(addprefix -L,$$($1_$2_EXTRA_LIBDIRS)) \
          -no-auto-link-packages \
          -o $$@
-endif # "$$(HostOS_CPP)" "mingw32"
+endif # "$$(TargetOS_CPP)" "mingw32"
 
 else # ifneq "$3" "dyn"
 
@@ -116,7 +116,7 @@ else
 endif
 	$$(call removeFiles,$$@.contents)
 
-ifeq "$$(HostOS_CPP)" "mingw32"
+ifeq "$$(TargetOS_CPP)" "mingw32"
 ifneq "$$($1_$2_$3_LIB0)" ""
 $$($1_$2_$3_LIB) : $$($1_$2_$3_LIB0)
 $$($1_$2_$3_LIB0) :



More information about the ghc-commits mailing list