GHC since 8.10 build fails on Debian armel
GHC 8.10.x builds fail on 32-bit ARMv5 without hardfloat.
8.10.4 with LLVM 11: https://buildd.debian.org/status/fetch.php?pkg=ghc&arch=armel&ver=8.10.4-1%7Eexp1&stamp=1613305029&raw=0
8.10.6 with LLVM 12: https://buildd.debian.org/status/fetch.php?pkg=ghc&arch=armel&ver=8.10.6-1%7Eexp2&stamp=1629838287&raw=0
I also tried 8.10.6 with -mattr=+soft-float,-fp16,-vfp2,-vfp2sp,-vfp3,-vfp3sp,-vfp3d16,-vfp3d16sp,-vfp4,-vfp4sp,-vfp4d16,-vfp4d16sp,-fp-armv8,-fp-armv8sp,-fp-armv8d16,-fp-armv8d16sp,-fullfp16,-neon,-crypto,-dotprod,-fp16fml,-fp64,-d32,-fpregs,+strict-align
and got this
"inplace/bin/ghc-stage1" -static -H32m -O -lffi -optl-pthread -Wall -Iincludes -Iincludes/dist -Iincludes/dist-derivedconstants/header -Iincludes/dist-ghcconstants/header -Iincludes/dist-install/build -Irts -Irts/dist/build -DCOMPILING_RTS -DFS_NAMESPACE=rts -this-unit-id rts -optc-DNOSMP -dcmm-lint -package-env - -i -irts -irts/dist/build -Irts/dist/build -irts/dist/build/./autogen -Irts/dist/build/./autogen -O2 -Wcpp-undef -Wnoncanonical-monad-instances -c rts/StgMiscClosures.cmm -o rts/dist/build/StgMiscClosures.o
"inplace/bin/ghc-stage1" -static -H32m -O -lffi -optl-pthread -Wall -Iincludes -Iincludes/dist -Iincludes/dist-derivedconstants/header -Iincludes/dist-ghcconstants/header -Iincludes/dist-install/build -Irts -Irts/dist/build -DCOMPILING_RTS -DFS_NAMESPACE=rts -this-unit-id rts -optc-DNOSMP -dcmm-lint -package-env - -i -irts -irts/dist/build -Irts/dist/build -irts/dist/build/./autogen -Irts/dist/build/./autogen -O2 -Wcpp-undef -Wnoncanonical-monad-instances -c rts/StgStartup.cmm -o rts/dist/build/StgStartup.o
LLVM ERROR: unable to allocate function argument #8
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.
Stack dump:
0. Program arguments: llc-12 -O2 -enable-tbaa -relocation-model=pic -mcpu=arm7tdmi -mattr=+soft-float,-fp16,-vfp2,-vfp2sp,-vfp3,-vfp3sp,-vfp3d16,-vfp3d16sp,-vfp4,-vfp4sp,-vfp4d16,-vfp4d16sp,-fp-armv8,-fp-armv8sp,-fp-armv8d16,-fp-armv8d16sp,-fullfp16,-neon,-crypto,-dotprod,-fp16fml,-fp64,-d32,-fpregs,+strict-align /tmp/ghc20177_0/ghc_6.bc -o /tmp/ghc20177_0/ghc_7.lm_s
1. Running pass 'Function Pass Manager' on module '/tmp/ghc20177_0/ghc_6.bc'.
2. Running pass 'ARM Instruction Selection' on function '@"stg_gc_f1$def"'
`llc-12' failed in phase `LLVM Compiler'. (Exit code: -6)
make[3]: *** [rts/ghc.mk:325: rts/dist/build/HeapStackCheck.o] Error 1
make[3]: *** Waiting for unfinished jobs....
LLVM ERROR: unable to allocate function argument #8
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.
Stack dump:
0. Program arguments: llc-12 -O2 -enable-tbaa -relocation-model=pic -mcpu=arm7tdmi -mattr=+soft-float,-fp16,-vfp2,-vfp2sp,-vfp3,-vfp3sp,-vfp3d16,-vfp3d16sp,-vfp4,-vfp4sp,-vfp4d16,-vfp4d16sp,-fp-armv8,-fp-armv8sp,-fp-armv8d16,-fp-armv8d16sp,-fullfp16,-neon,-crypto,-dotprod,-fp16fml,-fp64,-d32,-fpregs,+strict-align /tmp/ghc20228_0/ghc_6.bc -o /tmp/ghc20228_0 /ghc_7.lm_s
1. Running pass 'Function Pass Manager' on module '/tmp/ghc20228_0/ghc_6.bc'.
2. Running pass 'ARM Instruction Selection' on function '@"stg_ctoi_F1_info$def"'
`llc-12' failed in phase `LLVM Compiler'. (Exit code: -6)
make[3]: *** [rts/ghc.mk:325: rts/dist/build/StgMiscClosures.o] Error 1
make[2]: *** [Makefile:128: all] Error 2