[llvm] [TargetParser] Normalize "aarch64-amazon-linux" to "aarch64-amazon-linux-gnu" (PR #140070)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 20 10:00:03 PDT 2025


MaskRay wrote:

> > Do we need this customization?
> 
> In short, yes.
> 
> > Can we say that the user must use `--target=aarch64-amazon-linux-gnu` instead of `--target=aarch64-amazon-linux`? When we build LLVM on Amazon Linux, we will need to ensure the auto-detected LLVM_DEFAULT_TARGET_TRIPLE has the -gnu suffix, or require that the user must specify it like some musl-based distributions
> 
> I tired that and I can confirm that this is not the solution. We've been through this several times already, e.g. [#136114 (comment)](https://github.com/llvm/llvm-project/pull/136114#discussion_r2081379364)
> 
> > > Should we be consistent and also add x86_64-amazon-linux-gnu -> x86_64-amazon-linux ?
> 
> > The x86 case is already supported (added a test to show that), as this normalization is just looking for Amazon Linux.
> 
> If this can't be resolved for AArch64, then I will raise the necessity for reverting such normalization. We are facing somewhat more serious issue here and to restore LLVM's consistency (and neutrality!) such step may be necessary.
> 
> > To pick up the GCC installation, Amazon Linux can install a Clang configuration file to specify --gcc-triple=x86_64-amazon-linux.
> 
> This will not restore LLVM's consistency (and neutrality!).

Sorry for the late response. I've now looked at other changes you've made.  Why do we want to use aarch64-amazon-linux instead of aarch64-unknown-linux-gnu? If the only issue is that clang cannot pick up `lib/gcc/aarch64-amazon-linux`, you can specify a config file for `--gcc-triple=aarch64-amazon-linux`. In LLVM, we can just use `aarch64-unknown-linux-gnu` and we don't need to update TargetParser/config.guess at all.

```
// libcxx/test/std/re/re.alg/re.alg.search/awk.locale.pass.cpp
// XFAIL: target={{.*}}-amazon-linux{{.*}}
```

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


More information about the llvm-commits mailing list