Skip to content

fix(llvm,llvm20): add azurelinux-specific triple to clang default fallback list#17607

Open
tobiasb-ms wants to merge 2 commits into
4.0from
tobiasb-ms/add-azurelinux-to-llvm-triples
Open

fix(llvm,llvm20): add azurelinux-specific triple to clang default fallback list#17607
tobiasb-ms wants to merge 2 commits into
4.0from
tobiasb-ms/add-azurelinux-to-llvm-triples

Conversation

@tobiasb-ms
Copy link
Copy Markdown
Contributor

Summary

Add x86_64-azurelinux-linux and aarch64-azurelinux-linux to clang's GCC installation fallback triple list in Gnu.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-toolchain or -isystem flags.

Problem

clang's GCC installation detector searches a hardcoded list of vendor triples when locating the system GCC. Azure Linux uses {arch}-azurelinux-linux as 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 %check failures 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

  • Both llvm and llvm20 built successfully on ControlTower
  • meson built successfully (including %check) with the updated llvm in the local buildroot
  • Patch includes upstream-style test cases in clang/test/Driver/linux-ld.c

Changes

  • llvm (21.x): add patch, bump release
  • llvm20: add same patch, bump release

Copilot AI review requested due to automatic review settings June 2, 2026 19:14
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-linux and aarch64-azurelinux-linux to clang’s fallback triple detection in Gnu.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 llvm and llvm20 to 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.

Comment thread base/comps/llvm/llvm.comp.toml Outdated
Comment thread base/comps/llvm20/llvm20.comp.toml Outdated
Comment thread specs/l/llvm/llvm.spec Outdated
Comment thread specs/l/llvm20/llvm20.spec Outdated
Comment thread specs/l/llvm/llvm.spec Outdated
Comment thread specs/l/llvm20/llvm20.spec Outdated
@tobiasb-ms tobiasb-ms marked this pull request as draft June 2, 2026 21:51
@tobiasb-ms tobiasb-ms force-pushed the tobiasb-ms/add-azurelinux-to-llvm-triples branch from 5bdb24d to 483ddb4 Compare June 3, 2026 15:51
@tobiasb-ms tobiasb-ms marked this pull request as ready for review June 3, 2026 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants