Skip to content

Commit 15a2e48

Browse files
committed
Package LLVM libs for the target rather than the build host
1 parent 59d92bd commit 15a2e48

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/bootstrap/dist.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1955,8 +1955,16 @@ fn maybe_install_llvm(builder: &Builder<'_>, target: TargetSelection, dst_libdir
19551955
cmd.arg("--libfiles");
19561956
builder.verbose(&format!("running {:?}", cmd));
19571957
let files = output(&mut cmd);
1958+
let build_llvm_out = &builder.llvm_out(builder.config.build);
1959+
let target_llvm_out = &builder.llvm_out(target);
19581960
for file in files.trim_end().split(' ') {
1959-
builder.install(Path::new(file), dst_libdir, 0o644);
1961+
// If we're not using a custom LLVM, make sure we package for the target.
1962+
let file = if let Ok(relative_path) = Path::new(file).strip_prefix(build_llvm_out) {
1963+
target_llvm_out.join(relative_path)
1964+
} else {
1965+
PathBuf::from(file)
1966+
};
1967+
builder.install(&file, dst_libdir, 0o644);
19601968
}
19611969
!builder.config.dry_run
19621970
} else {

0 commit comments

Comments
 (0)