mirror of https://github.com/rust-lang/rust.git
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.
This commit is contained in:
parent
9d97606193
commit
89582e8193
|
@ -440,6 +440,8 @@ pub(crate) fn global_llvm_features(sess: &Session, diagnostics: bool) -> Vec<Str
|
||||||
.features
|
.features
|
||||||
.split(',')
|
.split(',')
|
||||||
.filter(|v| !v.is_empty() && backend_feature_name(v).is_some())
|
.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),
|
.map(String::from),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,9 @@ pub fn target() -> Target {
|
||||||
abi: "eabi".into(),
|
abi: "eabi".into(),
|
||||||
// The ARMv6-M architecture doesn't support unaligned loads/stores so we disable them
|
// The ARMv6-M architecture doesn't support unaligned loads/stores so we disable them
|
||||||
// with +strict-align.
|
// with +strict-align.
|
||||||
features: "+strict-align".into(),
|
// Also force-enable 32-bit atomics, which allows the use of atomic load/store only.
|
||||||
|
// The resulting atomics are ABI incompatible with atomics backed by libatomic.
|
||||||
|
features: "+strict-align,+atomics-32".into(),
|
||||||
// There are no atomic CAS instructions available in the instruction set of the ARMv6-M
|
// There are no atomic CAS instructions available in the instruction set of the ARMv6-M
|
||||||
// architecture
|
// architecture
|
||||||
atomic_cas: false,
|
atomic_cas: false,
|
||||||
|
|
Loading…
Reference in New Issue