Skip to content

Commit

Permalink
Disable outline atomics to aarch64-unknown-linux-musl.
Browse files Browse the repository at this point in the history
This is a functionally equivalent, minimally invasive backport of #90044, which
fixes the problem that compiling any binary with the target
aarch64-unknown-linux-musl fails unless lld is used for linking (#89626).

I have tested this backport by building aarch64-unknown-linux-gnu, installing
the std libraries for the -musl and -gnu variants in
rustc-beta-aarch64-unknown-linux-gnu/rustc/lib/rustlib and running helloworld
successfully for both targets on arm64 hardware.
  • Loading branch information
hkratz authored and Mark-Simulacrum committed Nov 29, 2021
1 parent fd046c3 commit 7f56b9a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion compiler/rustc_codegen_llvm/src/llvm_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,10 @@ pub fn llvm_global_features(sess: &Session) -> Vec<String> {
features.extend(sess.opts.cg.target_feature.split(',').flat_map(&filter));

// FIXME: Move outline-atomics to target definition when earliest supported LLVM is 12.
if get_version() >= (12, 0, 0) && sess.target.llvm_target.contains("aarch64-unknown-linux") {
if get_version() >= (12, 0, 0)
&& sess.target.llvm_target.contains("aarch64-unknown-linux")
&& sess.target.llvm_target != "aarch64-unknown-linux-musl"
{
features.push("+outline-atomics".to_string());
}

Expand Down

0 comments on commit 7f56b9a

Please sign in to comment.