about summary refs log tree commit diff
diff options
context:
space:
mode:
authorHans Kratz <hans@appfour.com>2021-11-24 21:22:42 +0100
committerMark Rousskov <mark.simulacrum@gmail.com>2021-11-29 12:09:35 -0500
commit7f56b9a50925c3d03db6357e87be7de91cf3da7b (patch)
tree76cabf2b2661caf762240b26dc335d37cf154992
parentfd046c334c2f861bb4f7e434125ab21c23a5940d (diff)
downloadrust-7f56b9a50925c3d03db6357e87be7de91cf3da7b.tar.gz
rust-7f56b9a50925c3d03db6357e87be7de91cf3da7b.zip
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.
-rw-r--r--compiler/rustc_codegen_llvm/src/llvm_util.rs5
1 files changed, 4 insertions, 1 deletions
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<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());
     }