Compiling x86_64->aarch64 cross GHC fails with RTS compilation warning
Compiling x86_64->aarch64 cross GHC with hadrian/build --flavour=quick-validate 'stage1.rts.cabal.configure.opts+=--configure-option=--disable-large-address-space' --docs=none -j
fails with the following GCC warning message when compiling the RTS:
Command line: _build/stage0/bin/aarch64-linux-gnu-ghc -Wall -hisuf debug_dyn_hi -osuf debug_dyn_o -hcsuf debug_dyn_hc -fPIC -dynamic -ticky -DDEBUG -DTICKY_TICKY -optc-DDEBUG -optc-DTICKY_TICKY -hide-all-packages -no-user-package-db '-package-env -' '-package-db _build/stage1/inplace/package.conf.d' '-this-unit-id rts-1.0.2' '-this-package-name rts' -i -i/workspace/ghc-cross-aarch64/_build/stage1/rts/build -i/workspace/ghc-cross-aarch64/_build/stage1/rts/build/autogen -i/workspace/ghc-cross-aarch64/rts -Irts/include -I_build/stage1/rts/build -I_build/stage1/rts/build/include -Irts/include -optP-include -optP_build/stage1/rts/build/autogen/cabal_macros.h -ghcversion-file=rts/include/ghcversion.h -outputdir _build/stage1/rts/build -this-unit-id rts -XHaskell98 -no-global-package-db -package-db=/workspace/ghc-cross-aarch64/_build/stage1/inplace/package.conf.d -ghcversion-file=rts/include/ghcversion.h -ghcversion-file=rts/include/ghcversion.h -optc-Irts/include -optc-I_build/stage1/rts/build -optc-I_build/stage1/rts/build/include -optc-Irts/include -optc-fPIC -optc-DDYNAMIC -Wnoncanonical-monad-instances -optc-Wno-error=inline -c rts/linker/elf_tlsgd.c -o _build/stage1/rts/build/c/linker/elf_tlsgd.debug_dyn_o -O -Werror -optc-Werror -optc-Wno-error=unknown-pragmas -optc-Wno-error=inline -optc-Wall -optc-Wextra -optc-Wstrict-prototypes -optc-Wmissing-prototypes -optc-Wmissing-declarations -optc-Winline -optc-Wpointer-arith -optc-Wmissing-noreturn -optc-Wnested-externs -optc-Wredundant-decls -optc-Wundef -optc-fno-strict-aliasing -optc-DDEBUG -optc-DTICKY_TICKY -optc-fomit-frame-pointer -optc-O2 -optc-Irts -optc-I_build/stage1/rts/build -optc-DDEBUG -optc-fno-omit-frame-pointer -optc-g3 -optc-O0 -optc-DFS_NAMESPACE=rts -optc-DCOMPILING_RTS -Irts -I_build/stage1/rts/build -DTICKY_TICKY -optc-DTICKY_TICKY -Wno-deprecated-flags -Wcpp-undef
===> Command failed with error code: 1
In file included from rts/linker/elf_tlsgd.c:1:0: error:
rts/include/rts/storage/Block.h:197:10: error:
error: ‘HEAP_ALLOCED_GC’ is static but used in inline function ‘Bdescr’ which is not static [-Werror]
197 | ASSERT(HEAP_ALLOCED_GC(p));
| ^~~~~~~~~~~~~~~
|
197 | ASSERT(HEAP_ALLOCED_GC(p));
| ^
rts/include/Rts.h:79:43: error:
note: in definition of macro ‘RTS_LIKELY’
79 | #define RTS_LIKELY(p) __builtin_expect(!!(p), 1)
| ^
|
79 | #define RTS_LIKELY(p) __builtin_expect(!!(p), 1)
| ^
rts/include/Rts.h:154:10: error:
note: in expansion of macro ‘CHECK’
154 | do { CHECK(predicate); } while(0)
| ^~~~~
|
154 | do { CHECK(predicate); } while(0)
| ^
rts/include/rts/storage/Block.h:197:3: error:
note: in expansion of macro ‘ASSERT’
197 | ASSERT(HEAP_ALLOCED_GC(p));
| ^~~~~~
|
197 | ASSERT(HEAP_ALLOCED_GC(p));
| ^
cc1: all warnings being treated as errors
`aarch64-linux-gnu-gcc' failed in phase `C Compiler'. (Exit code: 1)
Command failed
Build failed.
This is not detected by existing cross aarch64 job since that one doesn't cover the --disable-large-address-space
code path.