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.
This commit is contained in:
commit
ec6104784d
3 changed files with 3 additions and 12 deletions
|
@ -1307,10 +1307,6 @@ impl Build {
|
||||||
self.package_vers(&self.version)
|
self.package_vers(&self.version)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn llvm_link_tools_dynamically(&self, target: TargetSelection) -> bool {
|
|
||||||
target.contains("linux-gnu") || target.contains("apple-darwin")
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Returns the `version` string associated with this compiler for Rust
|
/// Returns the `version` string associated with this compiler for Rust
|
||||||
/// itself.
|
/// itself.
|
||||||
///
|
///
|
||||||
|
|
|
@ -423,12 +423,7 @@ impl Step for Llvm {
|
||||||
// which saves both memory during parallel links and overall disk space
|
// which saves both memory during parallel links and overall disk space
|
||||||
// for the tools. We don't do this on every platform as it doesn't work
|
// for the tools. We don't do this on every platform as it doesn't work
|
||||||
// equally well everywhere.
|
// equally well everywhere.
|
||||||
//
|
if builder.llvm_link_shared() {
|
||||||
// If we're not linking rustc to a dynamic LLVM, though, then don't link
|
|
||||||
// tools to it.
|
|
||||||
let llvm_link_shared =
|
|
||||||
builder.llvm_link_tools_dynamically(target) && builder.llvm_link_shared();
|
|
||||||
if llvm_link_shared {
|
|
||||||
cfg.define("LLVM_LINK_LLVM_DYLIB", "ON");
|
cfg.define("LLVM_LINK_LLVM_DYLIB", "ON");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -553,7 +548,7 @@ impl Step for Llvm {
|
||||||
// libLLVM.dylib will be built. However, llvm-config will still look
|
// libLLVM.dylib will be built. However, llvm-config will still look
|
||||||
// for a versioned path like libLLVM-14.dylib. Manually create a symbolic
|
// for a versioned path like libLLVM-14.dylib. Manually create a symbolic
|
||||||
// link to make llvm-config happy.
|
// link to make llvm-config happy.
|
||||||
if llvm_link_shared && target.contains("apple-darwin") {
|
if builder.llvm_link_shared() && target.contains("apple-darwin") {
|
||||||
let mut cmd = Command::new(&build_llvm_config);
|
let mut cmd = Command::new(&build_llvm_config);
|
||||||
let version = output(cmd.arg("--version"));
|
let version = output(cmd.arg("--version"));
|
||||||
let major = version.split('.').next().unwrap();
|
let major = version.split('.').next().unwrap();
|
||||||
|
|
|
@ -286,7 +286,7 @@ jobs:
|
||||||
|
|
||||||
- name: x86_64-gnu-llvm-13
|
- name: x86_64-gnu-llvm-13
|
||||||
<<: *job-linux-xl
|
<<: *job-linux-xl
|
||||||
|
|
||||||
- name: x86_64-gnu-tools
|
- name: x86_64-gnu-tools
|
||||||
env:
|
env:
|
||||||
CI_ONLY_WHEN_SUBMODULES_CHANGED: 1
|
CI_ONLY_WHEN_SUBMODULES_CHANGED: 1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue