From 98afe02bd1a33e6e56a668f152c73e776d9a2275 Mon Sep 17 00:00:00 2001 From: Jan Philipp Tebernum Date: Sat, 28 Dec 2024 02:10:54 +0100 Subject: [PATCH] stlink: patch incorrect calloc argument order With the update to GCC 14, stlink v1.8.0 is broken, as GCC 14 enforces the correct argument order of calloc. This commit adds a little patch to resolve that issue for now. This patch should be removed and stlink updated to v1.8.1 as soon as that version gets released. --- pkgs/development/tools/misc/stlink/default.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/development/tools/misc/stlink/default.nix b/pkgs/development/tools/misc/stlink/default.nix index 27e5437d9517f..b88b06393fed5 100644 --- a/pkgs/development/tools/misc/stlink/default.nix +++ b/pkgs/development/tools/misc/stlink/default.nix @@ -2,6 +2,7 @@ lib, stdenv, fetchFromGitHub, + fetchpatch, cmake, libusb1, gtk3, @@ -30,6 +31,15 @@ stdenv.mkDerivation rec { sha256 = "sha256-hlFI2xpZ4ldMcxZbg/T5/4JuFFdO9THLcU0DQKSFqrw="; }; + patches = [ + (fetchpatch { + name = "calloc-argument-order.patch"; + url = "https://github.com/stlink-org/stlink/commit/6a6718b3342b6c5e282a4e33325b9f97908a0692.patch"; + includes = [ "src/stlink-lib/chipid.c" ]; + sha256 = "sha256-sAfcrDdoKy5Gl1o/PHEUr8uL9OBq0g1nfRe7Y0ijWAM="; + }) + ]; + buildInputs = [ libusb1'