diff options
author | Moritz Angermann <moritz.angermann@gmail.com> | 2018-03-02 16:16:52 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2018-03-02 16:53:41 -0500 |
commit | 5f6fcf7808b16d066ad0fb2068225b3f2e8363f7 (patch) | |
tree | 3bea78f9c461d036e966e8ad1c93ed5d24afca38 | |
parent | ffb2738f86c4e4c3f0eaacf0a95d7326fdd2e383 (diff) | |
download | haskell-5f6fcf7808b16d066ad0fb2068225b3f2e8363f7.tar.gz |
Compile with `--via-asm` when cross compiling.
This bumps `hsc2hs` and adds the new `--via-asm` flag,
which allows to successfully cross compile the win32
lirbary.
- Compile with `--via-asm` when cross compiling. This requires
haskell/hsc2hs#5 (https://github.com/haskell/hsc2hs/pull/5)
Test Plan: ./validate
Reviewers: bgamari
Reviewed By: bgamari
Subscribers: rwbarton, thomie, carter
Differential Revision: https://phabricator.haskell.org/D4439
-rw-r--r-- | mk/config.mk.in | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/mk/config.mk.in b/mk/config.mk.in index e5ec04a195..26b07f3159 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 |