Closed
Description
On recent Haskell.nix, nix build -L --impure --expr 'import ./default.nix {}' pkgs-unstable.haskell-nix.compiler.ghc964
fails with this error:
error: builder for '/nix/store/kcihlyzx9dif01i65jha710fph7gmb8n-ghc-9.6.4.drv' failed with exit code 1;
last 25 log lines:
> | ^
> 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
> `cc' failed in phase `C Compiler'. (Exit code: 1)
> Build failed.
For full logs, run 'nix log /nix/store/kcihlyzx9dif01i65jha710fph7gmb8n-ghc-9.6.4.drv'.
error: 1 dependencies of derivation '/nix/store/d14wwdm27m1cb4pb1q5zs0p7m8s0v8c4-alex-exe-alex-3.2.7.1.drv' failed to build
error: 1 dependencies of derivation '/nix/store/8ikjv5nkhjra7il393j14kd3i3cb0wf8-ghc-9.6.4.drv' failed to build
The build succeeds if I use a slightly older nixpkgs that has GCC 13 in stdenv instead of GCC 14. I stubbed out all of the patches in overlays/bootstrap.nix
just to be sure, but bootstrap GHC 9.6.4 still fails to build.
However, upstream Nixpkgs builds GHC 9.6.4 with a GCC 14 stdenv without this issue, and I can't see why.