From 0486bb1afd6c17eaf64386e15545ee70d90654d9 Mon Sep 17 00:00:00 2001 From: Katsumi Takeuchi Date: Mon, 28 Sep 2026 16:34:34 +0900 Subject: [PATCH] intel-oneapi-toolkit: patch vtune separately autoPatchelf linked all components against vtune's bundled libstdc++, which is too old for level-zero and broke all-binaries-run. Assisted-by: Claude Code with Opus 5.5 medium (Anthropic) --- .../in/intel-oneapi-toolkit/package.nix | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/pkgs/by-name/in/intel-oneapi-toolkit/package.nix b/pkgs/by-name/in/intel-oneapi-toolkit/package.nix index 1d75f25e20fa..1d0be689ce69 100644 --- a/pkgs/by-name/in/intel-oneapi-toolkit/package.nix +++ b/pkgs/by-name/in/intel-oneapi-toolkit/package.nix @@ -50,6 +50,7 @@ libuuid, sqlite, libffi, + openssl, bash, # The list of components to install; # Either [ "all" ], [ "default" ], or a custom list of components. @@ -243,6 +244,10 @@ stdenv.mkDerivation (finalAttrs: { python3 # Required for patchShebangs to discover the correct interpreter bash + # libstdc++/libgcc_s for non-vtune components (vtune uses its bundled copies) + (lib.getLib stdenv.cc.cc) + # libcrypto.so.3 for ippcp's crypto_mb + openssl ] ++ lib.concatMap ( comp: @@ -293,6 +298,21 @@ stdenv.mkDerivation (finalAttrs: { runHook postInstall ''; + # Patch vtune separately: autoPatchelf prefers libraries in the patched paths, + # so other components would pick up vtune's old bundled libstdc++. + dontAutoPatchelf = true; + postFixup = '' + others=() + for dir in "$out"/*; do + [[ -L $dir || $dir == "$out/vtune" ]] || others+=("$dir") + done + autoPatchelf -- "''${others[@]}" + if [[ -d $out/vtune ]]; then + addAutoPatchelfSearchPath "''${others[@]}" + autoPatchelf -- "$out/vtune" + fi + ''; + autoPatchelfIgnoreMissingDeps = [ # Needs to be dynamically loaded as it depends on the hardware "libcuda.so.1"