[clang-tools-extra] 1d40c41 - [clang-tools-extra] fix the check for if '-latomic' is necessary

Luís Marques via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 14 06:16:45 PST 2020


Author: Gokturk Yuksek
Date: 2020-02-14T14:16:10Z
New Revision: 1d40c4150630729a9c1ce5119a8027dac93a5b2d

URL: https://github.com/llvm/llvm-project/commit/1d40c4150630729a9c1ce5119a8027dac93a5b2d
DIFF: https://github.com/llvm/llvm-project/commit/1d40c4150630729a9c1ce5119a8027dac93a5b2d.diff

LOG: [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

Added: 
    

Modified: 
    clang-tools-extra/clangd/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clangd/CMakeLists.txt b/clang-tools-extra/clangd/CMakeLists.txt
index e3eccb50a496..fc5a07e69e9d 100644
--- a/clang-tools-extra/clangd/CMakeLists.txt
+++ b/clang-tools-extra/clangd/CMakeLists.txt
@@ -30,7 +30,7 @@ if(CLANG_BUILT_STANDALONE)
 endif()
 
 set(CLANGD_ATOMIC_LIB "")
-if(NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB)
+if(NOT HAVE_CXX_ATOMICS_WITHOUT_LIB OR NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB)
   list(APPEND CLANGD_ATOMIC_LIB "atomic")
 endif()
 


        


More information about the cfe-commits mailing list