GHC 8.10.4 compilation failure on RISC-V/Ubuntu 20.04.x LTS (stg_atomicModifyMutVarzh undeclared)
Just for the record as I know development is done elsewhere. The bootstrap compiler is ghc 8.6.5 provided by ubuntu. The compilation failure looks like:
"/usr/bin/ghc" -hisuf hi -osuf o -hcsuf hc -static -H32m -O -Wall -Iincludes -Iincludes/dist -Iincludes/dist-derivedconstants/header -Iincludes/dist-ghcconstants/header -package-db libraries/bootstrapping.conf -this-unit-id ghc-8.10.4 -hide-all-packages -i -icompiler/. -icompiler/backpack -icompiler/basicTypes -icompiler/cmm -icompiler/coreSyn -icompiler/deSugar -icompiler/ghci -icompiler/iface -icompiler/llvmGen -icompiler/main -icompiler/nativeGen -icompiler/parser -icompiler/prelude -icompiler/profiling -icompiler/rename -icompiler/simplCore -icompiler/simplStg -icompiler/specialise -icompiler/stgSyn -icompiler/stranal -icompiler/typecheck -icompiler/types -icompiler/utils -icompiler/hieFile -icompiler/stage1/build -Icompiler/stage1/build -icompiler/stage1/build/./autogen -Icompiler/stage1/build/./autogen -Icompiler/. -Icompiler/parser -Icompiler/utils -Icompiler/stage1 -Icompiler/stage1/build/. -Icompiler/stage1/build/parser -Icompiler/stage1/build/utils -Icompiler/stage1/build/stage1 -optP-DCAN_LOAD_DLL -optP-Iincludes/dist/build -optP-include -optPcompiler/stage1/build/./autogen/cabal_macros.h -package-id array-0.5.3.0 -package-id base-4.12.0.0 -package-id binary-0.8.8.0 -package-id bytestring-0.10.8.2 -package-id containers-0.6.0.1 -package-id deepseq-1.4.4.0 -package-id directory-1.3.3.0 -package-id filepath-1.4.2.1 -package-id ghc-boot-8.10.4 -package-id ghc-boot-th-8.10.4 -package-id ghc-heap-8.10.4 -package-id ghci-8.10.4 -package-id hpc-0.6.1.0 -package-id process-1.6.5.0 -package-id template-haskell-2.16.0.0 -package-id terminfo-0.4.1.4 -package-id time-1.8.0.2 -package-id transformers-0.5.6.2 -package-id unix-2.7.2.2 -Wall -Wno-name-shadowing -Wnoncanonical-monad-instances -Wnoncanonical-monoid-instances -this-unit-id ghc -XHaskell2010 -XNoImplicitPrelude -DNO_REGS -DNOSMP -optc-DNOSMP -Iincludes/dist/build -Rghc-timing -Wcpp-undef -no-user-package-db -rtsopts -DDYNAMIC_GHC_PROGRAMS -outputdir compiler/stage1/build -c compiler/utils/Util.hs -o compiler/stage1/build/Util.o
In file included from /tmp/ghc30411_0/ghc_3.hc:3:0: error:
/tmp/ghc30411_0/ghc_3.hc: In function ‘_clgp’:
/tmp/ghc30411_0/ghc_3.hc:11262:11: error:
error: ‘stg_atomicModifyMutVarzh’ undeclared (first use in this function); did you mean ‘stg_atomicModifyMutVar2zh’?
|
11262 | JMP_((W_)&stg_atomicModifyMutVarzh);
| ^
11262 | JMP_((W_)&stg_atomicModifyMutVarzh);
| ^~~~~~~~~~~~~~~~~~~~~~~~
includes/Stg.h:310:39: error:
note: in definition of macro ‘JMP_’
310 | #define JMP_(cont) return((StgFunPtr)(cont))
| ^~~~
|
310 | #define JMP_(cont) return((StgFunPtr)(cont))
| ^
/tmp/ghc30411_0/ghc_3.hc:11262:11: error:
note: each undeclared identifier is reported only once for each function it appears in
|
11262 | JMP_((W_)&stg_atomicModifyMutVarzh);
| ^
11262 | JMP_((W_)&stg_atomicModifyMutVarzh);
| ^~~~~~~~~~~~~~~~~~~~~~~~
includes/Stg.h:310:39: error:
note: in definition of macro ‘JMP_’
310 | #define JMP_(cont) return((StgFunPtr)(cont))
| ^~~~
|
310 | #define JMP_(cont) return((StgFunPtr)(cont))
| ^
`riscv64-linux-gnu-gcc' failed in phase `C Compiler'. (Exit code: 1)
<<ghc: 1519236296 bytes, 201 GCs, 17772331/50027304 avg/max bytes residency (7 samples), 105M in use, 0.066 INIT (0.058 elapsed), 36.292 MUT (38.536 elapsed), 5.754 GC (5.272 elapsed) :ghc>>
make[1]: *** [compiler/ghc.mk:307: compiler/stage1/build/Util.o] Error 1
make: *** [Makefile:126: all] Error 2