Rollup merge of #156985 - mati865:additional-llvm-dll-windows-only, r=jieyouxu

Limit the additional DLL to Windows

rust-lang/rust#156229 didn't limit the additional DLL copy to Windows as it was supposed to.
This commit is contained in:
Guillaume Gomez
2026-05-27 20:45:14 +02:00
committed by GitHub
+4 -2
View File
@@ -2591,8 +2591,10 @@ pub fn maybe_install_llvm_runtime(builder: &Builder<'_>, target: TargetSelection
// To workaround lack of rpath on Windows, we bundle another copy of
// the LLVM DLL to make rust-lld and llvm-tools work when `sysroot/bin`
// is missing from PATH, i.e. when they not launched by rustc.
let dst_libdir = sysroot.join("lib/rustlib").join(target).join("bin");
maybe_install_llvm(builder, target, &dst_libdir, false);
if target.triple.contains("windows") {
let dst_libdir = sysroot.join("lib/rustlib").join(target).join("bin");
maybe_install_llvm(builder, target, &dst_libdir, false);
}
}
}