[aarch64, ppc64le, s390x] ghc-9.6.4 rts fails to build with gcc14
Summary
gcc14 pre-release just landed this week in Fedora Rawhide (for Fedora 40). Apparently gcc-14 defaults to level 3 C type-safety, which can break a lot of code in general. In particular the GHC rts seems affected for ghc-9.6 and some earlier versions (though not 9.8 or 9.4 somehow).
Steps to reproduce
Building ghc9.6 for Fedora on aarch64 (I can provide detailed steps if needed) https://src.fedoraproject.org/rpms/ghc9.6/blob/rawhide/f/ghc9.6.spec https://koji.fedoraproject.org/koji/taskinfo?taskID=112038948 (parent process)
https://koji.fedoraproject.org/koji/taskinfo?taskID=112008520 (aarch64)
The errors look like this: https://koji.fedoraproject.org/koji/taskinfo?taskID=112042120 https://koji.fedoraproject.org/koji/getfile?taskID=112042120&name=build.log&offset=-60000
| Run Ghc CompileCWithGhc Stage1: rts/Task.c => _build/stage1/rts/build/c/Task.thr_o
| Run Ghc CompileCWithGhc Stage1: rts/adjustor/LibffiAdjustor.c => _build/stage1/rts/build/c/adjustor/LibffiAdjustor.o
Command line: _build/stage0/bin/ghc -Wall -hisuf hi -osuf o -hcsuf hc -static -hide-all-packages -no-user-package-db '-package-env -' '-package-db _build/stage1/inplace/package.conf.d' '-this-unit-id rts-1.0.2' -i -i/builddir/build/BUILD/ghc-9.6.4/_build/stage1/rts/build -i/builddir/build/BUILD/ghc-9.6.4/_build/stage1/rts/build/autogen -i/builddir/build/BUILD/ghc-9.6.4/rts -Irts/include -I_build/stage1/rts/build -I_build/stage1/rts/build/include -I_build/stage1/rts/build/@FFIIncludeDir@ -I_build/stage1/rts/build/@LibdwIncludeDir@ -Irts/include -Irts/@FFIIncludeDir@ -Irts/@LibdwIncludeDir@ -optP-include -optP_build/stage1/rts/build/autogen/cabal_macros.h -ghcversion-file=rts/include/ghcversion.h -outputdir _build/stage1/rts/build -optc-Irts/include -optc-I_build/stage1/rts/build -optc-I_build/stage1/rts/build/include -optc-I_build/stage1/rts/build/@FFIIncludeDir@ -optc-I_build/stage1/rts/build/@LibdwIncludeDir@ -optc-Irts/include -optc-Irts/@FFIIncludeDir@ -optc-Irts/@LibdwIncludeDir@ -Wnoncanonical-monad-instances -optc-Wno-error=inline -optP-Wno-nonportable-include-path -c rts/adjustor/LibffiAdjustor.c -o _build/stage1/rts/build/c/adjustor/LibffiAdjustor.o -O0 -H64m -this-unit-id rts -XHaskell98 -no-global-package-db -package-db=/builddir/build/BUILD/ghc-9.6.4/_build/stage1/inplace/package.conf.d -ghcversion-file=rts/include/ghcversion.h -ghcversion-file=rts/include/ghcversion.h -O -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-fomit-frame-pointer -optc-O2 -optc-Irts -optc-I_build/stage1/rts/build -Irts -I_build/stage1/rts/build '-DRtsWay="rts_v"' -DFS_NAMESPACE=rts -DCOMPILING_RTS -Wno-deprecated-flags -Wcpp-undef
===> Command failed with error code: 1
rts/adjustor/LibffiAdjustor.c: In function ‘allocate_adjustor’:
rts/adjustor/LibffiAdjustor.c:42:43: error:
error: passing argument 1 of ‘ffi_alloc_prep_closure’ from incompatible pointer type [-Wincompatible-pointer-types]
42 | ffi_status r = ffi_alloc_prep_closure(&writ, cif, wptr, hptr, exec_ret);
| ^~~~~
| |
| void **
|
42 | ffi_status r = ffi_alloc_prep_closure(&writ, cif, wptr, hptr, exec_ret);
| ^
rts/adjustor/LibffiAdjustor.c:21:56: error:
note: expected ‘ffi_closure **’ but argument is of type ‘void **’
21 | static ffi_status ffi_alloc_prep_closure(ffi_closure **pclosure, ffi_cif *cif,
| ~~~~~~~~~~~~~~^~~~~~~~
|
21 | static ffi_status ffi_alloc_prep_closure(ffi_closure **pclosure, ffi_cif *cif,
| ^
At top level:
cc1: note: unrecognized command-line option ‘-Wno-nonportable-include-path’ may have been intended to silence earlier diagnostics
`gcc' failed in phase `C Compiler'. (Exit code: 1)
Command failed
Build failed.
Expected behavior
To build like with ghc13.
Environment
- GHC version used: 9.6.4
Optional:
- Operating System: Fedora Linux Rawhide
- System Architecture: aarch64, ppc64le, s390x https://koji.fedoraproject.org/koji/taskinfo?taskID=112038948
For 9.0 and 8.10 Intel also fails.