diff options
| author | Vasileios Kalintiris <Vasileios.Kalintiris@imgtec.com> | 2016-02-09 23:38:28 +0000 |
|---|---|---|
| committer | Vasileios Kalintiris <Vasileios.Kalintiris@imgtec.com> | 2016-02-09 23:38:28 +0000 |
| commit | 7432c0472dabaefa73b31d6e4471181f94fcdd01 (patch) | |
| tree | ef7a2ae38cc9cfe8d588af30b556dfb5e6629383 /libcxx/cmake | |
| parent | 343f898443dec2661e27ddd4768c01f93132c996 (diff) | |
| download | bcm5719-llvm-7432c0472dabaefa73b31d6e4471181f94fcdd01.tar.gz bcm5719-llvm-7432c0472dabaefa73b31d6e4471181f94fcdd01.zip | |
Revert "Introduce a cmake module to figure out whether we need to link with libatomic."
This reverts commit r260235. It breaks LLVM's bootstrap when building
with a -gcc-toolchain and the system's gcc installation does not provide
the libatomic library and its headers. We should check whether
LIBCXX_GCC_TOOLCHAIN is set and adjust the flags accordingly.
llvm-svn: 260323
Diffstat (limited to 'libcxx/cmake')
| -rw-r--r-- | libcxx/cmake/Modules/CheckLibcxxAtomic.cmake | 38 | ||||
| -rw-r--r-- | libcxx/cmake/config-ix.cmake | 5 |
2 files changed, 0 insertions, 43 deletions
diff --git a/libcxx/cmake/Modules/CheckLibcxxAtomic.cmake b/libcxx/cmake/Modules/CheckLibcxxAtomic.cmake deleted file mode 100644 index ed3e6cc879e..00000000000 --- a/libcxx/cmake/Modules/CheckLibcxxAtomic.cmake +++ /dev/null @@ -1,38 +0,0 @@ -INCLUDE(CheckCXXSourceCompiles) - -# Sometimes linking against libatomic is required for atomic ops, if -# the platform doesn't support lock-free atomics. -# -# We could modify LLVM's CheckAtomic module and have it check for 64-bit -# atomics instead. However, we would like to avoid careless uses of 64-bit -# atomics inside LLVM over time on 32-bit platforms. - -function(check_cxx_atomics varname) - set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS}) - set(CMAKE_REQUIRED_FLAGS "-std=c++11") - check_cxx_source_compiles(" -#include <cstdint> -#include <atomic> -std::atomic<uintptr_t> x; -std::atomic<uintmax_t> y; -int main() { - return x + y; -} -" ${varname}) - set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS}) -endfunction(check_cxx_atomics) - -check_cxx_atomics(HAVE_CXX_ATOMICS_WITHOUT_LIB) -# If not, check if the library exists, and atomics work with it. -if(NOT HAVE_CXX_ATOMICS_WITHOUT_LIB) - check_library_exists(atomic __atomic_fetch_add_8 "" HAVE_LIBATOMIC) - if(HAVE_LIBATOMIC) - list(APPEND CMAKE_REQUIRED_LIBRARIES "atomic") - check_cxx_atomics(HAVE_CXX_ATOMICS_WITH_LIB) - if (NOT HAVE_CXX_ATOMICS_WITH_LIB) - message(FATAL_ERROR "Host compiler must support std::atomic!") - endif() - else() - message(FATAL_ERROR "Host compiler appears to require libatomic, but cannot find it.") - endif() -endif() diff --git a/libcxx/cmake/config-ix.cmake b/libcxx/cmake/config-ix.cmake index 1bfa23fadd8..c05597ea73d 100644 --- a/libcxx/cmake/config-ix.cmake +++ b/libcxx/cmake/config-ix.cmake @@ -1,6 +1,5 @@ include(CheckLibraryExists) include(CheckCXXCompilerFlag) -include(CheckLibcxxAtomic) # Check compiler flags @@ -18,7 +17,3 @@ check_library_exists(c fopen "" LIBCXX_HAS_C_LIB) check_library_exists(m ccos "" LIBCXX_HAS_M_LIB) check_library_exists(rt clock_gettime "" LIBCXX_HAS_RT_LIB) check_library_exists(gcc_s __gcc_personality_v0 "" LIBCXX_HAS_GCC_S_LIB) - -if (NOT HAVE_CXX_ATOMICS_WITHOUT_LIB) - set(LIBCXX_HAS_ATOMIC_LIB True) -endif() |

