Skip to content

Commit 1d40c41

Browse files
gktrkluismarques
authored andcommitted
[clang-tools-extra] fix the check for if '-latomic' is necessary
Summary: The CheckAtomic module performs two tests to determine if passing '-latomic' to the linker is required: one for 64-bit atomics, and another for non-64-bit atomics. clangd only uses the result from HAVE_CXX_ATOMICS64_WITHOUT_LIB. This is incomplete because there are uses of non-64-bit atomics in the code, such as the ReplyOnce::Replied of type std::atomic<bool> defined in clangd/ClangdLSPServer.cpp. Fix by also checking for the result of HAVE_CXX_ATOMICS_WITHOUT_LIB. See also: https://reviews.llvm.org/D68964 Reviewers: ilya-biryukov, nridge, kadircet, beanz, compnerd, luismarques Reviewed By: luismarques Tags: #clang Differential Revision: https://reviews.llvm.org/D69869
1 parent 9816e72 commit 1d40c41

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang-tools-extra/clangd/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ if(CLANG_BUILT_STANDALONE)
3030
endif()
3131

3232
set(CLANGD_ATOMIC_LIB "")
33-
if(NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB)
33+
if(NOT HAVE_CXX_ATOMICS_WITHOUT_LIB OR NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB)
3434
list(APPEND CLANGD_ATOMIC_LIB "atomic")
3535
endif()
3636

0 commit comments

Comments
 (0)