[libcxx{,abi}] Don't link libpthread and libdl on Fuchsia

These are a part of the libc so linking these explicitly isn't necessary
and embedding these as deplibs causes link time error.

This issues was introduced in a9b5fff which changed how we emit deplibs.

Differential Revision: https://reviews.llvm.org/D71135
This commit is contained in:
Petr Hosek 2019-12-06 11:11:31 -08:00
parent c7faa68142
commit 1aa1702381
2 changed files with 18 additions and 5 deletions

View File

@ -89,6 +89,11 @@ elseif(APPLE)
set(LIBCXX_HAS_PTHREAD_LIB NO) set(LIBCXX_HAS_PTHREAD_LIB NO)
set(LIBCXX_HAS_M_LIB NO) set(LIBCXX_HAS_M_LIB NO)
set(LIBCXX_HAS_RT_LIB NO) set(LIBCXX_HAS_RT_LIB NO)
elseif(FUCHSIA)
set(LIBCXX_HAS_M_LIB NO)
set(LIBCXX_HAS_PTHREAD_LIB NO)
set(LIBCXX_HAS_RT_LIB NO)
set(LIBCXX_HAS_SYSTEM_LIB NO)
else() else()
check_library_exists(pthread pthread_create "" LIBCXX_HAS_PTHREAD_LIB) check_library_exists(pthread pthread_create "" LIBCXX_HAS_PTHREAD_LIB)
check_library_exists(m ccos "" LIBCXX_HAS_M_LIB) check_library_exists(m ccos "" LIBCXX_HAS_M_LIB)

View File

@ -71,8 +71,16 @@ endif()
check_cxx_compiler_flag(-nostdinc++ LIBCXXABI_HAS_NOSTDINCXX_FLAG) check_cxx_compiler_flag(-nostdinc++ LIBCXXABI_HAS_NOSTDINCXX_FLAG)
# Check libraries # Check libraries
check_library_exists(dl dladdr "" LIBCXXABI_HAS_DL_LIB) if(FUCHSIA)
check_library_exists(pthread pthread_once "" LIBCXXABI_HAS_PTHREAD_LIB) set(LIBCXXABI_HAS_DL_LIB NO)
check_library_exists(c __cxa_thread_atexit_impl "" set(LIBCXXABI_HAS_PTHREAD_LIB NO)
LIBCXXABI_HAS_CXA_THREAD_ATEXIT_IMPL) check_library_exists(c __cxa_thread_atexit_impl ""
check_library_exists(System write "" LIBCXXABI_HAS_SYSTEM_LIB) LIBCXXABI_HAS_CXA_THREAD_ATEXIT_IMPL)
set(LIBCXXABI_HAS_SYSTEM_LIB NO)
else()
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)
endif()