diff options
author | Petr Hosek <phosek@chromium.org> | 2019-05-22 21:08:33 +0000 |
---|---|---|
committer | Petr Hosek <phosek@chromium.org> | 2019-05-22 21:08:33 +0000 |
commit | 81f433b48c1892034e7061452ffb158e5244f62d (patch) | |
tree | 592299894bc8b5b9526c0e35d5d03d2283746e15 /clang/lib/Driver/ToolChain.cpp | |
parent | 93f38e1f1ae23623a03d456b5b46f19f5c500036 (diff) | |
download | llvm-81f433b48c1892034e7061452ffb158e5244f62d.zip llvm-81f433b48c1892034e7061452ffb158e5244f62d.tar.gz llvm-81f433b48c1892034e7061452ffb158e5244f62d.tar.bz2 |
[runtimes] Move libunwind, libc++abi and libc++ to lib/$target/c++ and include/c++
This change is a consequence of the discussion in "RFC: Place libs in
Clang-dedicated directories", specifically the suggestion that
libunwind, libc++abi and libc++ shouldn't be using Clang resource
directory. Tools like clangd make this assumption, but this is
currently not true for the LLVM_ENABLE_PER_TARGET_RUNTIME_DIR build.
This change addresses that by moving the output of these libraries to
lib/$target/c++ and include/c++ directories, leaving resource directory
only for compiler-rt runtimes and Clang builtin headers.
Differential Revision: https://reviews.llvm.org/D59168
llvm-svn: 361432
Diffstat (limited to 'clang/lib/Driver/ToolChain.cpp')
-rw-r--r-- | clang/lib/Driver/ToolChain.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp index dbb347c..3b0e8f2 100644 --- a/clang/lib/Driver/ToolChain.cpp +++ b/clang/lib/Driver/ToolChain.cpp @@ -75,6 +75,13 @@ ToolChain::ToolChain(const Driver &D, const llvm::Triple &T, CachedRTTIMode(CalculateRTTIMode(Args, Triple, CachedRTTIArg)) { SmallString<128> P; + if (D.CCCIsCXX()) { + P.assign(D.Dir); + llvm::sys::path::append(P, "..", "lib", D.getTargetTriple(), "c++"); + if (getVFS().exists(P)) + getLibraryPaths().push_back(P.str()); + } + P.assign(D.ResourceDir); llvm::sys::path::append(P, D.getTargetTriple(), "lib"); if (getVFS().exists(P)) |