Skip to content

Commit ec61047

Browse files
authored
Rollup merge of #101781 - chriswailes:dynamic-llvm-on-musl, r=jyn514
Extend list of targets that support dyanmic linking for llvm tools This commit adds `linux-musl` to the list of targets that support dynamic linking for the LLVM tools.
2 parents 00d88bd + 9995029 commit ec61047

File tree

3 files changed

+3
-12
lines changed

3 files changed

+3
-12
lines changed

src/bootstrap/lib.rs

-4
Original file line numberDiff line numberDiff line change
@@ -1307,10 +1307,6 @@ impl Build {
13071307
self.package_vers(&self.version)
13081308
}
13091309

1310-
fn llvm_link_tools_dynamically(&self, target: TargetSelection) -> bool {
1311-
target.contains("linux-gnu") || target.contains("apple-darwin")
1312-
}
1313-
13141310
/// Returns the `version` string associated with this compiler for Rust
13151311
/// itself.
13161312
///

src/bootstrap/native.rs

+2-7
Original file line numberDiff line numberDiff line change
@@ -423,12 +423,7 @@ impl Step for Llvm {
423423
// which saves both memory during parallel links and overall disk space
424424
// for the tools. We don't do this on every platform as it doesn't work
425425
// equally well everywhere.
426-
//
427-
// If we're not linking rustc to a dynamic LLVM, though, then don't link
428-
// tools to it.
429-
let llvm_link_shared =
430-
builder.llvm_link_tools_dynamically(target) && builder.llvm_link_shared();
431-
if llvm_link_shared {
426+
if builder.llvm_link_shared() {
432427
cfg.define("LLVM_LINK_LLVM_DYLIB", "ON");
433428
}
434429

@@ -553,7 +548,7 @@ impl Step for Llvm {
553548
// libLLVM.dylib will be built. However, llvm-config will still look
554549
// for a versioned path like libLLVM-14.dylib. Manually create a symbolic
555550
// link to make llvm-config happy.
556-
if llvm_link_shared && target.contains("apple-darwin") {
551+
if builder.llvm_link_shared() && target.contains("apple-darwin") {
557552
let mut cmd = Command::new(&build_llvm_config);
558553
let version = output(cmd.arg("--version"));
559554
let major = version.split('.').next().unwrap();

src/ci/github-actions/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ jobs:
286286

287287
- name: x86_64-gnu-llvm-13
288288
<<: *job-linux-xl
289-
289+
290290
- name: x86_64-gnu-tools
291291
env:
292292
CI_ONLY_WHEN_SUBMODULES_CHANGED: 1

0 commit comments

Comments
 (0)