From d0c8d58527b07d8609961ea1f084d69ce0fcd3a8 Mon Sep 17 00:00:00 2001 From: Alex Denisov Date: Sat, 10 Oct 2020 21:22:40 +0200 Subject: [PATCH] Fix CMake configuration error when run with -Werror/-Wall The following code doesn't compile uint64_t i = x.load(std::memory_order_relaxed); return 0; when CMAKE_C_FLAGS set to -Werror -Wall, thus incorrectly breaking the CMake configuration step: -- Looking for __atomic_load_8 in atomic -- Looking for __atomic_load_8 in atomic - not found CMake Error at cmake/modules/CheckAtomic.cmake:79 (message): Host compiler appears to require libatomic for 64-bit operations, but cannot find it. Call Stack (most recent call first): cmake/config-ix.cmake:360 (include) CMakeLists.txt:671 (include) --- llvm/cmake/modules/CheckAtomic.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/llvm/cmake/modules/CheckAtomic.cmake b/llvm/cmake/modules/CheckAtomic.cmake index d0b75f3..04eed14 100644 --- a/llvm/cmake/modules/CheckAtomic.cmake +++ b/llvm/cmake/modules/CheckAtomic.cmake @@ -32,6 +32,7 @@ function(check_working_cxx_atomics64 varname) std::atomic x (0); int main() { uint64_t i = x.load(std::memory_order_relaxed); + (void)i; return 0; } " ${varname}) -- 2.7.4