zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 00966b7258bdf56fe2cc653b30b4d4352d8fe14f (tree)
parent 2fefd4ea8e031e82e5d9228638dc48aa213a102e
Author: Kenta Iwasaki <kenta@lithdew.net>
Date:   Thu, 18 Nov 2021 10:35:00 +0900

compiler_rt: disable spinlocks for atomic instrinsics for bpf

The BPF target does not support mutable global variables. Mark the BPF
target as a target that does not support atomic variables in order to
avoid including the global spinlock table provided in compiler_rt.

Diffstat:
Mlib/std/special/compiler_rt/atomics.zig | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/std/special/compiler_rt/atomics.zig b/lib/std/special/compiler_rt/atomics.zig @@ -10,7 +10,7 @@ const linkage: std.builtin.GlobalLinkage = if (builtin.is_test) .Internal else . // detail to keep the export logic clean and because we need some kind of CAS to // implement the spinlocks. const supports_atomic_ops = switch (arch) { - .msp430, .avr => false, + .msp430, .avr, .bpfel, .bpfeb => false, .arm, .armeb, .thumb, .thumbeb => // The ARM v6m ISA has no ldrex/strex and so it's impossible to do CAS // operations (unless we're targeting Linux, the kernel provides a way to