This is a follow-up to r335809 and r337118. While libc++ headers are now installed into the right location in both standard as well as multiarch runtimes layout, turned out C++ ABI headers are still installed into the old location in the latter case. This change addresses that.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
This change LGTM. However, I do have a question about the overall change (including r335809 and r337118). Why is it that we're not simply relying on the CMAKE_INSTALL_PREFIX being set to the path where we should install instead of using all these custom variables like LIBCXX_INSTALL_HEADER_PREFIX? I'm curious to understand what's special about your use case, since it does seem like we're doing things differently in a few places for Fuchsia.
We currently support two different layouts:
- 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.
- 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.