[PATCH] D49584: [CMake] Install C++ ABI headers into the right location

Petr Hosek via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 20 12:21:47 PDT 2018


phosek added a subscriber: beanz.
phosek added a comment.

We currently support two different layouts:

1. The standard layout (for a lack of a better name) which is used when libc++ is built standalone as well as being built as part of LLVM without any other options which is `$DESTDIR/include/c++/v1` for headers and `$DESTDIR/lib` for libraries. Clang driver knows where to find those headers and libraries when libc++ is selected, the problem is that this only works for the default target since there's going to be just a single copy of `$DESTDIR/lib/libc++.so`, etc.
2. The mutliarch runtime layout where headers are installed to `$DESTDIR/lib/clang/$CLANG_VERSION/include/c++/v1` and libraries to `$DESTDIR/lib/clang/$CLANG_VERSION/$TARGET/lib` where `$TARGET` is the target passed to Clang, e.g. `--target=x86-linux-gnu`. This layout supports distributing libc++ (and other runtimes) for multiple different targets with your toolchain. The reason we cannot use the same prefix for both headers and libraries is the multiarch runtime layout since headers and libraries are installed to different paths.

Fuchsia is currently the first toolchain that AFAIK uses the new layout for its toolchain, but @beanz is working on using this layout also for Darwin. Android team also expressed interest in using the new layout since they need to support multiple targets in their toolchain.


Repository:
  rCXX libc++

https://reviews.llvm.org/D49584





More information about the cfe-commits mailing list