diff options
| author | Nikita Popov <npopov@redhat.com> | 2022-07-27 14:26:00 +0200 |
|---|---|---|
| committer | Nikita Popov <npopov@redhat.com> | 2022-08-09 12:39:59 +0200 |
| commit | 89582e8193e0da64a54c4ffae7f9fa64ed9fe2af (patch) | |
| tree | 9bdc713a34c12cf2d5ea2f68573cdb06ea14421b /compiler/rustc_codegen_llvm/src | |
| parent | 9d97606193458be2eadd0d708c082bd9a79dd612 (diff) | |
| download | rust-89582e8193e0da64a54c4ffae7f9fa64ed9fe2af.tar.gz rust-89582e8193e0da64a54c4ffae7f9fa64ed9fe2af.zip | |
Pass +atomics-32 feature for thumbv6m target
https://reviews.llvm.org/D120026 changed atomics on thumbv6m to use libatomic, to ensure that atomic load/store are compatible with atomic RMW/CAS. However, Rust wants to expose only load/store without libcalls. https://reviews.llvm.org/D130480 added support for this behind the +atomics-32 target feature, so enable that feature.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/llvm_util.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_llvm/src/llvm_util.rs b/compiler/rustc_codegen_llvm/src/llvm_util.rs index a0a640473eb..96d238eda59 100644 --- a/compiler/rustc_codegen_llvm/src/llvm_util.rs +++ b/compiler/rustc_codegen_llvm/src/llvm_util.rs @@ -440,6 +440,8 @@ pub(crate) fn global_llvm_features(sess: &Session, diagnostics: bool) -> Vec<Str .features .split(',') .filter(|v| !v.is_empty() && backend_feature_name(v).is_some()) + // Drop +atomics-32 feature introduced in LLVM 15. + .filter(|v| *v != "+atomics-32" || get_version() >= (15, 0, 0)) .map(String::from), ); |
