ghc-HEAD broke cross-compilation on multiple tagets due to --via-asm switch
enables --via-asm for all targets:
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
But the discussion in original submission https://github.com/haskell/hsc2hs/pull/5 talks about opt-in and mostly x86 assembly support.
Before this change targets like sparc were cross-compiling just fine. Now sparc-unknown-linux-gnu fails as:
hsc2hs: Failed to extract integer CallStack (from HasCallStack): error, called at utils/hsc2hs/CrossCodegen.hs:606:27 in main:CrossCodegen make: *** [libraries/unix/ghc.mk:4: libraries/unix/dist-install/build/System/Posix/Files.hs] Error 1