aboutsummaryrefslogtreecommitdiff
path: root/build-aux/m4/l_atomic.m4
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2021-01-15 10:54:07 +0800
committerfanquake <fanquake@gmail.com>2021-01-15 10:54:07 +0800
commit54ce4fac80689621dcbcc76169b2b00b179ee743 (patch)
treebe6b3f7af5d5eb22d4141cd54a8157c449ed5b5b /build-aux/m4/l_atomic.m4
parent2c010b9c56f069efad2b2c10bffaef4ed059736e (diff)
build: improve macro for testing -latomic requirement
riscv builds are currently failing because -latomic isn't being linked against, when it is needed: ```bash /home/ubuntu/build/bitcoin/distsrc-riscv64-linux-gnu/src/bitcoin-util.cpp:98: undefined reference to `__atomic_exchange_1' ``` This exteneds our macro to ensure that -latomic is linked against when required.
Diffstat (limited to 'build-aux/m4/l_atomic.m4')
-rw-r--r--build-aux/m4/l_atomic.m43
1 files changed, 3 insertions, 0 deletions
diff --git a/build-aux/m4/l_atomic.m4 b/build-aux/m4/l_atomic.m4
index 75c43f9a92..5201a8cc7c 100644
--- a/build-aux/m4/l_atomic.m4
+++ b/build-aux/m4/l_atomic.m4
@@ -14,6 +14,9 @@ m4_define([_CHECK_ATOMIC_testbody], [[
#include <cstdint>
int main() {
+ std::atomic<bool> lock{true};
+ std::atomic_exchange(&lock, false);
+
std::atomic<int64_t> a{};
int64_t v = 5;