[clang] [Clang][Driver] Fix the missing Target-Triple-Level include path resolution in Baremetal Driver (PR #165321)

Petr Hosek via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 19 22:55:50 PST 2025


petrhosek wrote:

> > support Target Triple–specific include paths in the bare-metal driver
> 
> In this patch, the target-triple–specific header path is added only if the corresponding directory exists on the host system. Since the LLVM test environment doesn’t include such a layout, it’s not possible to test this behaviour purely within clang/test/Driver using the in-tree setup.

The way we typically handle that is by constructing the artificial directory layout in https://github.com/llvm/llvm-project/tree/main/clang/test/Driver/Inputs for testing, see for example https://github.com/llvm/llvm-project/tree/main/clang/test/Driver/Inputs/basic_baremetal_tree.

> Separately, I have an alternate patch that adds support for target-triple-specific include paths in the bare-metal driver via multilib.yaml configuration, #146651 . That approach is what our team prefers, and in that case I was able to include appropriate driver tests, as the include paths are conditionally added based on entries available in the multilib.yaml file. Would you like to take a look at that patch too?

Sure, but I'd like to merge this change as well since we have customers who don't use `multilib.yaml` and asked for this change.

https://github.com/llvm/llvm-project/pull/165321


More information about the cfe-commits mailing list