From 323636a6aff45a48dd7a5c284fdae6d9a8e86d36 Mon Sep 17 00:00:00 2001 From: Dmitry Bogatov Date: Mon, 4 Aug 2025 14:20:41 +0000 Subject: [PATCH 1/6] krb5: Fix build with gcc=15 --- pkgs/development/libraries/kerberos/krb5.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/kerberos/krb5.nix b/pkgs/development/libraries/kerberos/krb5.nix index 790efc6865ef..0746b818b545 100644 --- a/pkgs/development/libraries/kerberos/krb5.nix +++ b/pkgs/development/libraries/kerberos/krb5.nix @@ -53,8 +53,13 @@ stdenv.mkDerivation rec { # stdenv will take care of overriding bindir, sbindir, etc. such that "out" contains the binaries. prefix = builtins.placeholder "lib"; - env = lib.optionalAttrs stdenv.hostPlatform.isStatic { - NIX_CFLAGS_COMPILE = "-fcommon"; + env = { + # The release 1.21.3 is not compatible with c23, which changed the meaning of + # + # void foo(); + # + # declaration. + NIX_CFLAGS_COMPILE = "-std=gnu17" + lib.optionalString stdenv.hostPlatform.isStatic " -fcommon"; }; configureFlags = [ From 82b27bd911b50e2f9814eb7b6cd80e24ca4fee72 Mon Sep 17 00:00:00 2001 From: Dmitry Bogatov Date: Mon, 4 Aug 2025 14:33:08 +0000 Subject: [PATCH 2/6] expect: Fix build with gcc=15 --- pkgs/development/tcl-modules/by-name/ex/expect/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/tcl-modules/by-name/ex/expect/package.nix b/pkgs/development/tcl-modules/by-name/ex/expect/package.nix index f2d0c6d4bf63..488066b341dc 100644 --- a/pkgs/development/tcl-modules/by-name/ex/expect/package.nix +++ b/pkgs/development/tcl-modules/by-name/ex/expect/package.nix @@ -52,7 +52,7 @@ tcl.mkTclDerivation rec { strictDeps = true; env = lib.optionalAttrs stdenv.cc.isGNU { - NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types"; + NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types -std=gnu17"; }; hardeningDisable = [ "format" ]; From ecea3c1bceb89911c86263fb731f3511d01d89fa Mon Sep 17 00:00:00 2001 From: Dmitry Bogatov Date: Mon, 4 Aug 2025 17:41:02 +0000 Subject: [PATCH 3/6] gpm: Fix build with gcc=15 --- pkgs/servers/gpm/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/servers/gpm/default.nix b/pkgs/servers/gpm/default.nix index 85bb78fcb89b..9a83d607c4c3 100644 --- a/pkgs/servers/gpm/default.nix +++ b/pkgs/servers/gpm/default.nix @@ -64,6 +64,9 @@ stdenv.mkDerivation { "--sysconfdir=/etc" "--localstatedir=/var" (if withNcurses then "--with-curses" else "--without-curses") + # The code won't compile in c23 mode. + # https://gcc.gnu.org/gcc-15/porting_to.html#c23-fn-decls-without-parameters + "CFLAGS=-std=gnu17" ]; enableParallelBuilding = true; From 4e2d61f0a10650a627c7d5fef502515b0ea39ca3 Mon Sep 17 00:00:00 2001 From: Dmitry Bogatov Date: Mon, 4 Aug 2025 19:08:49 +0000 Subject: [PATCH 4/6] w3m: Fix build with gcc=15 --- pkgs/by-name/w3/w3m/package.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/by-name/w3/w3m/package.nix b/pkgs/by-name/w3/w3m/package.nix index 7e26071c6dc6..f33cbede5407 100644 --- a/pkgs/by-name/w3/w3m/package.nix +++ b/pkgs/by-name/w3/w3m/package.nix @@ -105,6 +105,9 @@ stdenv.mkDerivation (finalAttrs: { configureFlags = [ "--with-ssl=${openssl.dev}" "--with-gc=${boehmgc.dev}" + # The code won't compile in c23 mode. + # https://gcc.gnu.org/gcc-15/porting_to.html#c23-fn-decls-without-parameters + "CFLAGS=-std=gnu17" ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ "ac_cv_func_setpgrp_void=${if stdenv.hostPlatform.isBSD then "no" else "yes"}" From e4e98bb0743eb03720f77068cc2949d83c3121ab Mon Sep 17 00:00:00 2001 From: Dmitry Bogatov Date: Tue, 5 Aug 2025 19:38:06 +0000 Subject: [PATCH 5/6] cpio: Fix build with gcc=15 --- pkgs/by-name/cp/cpio/package.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/by-name/cp/cpio/package.nix b/pkgs/by-name/cp/cpio/package.nix index 879b52a98c7d..d2b2ed66fa1d 100644 --- a/pkgs/by-name/cp/cpio/package.nix +++ b/pkgs/by-name/cp/cpio/package.nix @@ -24,6 +24,12 @@ stdenv.mkDerivation rec { separateDebugInfo = true; + # The code won't compile in c23 mode. + # https://gcc.gnu.org/gcc-15/porting_to.html#c23-fn-decls-without-parameters + configureFlags = [ + "CFLAGS=-std=gnu17" + ]; + preConfigure = lib.optionalString stdenv.hostPlatform.isCygwin '' sed -i gnu/fpending.h -e 's,include ,,' ''; From f96dd2fe5249e283fd4118aaee2e128c3f47f337 Mon Sep 17 00:00:00 2001 From: Dmitry Bogatov Date: Tue, 5 Aug 2025 19:24:41 +0000 Subject: [PATCH 6/6] woff2: Fix build with gcc=15 --- pkgs/by-name/wo/woff2/gcc15.patch | 37 +++++++++++++++++++++++++++++++ pkgs/by-name/wo/woff2/package.nix | 2 +- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 pkgs/by-name/wo/woff2/gcc15.patch diff --git a/pkgs/by-name/wo/woff2/gcc15.patch b/pkgs/by-name/wo/woff2/gcc15.patch new file mode 100644 index 000000000000..7ba9eee11f1d --- /dev/null +++ b/pkgs/by-name/wo/woff2/gcc15.patch @@ -0,0 +1,37 @@ +From 08ece7871775c0d7bf4fdff64b961cdc256adf6c Mon Sep 17 00:00:00 2001 +From: Sergei Trofimovich +Date: Fri, 2 Aug 2024 22:12:03 +0100 +Subject: [PATCH] include/woff2/output.h: add missing include + +Without the change `woff2` build fails on upcoming `gcc-15` as: + + In file included from src/woff2_out.cc:9: + include/woff2/output.h:73:25: error: expected ')' before '*' token + 73 | WOFF2MemoryOut(uint8_t* buf, size_t buf_size); + | ~ ^ + | ) + include/woff2/output.h:79:3: error: 'uint8_t' does not name a type + 79 | uint8_t* buf_; + | ^~~~~~~ + include/woff2/output.h:16:1: note: 'uint8_t' is defined in header ''; + this is probably fixable by adding '#include ' + 15 | #include + +++ |+#include + 16 | +--- + include/woff2/output.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/include/woff2/output.h b/include/woff2/output.h +index dc78ccf..b12d538 100644 +--- a/include/woff2/output.h ++++ b/include/woff2/output.h +@@ -9,6 +9,8 @@ + #ifndef WOFF2_WOFF2_OUT_H_ + #define WOFF2_WOFF2_OUT_H_ + ++#include ++ + #include + #include + #include diff --git a/pkgs/by-name/wo/woff2/package.nix b/pkgs/by-name/wo/woff2/package.nix index 22d3ce49e41a..b6d15a53a520 100644 --- a/pkgs/by-name/wo/woff2/package.nix +++ b/pkgs/by-name/wo/woff2/package.nix @@ -26,7 +26,7 @@ stdenv.mkDerivation rec { ]; # Need to explicitly link to brotlicommon - patches = lib.optional static ./brotli-static.patch; + patches = lib.optional static ./brotli-static.patch ++ [ ./gcc15.patch ]; nativeBuildInputs = [ cmake