From bc58993f99a817e70905acfaaa43b5dcf5b63e31 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Mon, 25 May 2026 08:56:32 +0100 Subject: [PATCH] libffi_3_3: fix `gcc-15` build Without the chnage the build fails in `master` as https://hydra.nixos.org/build/329329821: ``` FAIL: libffi.call/va_struct2.c -W -Wall -Wno-psabi -O0 (test for excess errors) FAIL: libffi.call/va_struct2.c -W -Wall -Wno-psabi -O2 (test for excess errors) FAIL: libffi.call/va_struct3.c -W -Wall -Wno-psabi -O0 (test for excess errors) FAIL: libffi.call/va_struct3.c -W -Wall -Wno-psabi -O2 (test for excess errors) ``` ZHF: #516381 --- pkgs/by-name/li/libffi_3_3/package.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/li/libffi_3_3/package.nix b/pkgs/by-name/li/libffi_3_3/package.nix index fbf27320c26e..791799bc3337 100644 --- a/pkgs/by-name/li/libffi_3_3/package.nix +++ b/pkgs/by-name/li/libffi_3_3/package.nix @@ -2,6 +2,7 @@ lib, stdenv, fetchurl, + fetchpatch, doCheck ? true, # test suite depends on dejagnu which cannot be used during bootstrapping dejagnu, @@ -16,7 +17,15 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-cvunkicD3fp6Ao1ROsFahcjVTI1n9V+lpIAohdxlIFY="; }; - patches = [ ]; + patches = [ + # Backport gcc-15 fix: + # https://github.com/libffi/libffi/pull/861 + (fetchpatch { + name = "gcc-15.patch"; + url = "https://github.com/libffi/libffi/commit/0859f8431242d5adff21420b9cab538d2af527b5.patch"; + hash = "sha256-Py4ZAhVyXsfLxr4pnYAH7/lcsQOmpToFgvjQvLg9XVc="; + }) + ]; outputs = [ "out"