aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorAndrew Chow <achow101-github@achow101.com>2022-07-11 20:26:25 -0400
committerAndrew Chow <achow101-github@achow101.com>2022-07-18 10:47:19 -0400
commit4de4221ab4b645ff77503c777c9b195a962e9fa1 (patch)
tree405973ab3a4f30807ea877e4e1c4420ca778163f /configure.ac
parentc92eb6cda0f402b83263c9a9ee129d5d0763fd3f (diff)
downloadbitcoin-4de4221ab4b645ff77503c777c9b195a962e9fa1.tar.xz
build: Check for std::atomic::exchange rather than std::atomic_exchange
Our usage of std::atomic is with it's own exchange function, not std::atomic_exchange. So we should be looking specifically for that function. Additionally, -pthread and -lpthread have an effect on whether -latomic will be needed, so the atomics check needs to use these flags as well. This will make the flags in use better match what is actually used when linking. This removes the need for -latomic for riscv builds, which resolves a guix cross architecture reproducibility issue.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac6
1 files changed, 3 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 0e1968f5c4..db7ac620b9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -87,9 +87,6 @@ else
AX_CXX_COMPILE_STDCXX([20], [noext], [mandatory])
fi
-dnl Check if -latomic is required for <std::atomic>
-CHECK_ATOMIC
-
dnl check if additional link flags are required for std::filesystem
CHECK_FILESYSTEM
@@ -887,6 +884,9 @@ AC_C_BIGENDIAN
dnl Check for pthread compile/link requirements
AX_PTHREAD
+dnl Check if -latomic is required for <std::atomic>
+CHECK_ATOMIC
+
dnl The following macro will add the necessary defines to bitcoin-config.h, but
dnl they also need to be passed down to any subprojects. Pull the results out of
dnl the cache and add them to CPPFLAGS.