Runtime builds (libc++/compiler-rt) and install directories

Hello,

I am converting our build-system to use runtime builds (so that
runtimes are built with the newly built compiler) by setting
LLVM_ENABLE_RUNTIMES=libcxx;compiler-rt and I am running into some
problems with the default search directories and getting a "out of the
box" working toolchain.

By default the runtimes are installed into
<root>/lib/x86_64-unknown-linux-gnu/... and
<root>/lib/clang/12.0.0/lib/x86_64-unknown-linux-gnu

Trying to use clang or clang++ later will not automatically search
those directories. With the old way of doing this (without runtime
builds) it would install the libraries and headers in places where
clang/clang++ would automatically find it.

I have tried the CMake option LLVM_ENABLE_PER_TARGET_RUNTIME_DIR and
set it to "OFF" but this seems not to change anything.

Is there a way to get clang to automatically search these dirs or
control the install directory?

Thanks,
Tobias

They should be searched automatically, see:

https://github.com/llvm/llvm-project/blob/03f7b13d4452e3ee7749ed0cd354071eced25502/clang/lib/Driver/ToolChain.cpp#L83

https://github.com/llvm/llvm-project/blob/03f7b13d4452e3ee7749ed0cd354071eced25502/clang/lib/Driver/ToolChain.cpp#L485

What error are you getting?