summaryrefslogtreecommitdiffstats
path: root/llvm/cmake/modules/CheckAtomic.cmake
Commit message (Collapse)AuthorAgeFilesLines
* Revert "[CMake] CheckAtomic.cmake: catch false positives in RISC-V"Hans Wennborg2020-02-201-5/+1
| | | | | | | This reverts commit a572a8a147c76b9d31585c2d4257a5db566c9a9d. Apparently it was part of a larger series, and I'm not planning on merging that; see https://reviews.llvm.org/D68964
* [CMake] CheckAtomic.cmake: catch false positives in RISC-VGokturk Yuksek2020-02-201-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | The check for 'HAVE_CXX_ATOMICS_WITHOUT_LIB' may create false positives in RISC-V. This is reproducible when compiling LLVM natively using GCC on a rv64gc (rv64imafdgc) host. Due to the 'A' (atomic) extension, g++ replaces calls to libatomic operations on the std::atomic<int> type with the native hardware instructions. As a result, the compilation succeeds and the build system thinks it doesn't need to pass '-latomic'. Improve the reliability of the 'HAVE_CXX_ATOMICS_WITHOUT_LIB' test in two steps: 1. Force a pre-increment on x (++x), which should force a call to a libatomic function; 2. Because step 1 would resolve the increment to 'amoadd.w.aq' under the 'A' extension, force the same operation on sub-word types, for which there is no hardware support. Reviewers: jfb, hintonda, smeenai, mgorny, JDevlieghere, jyknight Reviewed By: jfb Tags: #llvm Differential Revision: https://reviews.llvm.org/D68964 (cherry picked from commit cef85193b2cc1817ca43199a0ae9c6f25723997d)
* [NFC] Improve cmake diagnostic when checking atomicsJF Bastien2019-07-301-2/+2
| | | | llvm-svn: 367359
* [cmake] Always respect existing CMAKE_REQUIRED_FLAGS when adding additional ↵Don Hinton2017-12-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | ones. Summary: Always respect existing CMAKE_REQUIRED_FLAGS when adding additional ones. This is important when cross compiling where --sysroot and -target were already added. In particular, this is needed when cross compiling from Darwin to Linux, since --sysroot is required to find headers and libraries. Cmake has a similar bug in check_include_file[_cxx] where CMAKE_REQUIRED_LIBRARIES isn't passed, which causes try_compile to fail. (please see https://gitlab.kitware.com/cmake/cmake/merge_requests/1620) Reviewers: compnerd, silvas, beanz, brad.king Reviewed By: compnerd Subscribers: mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D41568 llvm-svn: 321434
* [cmake] Remove unnecessary header include in atomics checkShoaib Meenai2017-12-061-1/+0
| | | | | | | | | | | | | | | | | | | | | The header include was required to work around PR19898, as noted in that comment. That PR has since been marked resolved fixed, and the configuration check passes without the header inclusion both when compiling on Windows with cl and when cross-compiling on Linux using clang-cl. I noticed this because the inclusion was cased incorrectly (Intrin.h instead of intrin.h), which when cross-compiling on a case sensitive file system would cause the intrin.h from the Windows SDK to be included (which LLVM can't handle) instead of the one from clang's resource directory, making the check fail. This is the same issue as r309980. Correcting the case of the inclusion makes the check pass when cross compiling, but it seems better to get rid of the inclusion entirely, since it appears to be unnecessary now. Differential Revision: https://reviews.llvm.org/D40910 llvm-svn: 319917
* CMAKE: help CheckAtomic find check_library_existsMartell Malone2017-12-021-0/+1
| | | | | | | | | | | | | | | | | lldb fails to build standalone on x86 -- Performing Test HAVE_CXX_ATOMICS64_WITHOUT_LIB - Failed CMake Error at CheckAtomic.cmake:66 (check_library_exists): Unknown CMake command "check_library_exists". Call Stack (most recent call first): LLDBStandalone.cmake:90 (include) CMakeLists.txt:3 (include) Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D40220 llvm-svn: 319610
* [LLVM][MIPS] Introduce 64 bit atomic check in CheckAtomic.cmakeSagar Thakur2016-06-231-0/+37
| | | | | | | | | | Patch by Nitesh Jain. Summary: On some target like MIPS32 we need to explicitly link atomic library for 64 bit atomic operations. This module then can be used in LLDB (http://reviews.llvm.org/D20464) or Libcxx (http://reviews.llvm.org/D16613) for explicitly link to atomic library. Reviewers: chandlerc, beanz Differential: reviews.llvm.org/D20896 llvm-svn: 273534
* Repair cmake libatomic check.James Y Knight2015-06-161-6/+36
| | | | | | | | | | | | | | The cmake check for whether libatomic could be used had been unconditionally setting the result to false. Which was somewhat fortunate, because the prerequisite check for whether it was *needed* was always claiming it was, even if it was not. However, this made platforms where libatomic is actually necessary fail to link. Differential Revision: http://reviews.llvm.org/D10453 llvm-svn: 239819
* cmake: Use MSVC atomics with clang-clReid Kleckner2015-03-021-0/+1
| | | | llvm-svn: 231022
* build: check if atomic routines are implicitly providedSaleem Abdulrasool2015-02-251-3/+7
| | | | | | | | | | It is possible for the atomic routines to be provided by the compiler without requiring any additional libraries. Check if that is the case before checking for a library. Patch by Matt Glazar! llvm-svn: 230452
* Add CMake check for libatomic.Evgeniy Stepanov2014-09-121-0/+5
| | | | llvm-svn: 217666
* Rename LLVM_MULTITHREADED define and fix build without threads.Eric Christopher2011-09-191-2/+2
| | | | | | Patch by Arrowdodger. llvm-svn: 140064
* CheckAtomic.cmake: Put all C++ code inside CHECK_CXX_SOURCE_COMPILES.Oscar Fuentes2009-12-061-2/+1
| | | | llvm-svn: 90685
* Fix for atomic intrinsics detection when using MSVC.Oscar Fuentes2009-12-051-0/+12
| | | | | | Patch by Michael Beck! llvm-svn: 90683
* Implement cmake LLVM_MULTITHREADED gcc atomic builtin checks.Xerxes Ranby2009-07-171-0/+18
llvm-svn: 76221
OpenPOWER on IntegriCloud