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>.
Details
- Reviewers
ldionne miyuki - Group Reviewers
Restricted Project - Commits
- rG3b71f91558ff: [libcxx] Fix compile for BUILD_EXTERNAL_THREAD_LIBRARY
Diff Detail
Event Timeline
libcxx/include/__threading_support | ||
---|---|---|
277 | Please remove stray changes (2 added/removed blank lines) |
libcxx/src/CMakeLists.txt | ||
---|---|---|
344 | I believe it would be better to use target_link_libraries(cxx_external_threads PRIVATE cxx-headers). This will setup the right flags for using the current libc++ headers. |
Updated CMakeList.txt to link against 'cxx-headers' rather than just including 'libcxx/include'.
Updated commit's summary to reflect this change.
Did you run the tests before committing this? It looks like it broke several builders, e.g. http://lab.llvm.org:8011/builders/libcxx-libcxxabi-x86_64-linux-debian-noexceptions/builds/2370
Thanks. I think the fix is just to remove the inline before _LIBCPP_THREAD_ABI_VISIBILITY, since _LIBCPP_THREAD_ABI_VISIBILITY already contains inline when not in the external threading library mode.
My bad, I did run tests but using the BUILD_EXTERNAL_THREAD_LIBRARY mode only, and forgot about the normal config.
As for the fix, if I remove that inline it breaks the external threading mode, but in order to fix that do you think is safe to change line 43 in __threading_support to #define _LIBCPP_THREAD_ABI_VISIBILITY inline _LIBCPP_FUNC_VIS. Adding the inline there?
Actually, looking at it again, the fix is to always use _LIBCPP_INLINE_VISIBILITY. Please rebase your change on top of 21a1a263a6d9c0c44ef8eb0744786e2aa5d59e53
This seems to have been reverted in
commit a19fd1aab519ccec18654f76a01b0345880c5200 Author: Mikhail Maltsev <mikhail.maltsev@arm.com> Date: Thu Aug 27 16:47:18 2020 +0100 Revert "[libcxx] Fix compile for BUILD_EXTERNAL_THREAD_LIBRARY" This reverts commit 3b71f91558ff8b569199547efe800cb501c3cf94. The commit is breaking some build bots.
Has it been committed again with a fix? I don't see it -- what's the status?
Hi Louis, this is the revision that fixes the compilation with EXTERNAL_LIBRARY (https://reviews.llvm.org/D86773), without changes to the visibility in the operator. As you fixed that already.
I believe it would be better to use target_link_libraries(cxx_external_threads PRIVATE cxx-headers). This will setup the right flags for using the current libc++ headers.