From 963bcd2ec31fd512b11bb557ec0c73337867dbe4 Mon Sep 17 00:00:00 2001 From: Petr Hosek Date: Wed, 5 Apr 2017 22:53:05 +0000 Subject: [CMake][libcxx] Use builtins rather than gcc_s when compiler-rt is requested When compiler-rt is requested, we should attempt to link compiler-rt builtins library rather than gcc_s. Differential Revision: https://reviews.llvm.org/D31617 llvm-svn: 299599 --- libcxx/lib/CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'libcxx/lib') diff --git a/libcxx/lib/CMakeLists.txt b/libcxx/lib/CMakeLists.txt index e6f3b4c5581..bc15be6798e 100644 --- a/libcxx/lib/CMakeLists.txt +++ b/libcxx/lib/CMakeLists.txt @@ -83,7 +83,12 @@ add_library_flags_if(LIBCXX_HAS_PTHREAD_LIB pthread) add_library_flags_if(LIBCXX_HAS_C_LIB c) add_library_flags_if(LIBCXX_HAS_M_LIB m) add_library_flags_if(LIBCXX_HAS_RT_LIB rt) -add_library_flags_if(LIBCXX_HAS_GCC_S_LIB gcc_s) +if (LIBCXX_USE_COMPILER_RT) + find_compiler_rt_library(builtins LIBCXX_BUILTINS_LIBRARY) + add_library_flags_if(LIBCXX_BUILTINS_LIBRARY "${LIBCXX_BUILTINS_LIBRARY}") +else() + add_library_flags_if(LIBCXX_HAS_GCC_S_LIB gcc_s) +endif() add_library_flags_if(LIBCXX_HAVE_CXX_ATOMICS_WITH_LIB atomic) # Add the unwinder library. -- cgit v1.2.3