From f357d9f4532e00494dfac25f45bc4e522a4741fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Thu, 25 Sep 2025 12:23:40 -0700 Subject: [PATCH] onnxruntime: fix build with gcc15 --- pkgs/by-name/on/onnxruntime/package.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/on/onnxruntime/package.nix b/pkgs/by-name/on/onnxruntime/package.nix index 2964c8a1ac37..3f332b60e81a 100644 --- a/pkgs/by-name/on/onnxruntime/package.nix +++ b/pkgs/by-name/on/onnxruntime/package.nix @@ -3,6 +3,7 @@ stdenv, lib, fetchFromGitHub, + fetchpatch, abseil-cpp_202407, cmake, cpuinfo, @@ -83,7 +84,15 @@ effectiveStdenv.mkDerivation rec { pname = "onnxruntime"; inherit src version; - patches = lib.optionals cudaSupport [ + patches = [ + # https://github.com/microsoft/onnxruntime/pull/24583 + (fetchpatch { + name = "fix-compilation-with-gcc-15.patch"; + url = "https://github.com/microsoft/onnxruntime/commit/f7619dc93f592ddfc10f12f7145f9781299163a0.patch"; + hash = "sha256-jxfMB+/Zokcu5DSfZP7QV1E8mTrsLe/sMr+ZCX/Y3m0="; + }) + ] + ++ lib.optionals cudaSupport [ # We apply the referenced 1064.patch ourselves to our nix dependency. # FIND_PACKAGE_ARGS for CUDA was added in https://github.com/microsoft/onnxruntime/commit/87744e5 so it might be possible to delete this patch after upgrading to 1.17.0 ./nvcc-gsl.patch