[PATCH] D134337: [clang] [Driver] More flexible rules for loading default configs (WIP)

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 26 10:40:52 PDT 2022


MaskRay added a comment.

In D134337#3815412 <https://reviews.llvm.org/D134337#3815412>, @mgorny wrote:

> In D134337#3815339 <https://reviews.llvm.org/D134337#3815339>, @sepavloff wrote:
>
>> In D134337#3805368 <https://reviews.llvm.org/D134337#3805368>, @mgorny wrote:
>>
>>> For target, it will try:
>>>
>>> 1. `i386.cfg` (effective triple)
>>> 2. `i386-pc-linux-gnu.cfg` ("fixed" prefix)
>>> 3. `x86_64-pc-linux-gnu.cfg` (orig. prefix)
>>
>> Does it mean that `i386.cfg` would be tried before `i386-pc-linux-gnu.cfg`? It looks more natural to try specific variant first then generic. File `x86_64.cfg` is not used in this algorithm, what is the reason for this?
>
> Yes but this is only because the example explicitly passes `-target i386`, i.e. incompletely triple. If you passed `-target i386-pc-linux-gnu`, then it would try that one instead. Perhaps I should try and see what triple normalization does here.

Trying just `i386.cfg` for `x86_64-pc-linux-gnu-clang --target=i386` makes sense to me. Trying `x86_64*.cfg` seems inappropriate.
I do not recommend `i386-pc-linux-gnu.cfg` since `--target=` is as if completely ignoring the executable prefix.


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

https://reviews.llvm.org/D134337



More information about the cfe-commits mailing list