[PATCH] D109621: [clang] [Driver] Fall back to default.cfg when calling clang w/o prefix

Michał Górny via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 19 03:30:14 PDT 2022


mgorny added a comment.

In D109621#3799133 <https://reviews.llvm.org/D109621#3799133>, @sepavloff wrote:

> In D109621#3791511 <https://reviews.llvm.org/D109621#3791511>, @mstorsjo wrote:
>
>> On this topic, it would be great if we could pick up a per-target default config file too, if clang is invoked with `clang -target <triple>`. Currently this is done automatically if clang is invoked as `<triple>-clang`, but not with an explicit `-target` parameter.
>
> Would enabling config files in such invocations be a solution for your use case?

Not really, we don't strictly need per-target config files at the moment. There might be some use for them in the future but right now our most dire need is to be able to ensure that our config file is included in all invocations (except for explicit `--no-default-config`).

With this patch, this is handled by having files for all installed prefixes + `default*` for unprefixed executables.

I suppose an alternative option would be to do a major refactoring to support a wider range of naming variants with fallbacks. Would you prefer if I tried to do that?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109621/new/

https://reviews.llvm.org/D109621



More information about the cfe-commits mailing list