summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoritz Angermann <moritz.angermann@gmail.com>2018-03-05 17:18:25 +0800
committerMoritz Angermann <moritz.angermann@gmail.com>2018-03-06 09:26:01 +0800
commitf6cf4001574e789865d25f89b362a04ef1ca3df4 (patch)
tree4065af642951d9bd751f048a6b1b61901ac94afb
parentdf7ac37d43bdbabbde9b09344f9425e8e5a879ff (diff)
downloadhaskell-f6cf4001574e789865d25f89b362a04ef1ca3df4.tar.gz
`--via-asm` only for windows targets
Reviewers: trofi, bgamari Reviewed By: trofi, bgamari Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4467
-rw-r--r--mk/config.mk.in8
1 files changed, 6 insertions, 2 deletions
diff --git a/mk/config.mk.in b/mk/config.mk.in
index 26b07f3159..92830fa1e8 100644
--- a/mk/config.mk.in
+++ b/mk/config.mk.in
@@ -649,12 +649,16 @@ $(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
+ifeq "$(Windows_Target)" "YES"
# 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
+SRC_HSC2HS_OPTS_STAGE1 += --via-asm
+SRC_HSC2HS_OPTS_STAGE2 += --via-asm
+endif
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