diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt --- a/libcxx/CMakeLists.txt +++ b/libcxx/CMakeLists.txt @@ -272,9 +272,6 @@ option(LIBCXX_HAS_EXTERNAL_THREAD_API "Build libc++ with an externalized threading API. This option may only be set to ON when LIBCXX_ENABLE_THREADS=ON." OFF) -option(LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY - "Build libc++ with an externalized threading library. - This option may only be set to ON when LIBCXX_ENABLE_THREADS=ON" OFF) if (LIBCXX_ENABLE_THREADS) set(LIBCXX_PSTL_CPU_BACKEND "std_thread" CACHE STRING "Which PSTL CPU backend to use") @@ -327,10 +324,6 @@ message(FATAL_ERROR "LIBCXX_HAS_EXTERNAL_THREAD_API can only be set to ON" " when LIBCXX_ENABLE_THREADS is also set to ON.") endif() - if (LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY) - message(FATAL_ERROR "LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY can only be set " - "to ON when LIBCXX_ENABLE_THREADS is also set to ON.") - endif() if (LIBCXX_HAS_WIN32_THREAD_API) message(FATAL_ERROR "LIBCXX_HAS_WIN32_THREAD_API can only be set to ON" " when LIBCXX_ENABLE_THREADS is also set to ON.") @@ -339,11 +332,6 @@ endif() if (LIBCXX_HAS_EXTERNAL_THREAD_API) - if (LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY) - message(FATAL_ERROR "The options LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY and " - "LIBCXX_HAS_EXTERNAL_THREAD_API cannot both be ON at " - "the same time") - endif() if (LIBCXX_HAS_PTHREAD_API) message(FATAL_ERROR "The options LIBCXX_HAS_EXTERNAL_THREAD_API" "and LIBCXX_HAS_PTHREAD_API cannot be both" @@ -573,17 +561,6 @@ endif() endfunction() -# Threading flags ============================================================= -if (LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY AND LIBCXX_ENABLE_SHARED) - # Need to allow unresolved symbols if this is to work with shared library builds - if (APPLE) - add_link_flags("-undefined dynamic_lookup") - else() - # Relax this restriction from HandleLLVMOptions - string(REPLACE "-Wl,-z,defs" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}") - endif() -endif() - # Modules flags =============================================================== # FIXME The libc++ sources are fundamentally non-modular. They need special # versions of the headers in order to provide C++03 and legacy ABI definitions. @@ -764,7 +741,6 @@ config_define_if(LIBCXX_HAS_PTHREAD_API _LIBCPP_HAS_THREAD_API_PTHREAD) config_define_if(LIBCXX_HAS_EXTERNAL_THREAD_API _LIBCPP_HAS_THREAD_API_EXTERNAL) config_define_if(LIBCXX_HAS_WIN32_THREAD_API _LIBCPP_HAS_THREAD_API_WIN32) -config_define_if(LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY _LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL) config_define_if(LIBCXX_HAS_MUSL_LIBC _LIBCPP_HAS_MUSL_LIBC) config_define_if(LIBCXX_NO_VCRUNTIME _LIBCPP_NO_VCRUNTIME) config_define_if_not(LIBCXX_ENABLE_FILESYSTEM _LIBCPP_HAS_NO_FILESYSTEM) @@ -860,10 +836,6 @@ set(LIBCXX_TEST_DEPS "cxx_experimental") -if (LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY) - list(APPEND LIBCXX_TEST_DEPS cxx_external_threads) -endif() - if (LIBCXX_ENABLE_CLANG_TIDY) list(APPEND LIBCXX_TEST_DEPS cxx-tidy) endif() diff --git a/libcxx/docs/DesignDocs/ThreadingSupportAPI.rst b/libcxx/docs/DesignDocs/ThreadingSupportAPI.rst --- a/libcxx/docs/DesignDocs/ThreadingSupportAPI.rst +++ b/libcxx/docs/DesignDocs/ThreadingSupportAPI.rst @@ -42,14 +42,6 @@ ``<__external_threading>`` header, which declares the libc++ internal threading API but leaves out the implementation. -The ``-DLIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY`` option allows building libc++ in -such a configuration while allowing it to be tested on a platform that supports -any of the threading systems (e.g. pthread) supported in ``__threading_support`` -header. Therefore, the main purpose of this option is to allow testing of this -particular configuration of the library without being tied to a vendor-specific -threading system. This option is only meant to be used by libc++ library -developers. - Threading Configuration Macros ============================== @@ -69,15 +61,3 @@ **_LIBCPP_HAS_THREAD_API_WIN32** This macro is defined when libc++ should use Win32 threads to implement the internal threading API. - -**_LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL** - This macro is defined when libc++ expects the definitions of the internal - threading API to be provided by an external library. When defined - ``<__threading_support>`` will only provide the forward declarations and - typedefs for the internal threading API. - -**_LIBCPP_BUILDING_THREAD_LIBRARY_EXTERNAL** - This macro is used to build an external threading library using the - ``<__threading_support>``. Specifically it exposes the threading API - definitions in ``<__threading_support>`` as non-inline definitions meant to - be compiled into a library. diff --git a/libcxx/include/__config_site.in b/libcxx/include/__config_site.in --- a/libcxx/include/__config_site.in +++ b/libcxx/include/__config_site.in @@ -19,7 +19,6 @@ #cmakedefine _LIBCPP_HAS_THREAD_API_PTHREAD #cmakedefine _LIBCPP_HAS_THREAD_API_EXTERNAL #cmakedefine _LIBCPP_HAS_THREAD_API_WIN32 -#cmakedefine _LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL #cmakedefine _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS #cmakedefine _LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS #cmakedefine _LIBCPP_NO_VCRUNTIME diff --git a/libcxx/include/__threading_support b/libcxx/include/__threading_support --- a/libcxx/include/__threading_support +++ b/libcxx/include/__threading_support @@ -36,9 +36,7 @@ # include #endif -#if defined(_LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL) || \ - defined(_LIBCPP_BUILDING_THREAD_LIBRARY_EXTERNAL) || \ - defined(_LIBCPP_HAS_THREAD_API_WIN32) +#if defined(_LIBCPP_HAS_THREAD_API_WIN32) #define _LIBCPP_THREAD_ABI_VISIBILITY _LIBCPP_EXPORTED_FROM_ABI #else #define _LIBCPP_THREAD_ABI_VISIBILITY inline _LIBCPP_INLINE_VISIBILITY @@ -248,9 +246,6 @@ #endif // !defined(_LIBCPP_HAS_THREAD_API_EXTERNAL) -#if (!defined(_LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL) || \ - defined(_LIBCPP_BUILDING_THREAD_LIBRARY_EXTERNAL)) - #if defined(_LIBCPP_HAS_THREAD_API_PTHREAD) int __libcpp_recursive_mutex_init(__libcpp_recursive_mutex_t *__m) @@ -585,8 +580,6 @@ #endif -#endif // !_LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL || _LIBCPP_BUILDING_THREAD_LIBRARY_EXTERNAL - #endif // !_LIBCPP_HAS_NO_THREADS _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt --- a/libcxx/src/CMakeLists.txt +++ b/libcxx/src/CMakeLists.txt @@ -346,27 +346,6 @@ cxx_add_common_build_flags(cxx_experimental) target_compile_options(cxx_experimental PUBLIC -D_LIBCPP_ENABLE_EXPERIMENTAL) - -if (LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY) - set(LIBCXX_EXTERNAL_THREADING_SUPPORT_SOURCES - "${CMAKE_CURRENT_SOURCE_DIR}/../test/support/external_threads.cpp") - - if (LIBCXX_ENABLE_SHARED) - add_library(cxx_external_threads SHARED ${LIBCXX_EXTERNAL_THREADING_SUPPORT_SOURCES}) - else() - add_library(cxx_external_threads STATIC ${LIBCXX_EXTERNAL_THREADING_SUPPORT_SOURCES}) - endif() - - set_target_properties(cxx_external_threads - PROPERTIES - LINK_FLAGS "${LIBCXX_LINK_FLAGS}" - COMPILE_FLAGS "${LIBCXX_COMPILE_FLAGS}" - OUTPUT_NAME "c++external_threads" - ) - - target_link_libraries(cxx_external_threads PRIVATE cxx-headers) -endif() - if (LIBCXX_INSTALL_SHARED_LIBRARY) install(TARGETS cxx_shared ARCHIVE DESTINATION ${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx diff --git a/libcxx/test/support/external_threads.cpp b/libcxx/test/support/external_threads.cpp deleted file mode 100644 --- a/libcxx/test/support/external_threads.cpp +++ /dev/null @@ -1,9 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -#define _LIBCPP_BUILDING_THREAD_LIBRARY_EXTERNAL -#include <__threading_support> diff --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt --- a/libcxxabi/CMakeLists.txt +++ b/libcxxabi/CMakeLists.txt @@ -55,9 +55,6 @@ option(LIBCXXABI_HAS_EXTERNAL_THREAD_API "Build libc++abi with an externalized threading API. This option may only be set to ON when LIBCXXABI_ENABLE_THREADS=ON." OFF) -option(LIBCXXABI_BUILD_EXTERNAL_THREAD_LIBRARY - "Build libc++abi with an externalized threading library. - This option may only be set to ON when LIBCXXABI_ENABLE_THREADS=ON" OFF) option(LIBCXXABI_ENABLE_FORGIVING_DYNAMIC_CAST "Make dynamic_cast more forgiving when type_info's mistakenly have hidden \ visibility, and thus multiple type_infos can exist for a single type. \ @@ -330,11 +327,6 @@ " be set to ON when LIBCXXABI_ENABLE_THREADS" " is also set to ON.") endif() - if (LIBCXXABI_BUILD_EXTERNAL_THREAD_LIBRARY) - message(FATAL_ERROR "LIBCXXABI_BUILD_EXTERNAL_THREAD_LIBRARY can only" - " be set to ON when LIBCXXABI_ENABLE_THREADS" - " is also set to ON.") - endif() add_definitions(-D_LIBCXXABI_HAS_NO_THREADS) endif() @@ -349,11 +341,6 @@ " and LIBCXXABI_HAS_WIN32_THREAD_API cannot be both" " set to ON at the same time.") endif() - if (LIBCXXABI_BUILD_EXTERNAL_THREAD_LIBRARY) - message(FATAL_ERROR "The options LIBCXXABI_BUILD_EXTERNAL_THREAD_LIBRARY" - " and LIBCXXABI_HAS_EXTERNAL_THREAD_API cannot be both" - " set to ON at the same time.") - endif() endif() if (LIBCXXABI_HAS_PTHREAD_API) @@ -371,9 +358,7 @@ endif() set(LIBCXXABI_HAS_UNDEFINED_SYMBOLS OFF) -if ((NOT LIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS) - OR (LIBCXXABI_BUILD_EXTERNAL_THREAD_LIBRARY AND LIBCXXABI_ENABLE_SHARED) - OR MINGW) +if ((NOT LIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS) OR MINGW) set(LIBCXXABI_HAS_UNDEFINED_SYMBOLS ON) endif() @@ -399,10 +384,6 @@ add_definitions(-D_LIBCPP_HAS_THREAD_API_EXTERNAL) endif() -if (LIBCXXABI_BUILD_EXTERNAL_THREAD_LIBRARY) - add_definitions(-D_LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL) -endif() - if (MSVC) add_definitions(-D_CRT_SECURE_NO_WARNINGS) endif() diff --git a/libcxxabi/test/CMakeLists.txt b/libcxxabi/test/CMakeLists.txt --- a/libcxxabi/test/CMakeLists.txt +++ b/libcxxabi/test/CMakeLists.txt @@ -17,10 +17,6 @@ set(LIBCXXABI_TEST_DEPS cxxabi_static) endif() -if (LIBCXXABI_BUILD_EXTERNAL_THREAD_LIBRARY) - list(APPEND LIBCXXABI_TEST_DEPS cxx_external_threads) -endif() - list(APPEND LIBCXXABI_TEST_DEPS cxx) if (LIBCXXABI_USE_LLVM_UNWINDER AND TARGET unwind) list(APPEND LIBCXXABI_TEST_DEPS unwind)