[libc++] Include <__config_site> from <__config>

Authored by ldionne on Jun 26 2020, 9:08 AM.


[libc++] Include <config_site> from <config>

Prior to this patch, we would generate a fancy <config> header by
concatenating <
config_site> and <__config>. This complexifies the
build system and also increases the difference between what's tested
and what's actually installed.

This patch removes that complexity and instead simply installs <config_site>
alongside the libc++ headers. <
config_site> is then included by <config>,
which is much simpler. Doing this also opens the door to having different
config_site> headers depending on the target, which was impossible before.

It does change the workflow for testing header-only changes to libc++.
Previously, we would run lit against the headers in libcxx/include.
After this patch, we run it against a fake installation root of the
headers (containing a proper <__config_site> header). This makes use
closer to testing what we actually install, which is good, however it
does mean that we have to update that root before testing header changes.
Thus, we now need to run ninja check-cxx-deps before running lit by

Differential Revision: https://reviews.llvm.org/D97572


phosekMar 30 2021, 2:06 PM
Differential Revision
D97572: [libc++] Include <__config_site> from <__config>
rG3a6365a439ed: [ARM] Add FeatureHasNoBranchPredictor for Thumb1 cores

Event Timeline

muiez added a subscriber: muiez.Thu, Apr 22, 9:43 AM
muiez added inline comments.

Wouldn't this copy the libc++abi headers to include/c++/v1/include/c++/v1/ (on z/OS for example)? I ask because LIBCXX_GENERATED_INCLUDE_DIR is already set to ${LLVM_BINARY_DIR}/include/c++/v1 above. Nonetheless, the old change copies them to include/c++/v1 instead. In other words, was this intended?

ldionne marked an inline comment as done.Wed, Apr 28, 7:09 AM
ldionne added a subscriber: phosek.
ldionne added inline comments.