summaryrefslogtreecommitdiffstats
path: root/libcxx/cmake/Modules
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2016-08-29 21:33:37 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2016-08-29 21:33:37 +0000
commit124186616a446128cfc78c0c048484401fa308e2 (patch)
tree0fbf661757a9bd1b409c3fc28bfb0545406900af /libcxx/cmake/Modules
parentdcbf2cbfcaea464c3bb5336e853007d7b7b3a4d2 (diff)
downloadbcm5719-llvm-124186616a446128cfc78c0c048484401fa308e2.tar.gz
bcm5719-llvm-124186616a446128cfc78c0c048484401fa308e2.zip
libc++: perform configuration checks with -nodefaultlibs
We're compiling libc++ with -nodefaultlibs, so we should also pass this option during the configuration checks to ensure those checks are consistent with the actual build. The primary motivation here is to ease cross-compilation against a non-standard set of C++ libraries. Previously, the configuration checks would attempt to link against the standard C++ libraries, which would cause link failures when cross-compiling, even though the actual library link would go through correctly (because of the use of -nodefaultlibs and explicitly specifying any needed libraries). This is more correct even ignoring the motivation, however. Patch by Shoaib Meenai! llvm-svn: 280015
Diffstat (limited to 'libcxx/cmake/Modules')
-rw-r--r--libcxx/cmake/Modules/CheckLibcxxAtomic.cmake5
1 files changed, 4 insertions, 1 deletions
diff --git a/libcxx/cmake/Modules/CheckLibcxxAtomic.cmake b/libcxx/cmake/Modules/CheckLibcxxAtomic.cmake
index 4ff343236fe..7d01a9bd1cb 100644
--- a/libcxx/cmake/Modules/CheckLibcxxAtomic.cmake
+++ b/libcxx/cmake/Modules/CheckLibcxxAtomic.cmake
@@ -9,10 +9,13 @@ INCLUDE(CheckCXXSourceCompiles)
function(check_cxx_atomics varname)
set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
- set(CMAKE_REQUIRED_FLAGS "-std=c++11 -nostdinc++ -isystem ${LIBCXX_SOURCE_DIR}/include")
+ set(CMAKE_REQUIRED_FLAGS "-nodefaultlibs -std=c++11 -nostdinc++ -isystem ${LIBCXX_SOURCE_DIR}/include")
if (${LIBCXX_GCC_TOOLCHAIN})
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} --gcc-toolchain=${LIBCXX_GCC_TOOLCHAIN}")
endif()
+ if (CMAKE_C_FLAGS MATCHES -fsanitize OR CMAKE_CXX_FLAGS MATCHES -fsanitize)
+ set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -fno-sanitize=all")
+ endif()
check_cxx_source_compiles("
#include <cstdint>
#include <atomic>
OpenPOWER on IntegriCloud