Skip to content
This repository has been archived by the owner on Apr 23, 2020. It is now read-only.

Commit

Permalink
[libc++abi] Link against libSystem on Apple platforms
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ldionne committed Oct 4, 2019
1 parent 2933bf8 commit 4e3fd55
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions cmake/config-ix.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
11 changes: 8 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 4e3fd55

Please sign in to comment.