From b706c583d0fb3e6fc86e37d49db06d09488cf55e Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Mon, 6 Oct 2025 17:30:53 +0200 Subject: [PATCH] onnxruntime,python3.pkgs.onnxruntime: fix runtime w/ glibc-2.42 Failing Hydra build: https://hydra.nixos.org/build/308650242 The libraries require an execstack even though it's not necessary. This got fixed upstream already[1], but this doesn't apply cleanly on the version we have. [1] https://github.com/microsoft/onnxruntime/pull/25200 --- pkgs/by-name/on/onnxruntime/package.nix | 5 ++++- pkgs/development/python-modules/onnxruntime/default.nix | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/on/onnxruntime/package.nix b/pkgs/by-name/on/onnxruntime/package.nix index bd9e9242239b..41163653106a 100644 --- a/pkgs/by-name/on/onnxruntime/package.nix +++ b/pkgs/by-name/on/onnxruntime/package.nix @@ -262,7 +262,10 @@ effectiveStdenv.mkDerivation rec { (lib.cmakeBool "onnxruntime_USE_COMPOSABLE_KERNEL_CK_TILE" false) ]; - env = lib.optionalAttrs rocmSupport { + env = { + NIX_LDFLAGS = "-z,noexecstack"; + } + // lib.optionalAttrs rocmSupport { MIOPEN_PATH = rocmPackages.miopen; # HIP steps fail to find ROCm libs when not in HIPFLAGS, causing # fatal error: 'rocrand/rocrand.h' file not found diff --git a/pkgs/development/python-modules/onnxruntime/default.nix b/pkgs/development/python-modules/onnxruntime/default.nix index 4d2ed826d456..9647657c0077 100644 --- a/pkgs/development/python-modules/onnxruntime/default.nix +++ b/pkgs/development/python-modules/onnxruntime/default.nix @@ -38,6 +38,10 @@ buildPythonPackage { chmod +w dist ''; + env = { + NIX_LDFLAGS = "-z,noexecstack"; + }; + nativeBuildInputs = lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ]; # This project requires fairly large dependencies such as sympy which we really don't always need.