From 651e8734620a07d25acab4a594e23e33b4d91f50 Mon Sep 17 00:00:00 2001 From: Michal Rostecki Date: Sat, 14 Jan 2023 21:33:42 +0800 Subject: [PATCH] BPF: Disable atomic CAS Enabling CAS for BPF targets (#105708) breaks the build of core library. The failure occurs both when building rustc for BPF targets and when building crates for BPF targets with the current nightly. The LLVM BPF backend does not correctly lower all `atomicrmw` operations and crashes for unsupported ones. Before we can enable CAS for BPF in Rust, we need to fix the LLVM BPF backend first. Fixes #106795 Signed-off-by: Michal Rostecki --- compiler/rustc_target/src/spec/bpf_base.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_target/src/spec/bpf_base.rs b/compiler/rustc_target/src/spec/bpf_base.rs index 2b00cda44b5..4d03747d016 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: true, + atomic_cas: false, dynamic_linking: true, no_builtins: true, panic_strategy: PanicStrategy::Abort,