From e93a1dccd82f831a2f0d2cc382d8af5e1fda55ed Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Thu, 6 Jun 2024 10:23:14 -0400 Subject: atomic: Fix RISC-V build with GCC < 14 Prior to GCC 14.1, the __builtin_riscv_pause() can cause an error if the appropriate extension is not enabled in -march: /tmp/ccR1L1lA.s: Assembler messages: /tmp/ccR1L1lA.s:670: Error: unrecognized opcode `pause', extension `zihintpause' required Link: https://gcc.gnu.org/pipermail/gcc-patches/2023-August/626748.html Link: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=c2d04dd659c499d8df19f68d0602ad4c7d7065c2 Link: https://buildd.debian.org/status/fetch.php?pkg=bfs&arch=riscv64&ver=3.3.1-1&stamp=1717488400&raw=0 --- src/atomic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/atomic.h b/src/atomic.h index 360de20..ad5303b 100644 --- a/src/atomic.h +++ b/src/atomic.h @@ -109,7 +109,7 @@ # define spin_loop() __builtin_ia32_pause() #elif __has_builtin(__builtin_arm_yield) # define spin_loop() __builtin_arm_yield() -#elif __has_builtin(__builtin_riscv_pause) +#elif BFS_HAS_BUILTIN_RISCV_PAUSE # define spin_loop() __builtin_riscv_pause() #else # define spin_loop() ((void)0) -- cgit v1.2.3