From 7f56b9a50925c3d03db6357e87be7de91cf3da7b Mon Sep 17 00:00:00 2001 From: Hans Kratz Date: Wed, 24 Nov 2021 21:22:42 +0100 Subject: 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. --- compiler/rustc_codegen_llvm/src/llvm_util.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'compiler/rustc_codegen_llvm/src/llvm_util.rs') diff --git a/compiler/rustc_codegen_llvm/src/llvm_util.rs b/compiler/rustc_codegen_llvm/src/llvm_util.rs index b15efcd0dc2..c2136f16120 100644 --- a/compiler/rustc_codegen_llvm/src/llvm_util.rs +++ b/compiler/rustc_codegen_llvm/src/llvm_util.rs @@ -417,7 +417,10 @@ pub fn llvm_global_features(sess: &Session) -> Vec { 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()); } -- cgit 1.4.1-3-g733a5