Fix download-ci-llvm NixOS patching for binaries

LLVM tools should also be patched, since they are used in some tests,
specially,
- src/test/run-make-fulldeps/cross-lang-lto (llvm-ar)
- src/test/run-make-fulldeps/cross-lang-lto-upstream-rlibs (llvm-ar)
- src/test/run-make-fulldeps/issue-64153 (llvm-objdump)

To be more future proof, we should patch all binaries in `bin`.
This commit is contained in:
oxalica 2022-07-11 05:40:48 +08:00
parent 95e77648e4
commit 6245d725a2

View File

@ -147,8 +147,8 @@ pub(crate) fn maybe_download_ci_llvm(builder: &Builder<'_>) {
let key = format!("{}{}", llvm_sha, config.llvm_assertions);
if program_out_of_date(&llvm_stamp, &key) && !config.dry_run {
download_ci_llvm(builder, &llvm_sha);
for binary in ["llvm-config", "FileCheck"] {
builder.fix_bin_or_dylib(&llvm_root.join("bin").join(binary));
for entry in t!(fs::read_dir(llvm_root.join("bin"))) {
builder.fix_bin_or_dylib(&t!(entry).path());
}
// Update the timestamp of llvm-config to force rustc_llvm to be