From 9cc5b1ec94d260383b7743b123edc7799ce1bcab Mon Sep 17 00:00:00 2001 From: Alex Tunstall Date: Sat, 7 Feb 2026 12:57:27 +0000 Subject: [PATCH] ghc: Fix regression in unregisterised builds The default GCC compiler in Nixpkgs was recently changed, bringing in a new default C standard (gnu23), which GHC's C backend is not compatible with. This fix adds a flag to force GCC to use an older compatible C standard. --- pkgs/development/compilers/ghc/common-make-native-bignum.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/compilers/ghc/common-make-native-bignum.nix b/pkgs/development/compilers/ghc/common-make-native-bignum.nix index 2300e0470ca79..5d05d4b298b8a 100644 --- a/pkgs/development/compilers/ghc/common-make-native-bignum.nix +++ b/pkgs/development/compilers/ghc/common-make-native-bignum.nix @@ -536,6 +536,8 @@ stdenv.mkDerivation ( ] ++ lib.optionals enableUnregisterised [ "--enable-unregisterised" + # The C backend generates code incompatible with gnu23 + "CONF_CC_OPTS_STAGE2=-std=gnu17" ]; # Make sure we never relax`$PATH` and hooks support for compatibility.