This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Remove internal "build-with-external-thread-library" configuration
ClosedPublic

Authored by ldionne on Jul 4 2023, 3:56 PM.

Details

Reviewers
ldionne
Group Reviewers
Restricted Project
Restricted Project
Commits
rG8ac71b026ee6: [libc++] Remove internal "build-with-external-thread-library" configuration
Summary

Our threading support layer is currently a huge mess. There are too many
configurations with too many confusing names, and none of them are tested
in the usual CI. Here's a list of names related to these configurations:

LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY
_LIBCPP_BUILDING_THREAD_LIBRARY_EXTERNAL

LIBCXXABI_BUILD_EXTERNAL_THREAD_LIBRARY
_LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL

LIBCXX_HAS_EXTERNAL_THREAD_API
_LIBCPP_HAS_THREAD_API_EXTERNAL

This patch cleans this up by removing the ability to build libc++ with
an "external" threading library for testing purposes, removing 4 out of
6 "names" above. That setting was meant to be used by libc++ developers,
but we don't use it in-tree and it's not part of our CI.

I know the ability to use an external threading API is used by some folks
out-of-tree, and this patch doesn't change that. This only changes the
way they will have to test their external threading support. After this
patch, the intent would be for them to set -DLIBCXX_HAS_EXTERNAL_THREAD_API=ON
when building the library, and to provide their usual <__external_threading>
header when they are testing the library. This can be done easily now
that we support custom lit configuration files in test suites.

The motivation for this patch is that our threading support layer is
basically unmaintainable -- anything beyond adding a new "backend" in
the slot designed for it requires incredible attention. The complexity
added by this setting just doesn't pull its weigh considering the
available alternatives.

Concretely, this will also allow future patches to clean up
<__threading_support> significantly.

Diff Detail

Event Timeline

ldionne created this revision.Jul 4 2023, 3:56 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 4 2023, 3:56 PM
Herald added a subscriber: mstorsjo. · View Herald Transcript
ldionne requested review of this revision.Jul 4 2023, 3:56 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJul 4 2023, 3:56 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
Herald added a reviewer: Restricted Project. · View Herald Transcript
ldionne added a subscriber: miyuki.Jul 4 2023, 3:57 PM
ldionne added a subscriber: Restricted Project.Jul 6 2023, 5:38 AM

Pinging libc++ vendors to see if anyone has something to say.

Just as a heads up, I will ship this on Wednesday July 12th unless there is something to discuss. Otherwise, it seems like nobody cares and this is indeed unused.

ldionne accepted this revision.Jul 12 2023, 11:09 AM
This revision is now accepted and ready to land.Jul 12 2023, 11:09 AM
ldionne updated this revision to Diff 540398.Jul 14 2023, 6:39 AM

Rebase onto main.

libcxx/src/CMakeLists.txt