aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2024-01-05 10:51:05 +0000
committerfanquake <fanquake@gmail.com>2024-01-05 10:52:17 +0000
commitc80f57ba575af96890f185765a53a62ef58ef2c8 (patch)
tree5cd81e25d41c16beed76740b2662df601521f84a
parent143ace65db3943845125068d48feeb1168dfcb88 (diff)
parentf8ca1357c8205ceff732dcfb0d2bad79b40b611b (diff)
downloadbitcoin-c80f57ba575af96890f185765a53a62ef58ef2c8.tar.xz
Merge bitcoin/bitcoin#29177: build: Fix check whether `-latomic` needed
f8ca1357c8205ceff732dcfb0d2bad79b40b611b build: Fix check whether `-latomic` needed (Hennadii Stepanov) Pull request description: Clang >=15 still might need linking against `libatomic`. We use `std::atomic<std::chrono::seconds>::compare_exchange_strong` in `net_processing.cpp`. Addresses the https://github.com/bitcoin/bitcoin/pull/29165#discussion_r1440293694. ACKs for top commit: maflcko: lgtm ACK f8ca1357c8205ceff732dcfb0d2bad79b40b611b fanquake: ACK f8ca1357c8205ceff732dcfb0d2bad79b40b611b Tree-SHA512: ba8b6a88fd3471a206d068e8a000a053c99cb46d26bd04624418ddb066b3b9664a569ec8a1569af67c96b3e27f13dccbd5e24f985290ac072b6d74c92524e35d
-rw-r--r--build-aux/m4/l_atomic.m44
1 files changed, 3 insertions, 1 deletions
diff --git a/build-aux/m4/l_atomic.m4 b/build-aux/m4/l_atomic.m4
index 5e65257d77..aa00168fce 100644
--- a/build-aux/m4/l_atomic.m4
+++ b/build-aux/m4/l_atomic.m4
@@ -4,7 +4,7 @@ dnl permitted in any medium without royalty provided the copyright notice
dnl and this notice are preserved. This file is offered as-is, without any
dnl warranty.
-# Clang prior to version 15, when building for 32-bit,
+# Clang, when building for 32-bit,
# and linking against libstdc++, requires linking with
# -latomic if using the C++ atomic library.
# Can be tested with: clang++ test.cpp -m32
@@ -24,6 +24,8 @@ m4_define([_CHECK_ATOMIC_testbody], [[
std::atomic<std::chrono::seconds> t{0s};
t.store(2s);
+ auto t1 = t.load();
+ t.compare_exchange_strong(t1, 3s);
std::atomic<int64_t> a{};