[PATCH] D31619: [CMake][libcxx] Link libc when checking for atomics support
Petr Hosek via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 3 12:38:13 PDT 2017
phosek created this revision.
Herald added a subscriber: mgorny.
The C library is needed when linking the atomics test executable.
Repository:
rL LLVM
https://reviews.llvm.org/D31619
Files:
cmake/Modules/CheckLibcxxAtomic.cmake
Index: cmake/Modules/CheckLibcxxAtomic.cmake
===================================================================
--- cmake/Modules/CheckLibcxxAtomic.cmake
+++ cmake/Modules/CheckLibcxxAtomic.cmake
@@ -9,7 +9,7 @@
function(check_cxx_atomics varname)
set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
- set(CMAKE_REQUIRED_FLAGS "-nodefaultlibs -std=c++11 -nostdinc++ -isystem ${LIBCXX_SOURCE_DIR}/include")
+ set(CMAKE_REQUIRED_FLAGS "-nodefaultlibs -std=c++11 -nostdinc++ -isystem ${LIBCXX_SOURCE_DIR}/include -lc")
if (${LIBCXX_GCC_TOOLCHAIN})
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} --gcc-toolchain=${LIBCXX_GCC_TOOLCHAIN}")
endif()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31619.93923.patch
Type: text/x-patch
Size: 667 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170403/4e050822/attachment.bin>
More information about the llvm-commits
mailing list