[libcxx-commits] [libcxx] 3b71f91 - [libcxx] Fix compile for BUILD_EXTERNAL_THREAD_LIBRARY
Mikhail Maltsev via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Aug 27 08:25:04 PDT 2020
Author: David Nicuesa
Date: 2020-08-27T16:24:19+01:00
New Revision: 3b71f91558ff8b569199547efe800cb501c3cf94
URL: https://github.com/llvm/llvm-project/commit/3b71f91558ff8b569199547efe800cb501c3cf94
DIFF: https://github.com/llvm/llvm-project/commit/3b71f91558ff8b569199547efe800cb501c3cf94.diff
LOG: [libcxx] Fix compile for BUILD_EXTERNAL_THREAD_LIBRARY
Fix compilation with -DLIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY when using clang. Now linking target 'cxx_external_threads' with 'cxx-headers'. Fix mismatching visibility for `libcpp_timed_backoff_policy` function in file <__threading_support>.
Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D86598
Added:
Modified:
libcxx/include/__threading_support
libcxx/src/CMakeLists.txt
Removed:
################################################################################
diff --git a/libcxx/include/__threading_support b/libcxx/include/__threading_support
index 072c4c7bcc89..f8add051f2ab 100644
--- a/libcxx/include/__threading_support
+++ b/libcxx/include/__threading_support
@@ -282,7 +282,7 @@ struct __libcpp_timed_backoff_policy {
bool operator()(chrono::nanoseconds __elapsed) const;
};
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_THREAD_ABI_VISIBILITY
bool __libcpp_timed_backoff_policy::operator()(chrono::nanoseconds __elapsed) const
{
if(__elapsed > chrono::milliseconds(128))
diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt
index 2001c09761d9..dcd53c8a302a 100644
--- a/libcxx/src/CMakeLists.txt
+++ b/libcxx/src/CMakeLists.txt
@@ -323,7 +323,8 @@ endif()
if (LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY)
- file(GLOB LIBCXX_EXTERNAL_THREADING_SUPPORT_SOURCES ../test/support/external_threads.cpp)
+ 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})
@@ -337,6 +338,8 @@ if (LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY)
COMPILE_FLAGS "${LIBCXX_COMPILE_FLAGS}"
OUTPUT_NAME "c++external_threads"
)
+
+ target_link_libraries(cxx_external_threads PRIVATE cxx-headers)
endif()
if (LIBCXX_INSTALL_LIBRARY)
More information about the libcxx-commits
mailing list