Skip to content

Commit 7f56b9a

Browse files
hkratzMark-Simulacrum
authored andcommitted
Disable outline atomics to aarch64-unknown-linux-musl.
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.
1 parent fd046c3 commit 7f56b9a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

compiler/rustc_codegen_llvm/src/llvm_util.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,10 @@ pub fn llvm_global_features(sess: &Session) -> Vec<String> {
417417
features.extend(sess.opts.cg.target_feature.split(',').flat_map(&filter));
418418

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

0 commit comments

Comments
 (0)