fix(llvm,llvm20): add azurelinux-specific triple to clang default fallback list#17607
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the Azure Linux llvm and llvm20 components to ensure clang can discover GCC installs under Azure Linux’s vendor triple ({arch}-azurelinux-linux) by patching clang’s GCC-install fallback triple lists and adding upstream-style driver tests.
Changes:
- Add
x86_64-azurelinux-linuxandaarch64-azurelinux-linuxto clang’s fallback triple detection inGnu.cpp. - Add clang driver tests (and minimal test sysroot inputs) to validate the fallback detection works for both x86_64 and aarch64.
- Bump rendered spec releases / lock fingerprints for both
llvmandllvm20to reflect the change.
Reviewed changes
Copilot reviewed 8 out of 10 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
base/comps/llvm/llvm.comp.toml |
Adds patch overlay + manual patch application hook for llvm. |
base/comps/llvm/0001-Clang-Add-azurelinux-to-fallback-triples.patch |
Carries clang triple/test changes as a patch source. |
base/comps/llvm20/llvm20.comp.toml |
Adds the same patch overlay + manual application hook for llvm20. |
base/comps/llvm20/0001-Clang-Add-azurelinux-to-fallback-triples.patch |
Carries clang triple/test changes as a patch source for llvm20. |
specs/l/llvm/llvm.spec |
Rendered spec update: adds Patch2202, applies it, bumps release/changelog. |
specs/l/llvm/0001-Clang-Add-azurelinux-to-fallback-triples.patch |
Rendered copy of the patch under specs/. |
specs/l/llvm20/llvm20.spec |
Rendered spec update: adds Patch2202, applies it, bumps release/changelog. |
specs/l/llvm20/0001-Clang-Add-azurelinux-to-fallback-triples.patch |
Rendered copy of the patch under specs/. |
locks/llvm.lock |
Updates input fingerprint after component change. |
locks/llvm20.lock |
Updates input fingerprint after component change. |
5bdb24d to
483ddb4
Compare
| static const char *const AArch64Triples[] = { | ||
| - "aarch64-none-linux-gnu", "aarch64-redhat-linux", "aarch64-suse-linux"}; | ||
| + "aarch64-none-linux-gnu", "aarch64-redhat-linux", "aarch64-suse-linux", | ||
| + "aarch64-azurelinux-linux"}; |
There was a problem hiding this comment.
I'm not thrilled by this...as the comment just a few lines above says, "Please don't add more elements to *Triples". But digging into how to avoid this ourselves probably isn't appropriate or worth the time (trying to get upstream to fix the need for this hardcoded list is the right way to avoid this).
So this looks ok to me.
There was a problem hiding this comment.
Agree, though options are limited. I do think that the Fedora change https://src.fedoraproject.org/rpms/llvm/c/879a14ed99a04dbfca4e3c3c57abb33b61e1a3dc?branch=rawhide will mostly obviate the need for this as it will install the config files that have these triples with clang-libs rather than clang. But this fallback is probably good to have anyway.
FWIW, I've also submitted a PR to LLVM: llvm/llvm-project#200894, but not traction thus far (and as the you suggest, based on the comment, I wouldn't be surprised if they reject it).
Summary
Add
x86_64-azurelinux-linuxandaarch64-azurelinux-linuxto clang's GCC installation fallback triple list inGnu.cpp. This allows clang-based tools (clang-tidy, clang++, etc.) to discover GCC headers installed under the Azure Linux vendor-specific triple without requiring explicit--gcc-toolchainor-isystemflags.Problem
clang's GCC installation detector searches a hardcoded list of vendor triples when locating the system GCC. Azure Linux uses
{arch}-azurelinux-linuxas its vendor triple (visible in/usr/lib/gcc/x86_64-azurelinux-linux/), but this wasn't in clang's fallback list. As a result, clang-tidy and other tools failed to find<cstdio>and other libstdc++ headers, causing%checkfailures in packages like meson that run clang-tidy during their test suites.Fixes: Bug #20333 —
[Nightly Break] meson: %check fails - clang-tidy unit tests cannot find <cstdio>Related: Bug #20284, Bug #20324 (ROCm/clang toolchain gap — same root cause)
Testing
llvmandllvm20built successfully on ControlTowermesonbuilt successfully (including%check) with the updated llvm in the local buildrootclang/test/Driver/linux-ld.cChanges