[clang] Allow using BareMetal toolchain with LLVM_ENABLE_PER_TARGET_RUNTIME_DIR compi...
authorMichael Platings <michael.platings@arm.com>
Mon, 12 Dec 2022 15:36:06 +0000 (15:36 +0000)
committerMichael Platings <michael.platings@arm.com>
Mon, 12 Dec 2022 15:36:06 +0000 (15:36 +0000)
commit620d2bfdadeb7f4936775422a0e965e7fcdcd204
treea8920cdc8be6324dc81217abe8b90fd12d9a4662
parentf6a96bee518fd1363a594d352ba0616515e82774
[clang] Allow using BareMetal toolchain with LLVM_ENABLE_PER_TARGET_RUNTIME_DIR compiler-rt

If you build compiler-rt with LLVM_ENABLE_PER_TARGET_RUNTIME_DIR then
the library filename will be "libclang_rt.builtins.a" instead of
"libclang_rt.builtins-<ARCH>.a"

The ToolChain::getCompilerRT method uses the "libclang_rt.builtins.a"
name if it can find the file in the library directories. If it can't
then it falls back to using "libclang_rt.builtins-<ARCH>.a". This
change adds the library directory such that "libclang_rt.builtins.a"
can be found.

Differential Revision: https://reviews.llvm.org/D139822
clang/lib/Driver/ToolChains/BareMetal.cpp
clang/test/Driver/baremetal.cpp