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)
This commit is contained in:
Katsumi Takeuchi
2026-09-28 16:34:34 +09:00
parent c5005a3de2
commit 0486bb1afd

View File

@@ -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"