summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouis Dionne <ldionne@apple.com>2019-10-04 18:32:46 +0000
committerLouis Dionne <ldionne@apple.com>2019-10-04 18:32:46 +0000
commit4e3fd556ec165586460cb43f0cedb36960ad20c6 (patch)
treea5d7af8e2a1c832567c018d5c810e8f1b04ada48
parent2933bf8e793e69d882ad423a6de5af101620763f (diff)
[libc++abi] Link against libSystem on Apple platforms
On Apple platforms, libSystem is an umbrella for all other system libraries, and libpthread (and friends) are actually just symlinks to libSystem. git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@373770 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--cmake/config-ix.cmake1
-rw-r--r--src/CMakeLists.txt11
2 files changed, 9 insertions, 3 deletions
diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake
index 94f89be..496ed34 100644
--- a/cmake/config-ix.cmake
+++ b/cmake/config-ix.cmake
@@ -75,3 +75,4 @@ check_library_exists(dl dladdr "" LIBCXXABI_HAS_DL_LIB)
check_library_exists(pthread pthread_once "" LIBCXXABI_HAS_PTHREAD_LIB)
check_library_exists(c __cxa_thread_atexit_impl ""
LIBCXXABI_HAS_CXA_THREAD_ATEXIT_IMPL)
+check_library_exists(System write "" LIBCXXABI_HAS_SYSTEM_LIB)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 6cfcb9c..cbf4b21 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -60,11 +60,16 @@ if (LIBCXXABI_HAS_CXA_THREAD_ATEXIT_IMPL)
add_definitions(-DHAVE___CXA_THREAD_ATEXIT_IMPL)
endif()
-if (LIBCXXABI_ENABLE_THREADS)
- add_library_flags_if(LIBCXXABI_HAS_PTHREAD_LIB pthread)
+if (APPLE)
+ add_library_flags_if(LIBCXXABI_HAS_SYSTEM_LIB System)
+else()
+ if (LIBCXXABI_ENABLE_THREADS)
+ add_library_flags_if(LIBCXXABI_HAS_PTHREAD_LIB pthread)
+ endif()
+
+ add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
endif()
-add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
if (LIBCXXABI_USE_LLVM_UNWINDER)
# Prefer using the in-tree version of libunwind, either shared or static. If
# none are found fall back to using -lunwind.