Support for multiarch runtimes layout
authorPetr Hosek <phosek@chromium.org>
Thu, 28 Jun 2018 03:11:52 +0000 (03:11 +0000)
committerPetr Hosek <phosek@chromium.org>
Thu, 28 Jun 2018 03:11:52 +0000 (03:11 +0000)
commit887f26d4703616934fd7a11b6649f605e1c7b4e3
tree6cdd1b4f61afe4300fcd4fd8aa41e6b1e8cfcdc6
parent4ba041fa25b7e34bd10c598b53b04f023681b322
Support for multiarch runtimes layout

This change adds a support for multiarch style runtimes layout, so in
addition to the existing layout where runtimes get installed to:

lib/clang/$version/lib/$os

Clang now allows runtimes to be installed to:

lib/clang/$version/$target/lib

This also includes libc++, libc++abi and libunwind; today those are
assumed to be in Clang library directory built for host, with the
new layout it is possible to install libc++, libc++abi and libunwind
into the runtime directory built for different targets.

The use of new layout is enabled by setting the
LLVM_ENABLE_RUNTIME_TARGET_DIR CMake variable and is supported by both
projects and runtimes layouts. The runtimes CMake build has been further
modified to use the new layout when building runtimes for multiple
targets.

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

llvm-svn: 335809
34 files changed:
clang/lib/Driver/ToolChain.cpp
clang/lib/Driver/ToolChains/Fuchsia.cpp
clang/lib/Driver/ToolChains/Linux.cpp
clang/test/CMakeLists.txt
clang/test/Driver/Inputs/resource_dir_with_per_target_subdir/aarch64-fuchsia/lib/.keep [new file with mode: 0644]
clang/test/Driver/Inputs/resource_dir_with_per_target_subdir/i386-linux-gnu/lib/.keep [new file with mode: 0644]
clang/test/Driver/Inputs/resource_dir_with_per_target_subdir/include/c++/v1/.keep [new file with mode: 0644]
clang/test/Driver/Inputs/resource_dir_with_per_target_subdir/x86_64-fuchsia/lib/.keep [new file with mode: 0644]
clang/test/Driver/Inputs/resource_dir_with_per_target_subdir/x86_64-linux-gnu/lib/.keep [new file with mode: 0644]
clang/test/Driver/fuchsia.c
clang/test/Driver/fuchsia.cpp
clang/test/Driver/linux-header-search.cpp
clang/test/Driver/linux-ld.c
clang/test/Driver/linux-per-target-runtime-dir.c [new file with mode: 0644]
compiler-rt/CMakeLists.txt
compiler-rt/cmake/Modules/AddCompilerRT.cmake
compiler-rt/cmake/Modules/CompilerRTUtils.cmake
compiler-rt/cmake/Modules/SanitizerUtils.cmake
compiler-rt/cmake/base-config-ix.cmake
compiler-rt/cmake/config-ix.cmake
compiler-rt/test/asan/lit.cfg
compiler-rt/test/builtins/Unit/lit.cfg
compiler-rt/test/fuzzer/lit.cfg
compiler-rt/test/fuzzer/lit.site.cfg.in
compiler-rt/test/lit.common.configured.in
compiler-rt/test/scudo/lit.cfg
compiler-rt/test/xray/lit.cfg
libcxx/CMakeLists.txt
libcxx/cmake/Modules/HandleLibCXXABI.cmake
libcxx/include/CMakeLists.txt
libcxxabi/CMakeLists.txt
libunwind/CMakeLists.txt
llvm/CMakeLists.txt
llvm/runtimes/CMakeLists.txt