From a3c97b5a84254cb855be56a666d54bb99283d6c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charlotte=20=F0=9F=A6=9D=20Dele=C5=84kec?= Date: Wed, 31 Dec 2025 14:10:12 +0100 Subject: [PATCH] flex: fix cross-compile with gcc 15 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit flex’s malloc forward-definition was using old syntax no longer supported by C23. This definition was seemingly only used when cross-compiling flex --- pkgs/development/tools/parsing/flex/default.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkgs/development/tools/parsing/flex/default.nix b/pkgs/development/tools/parsing/flex/default.nix index 31029af8a5fc..6721ac53862a 100644 --- a/pkgs/development/tools/parsing/flex/default.nix +++ b/pkgs/development/tools/parsing/flex/default.nix @@ -30,7 +30,14 @@ stdenv.mkDerivation rec { url = "https://raw.githubusercontent.com/lede-project/source/0fb14a2b1ab2f82ce63f4437b062229d73d90516/tools/flex/patches/200-build-AC_USE_SYSTEM_EXTENSIONS-in-configure.ac.patch"; sha256 = "0mpp41zdg17gx30kcpj83jl8hssks3adbks0qzbhcz882b9c083r"; }) - ]; + ] + ++ (lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + (fetchurl { + name = "gcc-15.patch"; + url = "https://github.com/westes/flex/commit/bf254c75b1e0d2641ebbd7fc85fb183f36a62ea7.patch"; + hash = "sha256-Bnv23M2K1Qf7pEaEz0ueSNzTCdjMTDiMm+H7JaxUISs="; + }) + ]); postPatch = '' patchShebangs tests