summaryrefslogtreecommitdiffstats
path: root/libcxx/lib
diff options
context:
space:
mode:
authorPetr Hosek <phosek@chromium.org>2017-04-05 22:53:05 +0000
committerPetr Hosek <phosek@chromium.org>2017-04-05 22:53:05 +0000
commit963bcd2ec31fd512b11bb557ec0c73337867dbe4 (patch)
tree2e0b3f8bbcaa3109efb799cfdae2269b83831d9e /libcxx/lib
parente935296f369df6ac4bb54bf953c1a5ae219f5567 (diff)
downloadbcm5719-llvm-963bcd2ec31fd512b11bb557ec0c73337867dbe4.tar.gz
bcm5719-llvm-963bcd2ec31fd512b11bb557ec0c73337867dbe4.zip
[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
Diffstat (limited to 'libcxx/lib')
-rw-r--r--libcxx/lib/CMakeLists.txt7
1 files changed, 6 insertions, 1 deletions
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.
OpenPOWER on IntegriCloud