[commit: ghc] wip/angerman/win32-cross: Compile with `--via-asm` when cross compiling. (bd2484a)
git at git.haskell.org
git at git.haskell.org
Mon Feb 26 06:13:13 UTC 2018
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/angerman/win32-cross
Link : http://ghc.haskell.org/trac/ghc/changeset/bd2484a99296d19b945acf9d16a0a290460f8e5b/ghc
>---------------------------------------------------------------
commit bd2484a99296d19b945acf9d16a0a290460f8e5b
Author: Moritz Angermann <moritz.angermann at gmail.com>
Date: Wed Feb 21 16:43:16 2018 +0800
Compile with `--via-asm` when cross compiling.
This requires a bumped hsc2hs.
>---------------------------------------------------------------
bd2484a99296d19b945acf9d16a0a290460f8e5b
mk/config.mk.in | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/mk/config.mk.in b/mk/config.mk.in
index e5ec04a..26b07f3 100644
--- a/mk/config.mk.in
+++ b/mk/config.mk.in
@@ -649,8 +649,12 @@ $(eval $(call set_stage_HSC2HS_OPTS,0))
$(eval $(call set_stage_HSC2HS_OPTS,1))
$(eval $(call set_stage_HSC2HS_OPTS,2))
ifeq "$(CrossCompiling)" "YES"
-SRC_HSC2HS_OPTS_STAGE1 += --cross-compile
-SRC_HSC2HS_OPTS_STAGE2 += --cross-compile
+# We'll assume we compile with gcc or clang, and both support `-S` and can as such use the
+# --via-asm pass, which should be faster and is required for cross compiling to windows, as
+# the c compiler complains about non-constant expressions even though they are constant and
+# end up as constants in the assembly.
+SRC_HSC2HS_OPTS_STAGE1 += --cross-compile --via-asm
+SRC_HSC2HS_OPTS_STAGE2 += --cross-compile --via-asm
endif
SRC_HSC2HS_OPTS_STAGE0 += --cflag=-D$(HostArch_CPP)_HOST_ARCH --cflag=-D$(HostOS_CPP)_HOST_OS
SRC_HSC2HS_OPTS_STAGE1 += --cflag=-D$(TargetArch_CPP)_HOST_ARCH --cflag=-D$(TargetOS_CPP)_HOST_OS
More information about the ghc-commits
mailing list