authorgravatar for kenta@lithdew.netKenta Iwasaki <kenta@lithdew.net> 2021-11-18 10:35:00+09:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-11-18 13:16:35-05:00
log00966b7258bdf56fe2cc653b30b4d4352d8fe14f
treeb83b8ada56e9660f01482babb74f0cb54a0c3ccf
parent2fefd4ea8e031e82e5d9228638dc48aa213a102e

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.

1 files changed, 1 insertions(+), 1 deletions(-)

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