From 9f98d2ec5dce715c3c565bb4ec353cd989101e16 Mon Sep 17 00:00:00 2001 From: Raymond Wong Date: Sun, 3 Apr 2022 14:01:15 +0800 Subject: [PATCH] cmake: check for 8-bit atomic operation Fix building on RISC-V. Closes #8850. Signed-off-by: Raymond Wong --- cmake/ConfigureChecks.cmake | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmake/ConfigureChecks.cmake b/cmake/ConfigureChecks.cmake index 924aea101..6562d324f 100644 --- a/cmake/ConfigureChecks.cmake +++ b/cmake/ConfigureChecks.cmake @@ -255,10 +255,13 @@ int main () { check_cxx_source_compiles(" #include #include +std::atomic n8 (0); std::atomic n64 (0); int main() { -uint64_t i = n64.load(std::memory_order_relaxed); -return std::atomic_is_lock_free(&n64); +uint8_t i = n8.load(std::memory_order_relaxed); +uint64_t j = n64.load(std::memory_order_relaxed); +return std::atomic_is_lock_free(&n8) + & std::atomic_is_lock_free(&n64); }" LIBATOMIC_NOT_NEEDED) IF (NOT LIBATOMIC_NOT_NEEDED)