ghc-HEAD broke cross-compilation on multiple tagets due to --via-asm switch
Commit http://git.haskell.org/ghc.git/commitdiff/5f6fcf7808b16d066ad0fb2068225b3f2e8363f7
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[1]: *** [libraries/unix/ghc.mk:4: libraries/unix/dist-install/build/System/Posix/Files.hs] Error 1
Trac metadata
| Trac field | Value |
|---|---|
| Version | 8.5 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | angerman |
| Operating system | |
| Architecture |