The incorrect way: assuming llvm-dwp exists in the parent directory of the path provided for llvm-config. In general these two paths cannot be assumed to have any relationship to one another.
|
let src_exe = exe("llvm-dwp", target_compiler.host); |
|
let dst_exe = exe("rust-llvm-dwp", target_compiler.host); |
|
let llvm_config_bin = builder.ensure(native::Llvm { target: target_compiler.host }); |
|
let llvm_bin_dir = llvm_config_bin.parent().unwrap(); |
|
builder.copy(&llvm_bin_dir.join(&src_exe), &libdir_bin.join(&dst_exe)); |
The correct way: run llvm-config --bindir using the provided llvm-config, and pick llvm-dwp inside of the directory that it returns. Bootstrap does this correctly elsewhere, such as for FileCheck:
|
} else if let Some(s) = target_config.and_then(|c| c.llvm_config.as_ref()) { |
|
let llvm_bindir = output(Command::new(s).arg("--bindir")); |
|
let filecheck = Path::new(llvm_bindir.trim()).join(exe("FileCheck", target)); |
The incorrect way: assuming
llvm-dwpexists in the parent directory of the path provided forllvm-config. In general these two paths cannot be assumed to have any relationship to one another.rust/src/bootstrap/compile.rs
Lines 1075 to 1079 in 87bacf2
The correct way: run
llvm-config --bindirusing the provided llvm-config, and pickllvm-dwpinside of the directory that it returns. Bootstrap does this correctly elsewhere, such as for FileCheck:rust/src/bootstrap/lib.rs
Lines 669 to 671 in 87bacf2