From 15a2e4853b891c720047bb182081d869280f5c1d Mon Sep 17 00:00:00 2001 From: Adam Gemmell Date: Mon, 12 Jul 2021 15:46:52 +0100 Subject: [PATCH 1/2] Package LLVM libs for the target rather than the build host --- src/bootstrap/dist.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs index 92853378e5881..c37763243c0a5 100644 --- a/src/bootstrap/dist.rs +++ b/src/bootstrap/dist.rs @@ -1955,8 +1955,16 @@ fn maybe_install_llvm(builder: &Builder<'_>, target: TargetSelection, dst_libdir cmd.arg("--libfiles"); builder.verbose(&format!("running {:?}", cmd)); let files = output(&mut cmd); + let build_llvm_out = &builder.llvm_out(builder.config.build); + let target_llvm_out = &builder.llvm_out(target); for file in files.trim_end().split(' ') { - builder.install(Path::new(file), dst_libdir, 0o644); + // If we're not using a custom LLVM, make sure we package for the target. + let file = if let Ok(relative_path) = Path::new(file).strip_prefix(build_llvm_out) { + target_llvm_out.join(relative_path) + } else { + PathBuf::from(file) + }; + builder.install(&file, dst_libdir, 0o644); } !builder.config.dry_run } else { From 24254d693b0f4d55c57c3e9a7df4cb8795d2d9d2 Mon Sep 17 00:00:00 2001 From: Adam Gemmell Date: Wed, 14 Jul 2021 14:50:38 +0100 Subject: [PATCH 2/2] Fix download-ci-llvm help comment --- config.toml.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.toml.example b/config.toml.example index 9a820f0803f0a..775133f2ab319 100644 --- a/config.toml.example +++ b/config.toml.example @@ -38,7 +38,7 @@ changelog-seen = 2 # This is false by default so that distributions don't unexpectedly download # LLVM from the internet. # -# All tier 1 targets are currently supported; set this to `"if-supported"` if +# All tier 1 targets are currently supported; set this to `"if-available"` if # you are not sure whether you're on a tier 1 target. # # We also currently only support this when building LLVM for the build triple.