Skip to content

Commit 03dc5c9

Browse files
Rollup merge of rust-lang#105708 - tomerze:enable-atomic-cas-bpf, r=nagisa
Enable atomic cas for bpf targets It seems like LLVM now supports it. https://reviews.llvm.org/D72184 - the PR in LLVM
2 parents eb22a06 + 11331b1 commit 03dc5c9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

compiler/rustc_target/src/spec/bpf_base.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ pub fn opts(endian: Endian) -> TargetOptions {
66
allow_asm: true,
77
endian,
88
linker_flavor: LinkerFlavor::Bpf,
9-
atomic_cas: false,
9+
atomic_cas: true,
1010
dynamic_linking: true,
1111
no_builtins: true,
1212
panic_strategy: PanicStrategy::Abort,
@@ -19,6 +19,10 @@ pub fn opts(endian: Endian) -> TargetOptions {
1919
obj_is_bitcode: true,
2020
requires_lto: false,
2121
singlethread: true,
22+
// When targeting the `v3` cpu in llvm, 32-bit atomics are also supported.
23+
// But making this value change based on the target cpu can be mostly confusing
24+
// and would require a bit of a refactor.
25+
min_atomic_width: Some(64),
2226
max_atomic_width: Some(64),
2327
..Default::default()
2428
}

0 commit comments

Comments
 (0)