If clang is part of a toolchain that can locate clang_rt libraries
outside its resource directory and these are built with
LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON then the tests would fail because
the library names don't have the arch suffix. This change makes the arch
suffix optional.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I missed this change so I apologize for late response, but can you elaborate on why this is needed? Clang first checks the name without architecture and if the file doesn't exist then it'll return the one with architecture unconditionally, see https://github.com/llvm/llvm-project/blob/d61a863050bb4afd22d08bbe53af1e24c0657aba/clang/lib/Driver/ToolChain.cpp#L545. Since there are no files inside https://github.com/llvm/llvm-project/tree/main/clang/test/Driver/Inputs/resource_dir_with_arch_subdir/lib/linux/arm, it should always return the path with architecture as was the case for the previous version. LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON should play no role here since Clang tests are hermetic (as in they don't rely on runtimes being built).
Hi Petr,
In LLVM Embedded Toolchain for Arm we put libclang_rt in the regular library directory, not the resource dir. Therefore -resource-dir has no effect for us.
Instead of this change, I could have added a --sysroot argument to each test, but this change seemed to fit well with the discussion in https://discourse.llvm.org/t/rfc-time-to-drop-legacy-runtime-paths/64628.
I'm happy to revert this and add --sysroot if you prefer. That would fit with keeping the tests hermetic.