diff options
| author | Tomer Zeitune <tomerzeitune@gmail.com> | 2022-11-27 00:35:52 +0200 |
|---|---|---|
| committer | Tomer Zeitune <tomerzeitune@gmail.com> | 2022-12-14 19:37:28 +0200 |
| commit | 11331b1030fba551df4c7fc2babd44496040030f (patch) | |
| tree | 6a85fb1133915c03c98a12f5f77f34eb83acfd6b | |
| parent | ba64ba8b0dfd57f7d6d7399d0df7ded37d2af18d (diff) | |
| download | rust-11331b1030fba551df4c7fc2babd44496040030f.tar.gz rust-11331b1030fba551df4c7fc2babd44496040030f.zip | |
Enable atomic cas for bpf targets
| -rw-r--r-- | compiler/rustc_target/src/spec/bpf_base.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/rustc_target/src/spec/bpf_base.rs b/compiler/rustc_target/src/spec/bpf_base.rs index baf36587147..2b00cda44b5 100644 --- a/compiler/rustc_target/src/spec/bpf_base.rs +++ b/compiler/rustc_target/src/spec/bpf_base.rs @@ -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, @@ -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() } |
