From 1e5395d29a336c277009d7a39bfb076745c619b3 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sat, 16 May 2026 14:35:10 +0100 Subject: [PATCH] libopcodes_2_38: fix `gcc-15` build Without the change the build fails on `master` as https://hydra.nixos.org/build/327027927: ``` mips-opc.c: In function 'decode_mips_operand': mips-formats.h:86:7: error: expected identifier or '(' before 'static_assert' 86 | static_assert[(1 << (SIZE)) == ARRAY_SIZE (MAP)]; \ | ^~~~~~~~~~~~~ ``` Apply upstream fix to get it built. ZHF: #516381 --- pkgs/development/tools/misc/binutils/2.38/default.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/development/tools/misc/binutils/2.38/default.nix b/pkgs/development/tools/misc/binutils/2.38/default.nix index 76fd22da449a..1354fddf50a9 100644 --- a/pkgs/development/tools/misc/binutils/2.38/default.nix +++ b/pkgs/development/tools/misc/binutils/2.38/default.nix @@ -8,6 +8,7 @@ buildPackages, fetchFromGitHub, fetchurl, + fetchpatch, flex, gettext, lib, @@ -84,6 +85,15 @@ stdenv.mkDerivation { # https://sourceware.org/git/?p=binutils-gdb.git;a=patch;h=99852365513266afdd793289813e8e565186c9e6 # https://github.com/NixOS/nixpkgs/issues/170946 ./deterministic-temp-prefixes.patch + + # Fix gcc-15 build: + # https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=8ebe62f3f0d27806b1bf69f301f5e188b4acd2b4 + (fetchpatch { + name = "gcc-15.patch"; + url = "https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff_plain;h=8ebe62f3f0d27806b1bf69f301f5e188b4acd2b4"; + hash = "sha256-Od0PXWKoo9rKhveZ1rWJsdpS17fgmU2AevcVWXvWkSA="; + excludes = [ "opcodes/s390-opc.c" ]; + }) ] ++ lib.optional targetPlatform.isiOS ./support-ios.patch ++ lib.optional stdenv.targetPlatform.isWindows ./windres-locate-gcc.patch