[libcxx] r279606 - libc++: add an option to build against compiler-rt
Saleem Abdulrasool via cfe-commits
cfe-commits at lists.llvm.org
Tue Aug 23 21:22:52 PDT 2016
Author: compnerd
Date: Tue Aug 23 23:22:52 2016
New Revision: 279606
URL: http://llvm.org/viewvc/llvm-project?rev=279606&view=rev
Log:
libc++: add an option to build against compiler-rt
This mirrors the option in libc++abi to build without libgcc.
Modified:
libcxx/trunk/CMakeLists.txt
libcxx/trunk/cmake/config-ix.cmake
Modified: libcxx/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/CMakeLists.txt?rev=279606&r1=279605&r2=279606&view=diff
==============================================================================
--- libcxx/trunk/CMakeLists.txt (original)
+++ libcxx/trunk/CMakeLists.txt Tue Aug 23 23:22:52 2016
@@ -68,6 +68,7 @@ option(LIBCXX_INSTALL_SUPPORT_HEADERS "I
option(LIBCXX_INSTALL_EXPERIMENTAL_LIBRARY "Install libc++experimental.a" OFF)
set(LIBCXX_ABI_VERSION 1 CACHE STRING "ABI version of libc++.")
option(LIBCXX_ABI_UNSTABLE "Unstable ABI of libc++." OFF)
+option(LIBCXX_USE_COMPILER_RT "Use compiler-rt instead of libgcc" OFF)
if (NOT LIBCXX_ENABLE_SHARED AND NOT LIBCXX_ENABLE_STATIC)
message(FATAL_ERROR "libc++ must be built as either a shared or static library.")
@@ -277,6 +278,10 @@ add_target_flags_if(LIBCXX_GCC_TOOLCHAIN
# Configure compiler.
include(config-ix)
+if (LIBCXX_USE_COMPILER_RT)
+ list(APPEND LIBCXX_LINK_FLAGS "-rtlib=compiler-rt")
+endif()
+
# Configure coverage options.
if (LIBCXX_GENERATE_COVERAGE)
include(CodeCoverage)
Modified: libcxx/trunk/cmake/config-ix.cmake
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/cmake/config-ix.cmake?rev=279606&r1=279605&r2=279606&view=diff
==============================================================================
--- libcxx/trunk/cmake/config-ix.cmake (original)
+++ libcxx/trunk/cmake/config-ix.cmake Tue Aug 23 23:22:52 2016
@@ -17,4 +17,6 @@ check_library_exists(pthread pthread_cre
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 LIBCXX_USE_COMPILER_RT)
+ check_library_exists(gcc_s __gcc_personality_v0 "" LIBCXX_HAS_GCC_S_LIB)
+endif()
More information about the cfe-commits
mailing list