Skip to content

Commit

Permalink
Enable atomic cas for bpf targets
Browse files Browse the repository at this point in the history
  • Loading branch information
tomerze committed Dec 14, 2022
1 parent ba64ba8 commit 11331b1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion compiler/rustc_target/src/spec/bpf_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pub fn opts(endian: Endian) -> TargetOptions {
allow_asm: true,
endian,
linker_flavor: LinkerFlavor::Bpf,
atomic_cas: false,
atomic_cas: true,
dynamic_linking: true,
no_builtins: true,
panic_strategy: PanicStrategy::Abort,
Expand All @@ -19,6 +19,10 @@ pub fn opts(endian: Endian) -> TargetOptions {
obj_is_bitcode: true,
requires_lto: false,
singlethread: true,
// When targeting the `v3` cpu in llvm, 32-bit atomics are also supported.
// But making this value change based on the target cpu can be mostly confusing
// and would require a bit of a refactor.
min_atomic_width: Some(64),
max_atomic_width: Some(64),
..Default::default()
}
Expand Down

0 comments on commit 11331b1

Please sign in to comment.