fix(llvm,llvm20): correct clang's default GCC triple for Azure Linux stage2#17100
Merged
reubeno merged 1 commit intoMay 11, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the LLVM (llvm, llvm20) packaging to fix Azure Linux stage2 bootstrap/self-rebuild failures caused by clang’s default GCC triple pointing at the wrong vendor runtime path.
Changes:
- Update clang/clang20 default config generation to use
%{_target_cpu}-%{_vendor}-linuxinstead of*-redhat-linux. - Add stage2 bootstrap workarounds (temporary
/tmpclang config injection and a PGO perf-training clang wrapper) to force the corrected GCC triple during the self-rebuild. - Disable
%checkby default for llvm/llvm20 and regenerate rendered specs/macros + refresh lock fingerprints.
Reviewed changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| specs/l/llvm/llvm.spec | Rendered spec updated: corrected gcc triple in clang config, added bootstrap config injection + PGO wrapper, default %check disabled. |
| specs/l/llvm/llvm.azl.macros | Generated azldev macros updated to include %_without_check 1. |
| specs/l/llvm20/llvm20.spec | Rendered spec updated: adds macros load/source, corrected gcc triple in clang20 config, adds bootstrap config injection + PGO wrapper, default %check disabled. |
| specs/l/llvm20/llvm20.azl.macros | New generated azldev macros file (disables check + mlir by default). |
| base/comps/llvm/llvm.comp.toml | Component config adds overlays/workarounds for gcc triple + bootstrap/PGO wrapper; disables check/mlir via build.without. |
| base/comps/llvm20/llvm20.comp.toml | New component config for llvm20 with the same overlays/workarounds; disables check/mlir via build.without. |
| base/comps/components.toml | Removes inline [components.llvm20] entry now that llvm20 has a dedicated .comp.toml. |
| locks/llvm.lock | Updates input fingerprint to match component config changes. |
| locks/llvm20.lock | Updates input fingerprint to match new component config + overlays. |
12 tasks
reubeno
reviewed
May 8, 2026
Clang's generated default config used the Fedora/RHEL GCC runtime triple
`%{_target_cpu}-redhat-linux`, but Azure Linux stage2 provides GCC runtime
files under `%{_target_cpu}-%{_vendor}-linux`. That made clang look in the
wrong GCC tree for crtbegin/crtend and libgcc when linking packages in
stage2 builds.
Update llvm and llvm20 to generate clang config files with the Azure Linux
vendor triple. Add bootstrap config injection during the self-rebuild so
the existing broken in-chroot clang is overridden while rebuilding LLVM,
and wrap the PGO instrumented clang so perf training uses the corrected
triple as well.
For llvm20, apply the same bootstrap path because compat builds pin the
host compiler major version to 20 and therefore still rely on the broken
stage2 clang20 during self-rebuilds.
Keep check disabling controlled by `build.without = ["mlir", "check"]`
only; this generates the azldev macro `%_without_check 1`, so no bcond
overlay is needed. Move the bootstrap config under `%{_builddir}` and use
an EXIT trap to restore the PGO clang wrapper safely if generate-profdata
fails.
Validated with:
azldev comp build -p llvm -p llvm20 --preserve-buildenv on-failure -q
Also smoke-tested the rebuilt clang and clang20 RPMs in the stage2 mock:
both select the Azure Linux GCC runtime path and compile/link a trivial C
program successfully.
7e1693b to
567230a
Compare
reubeno
approved these changes
May 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Merge Checklist
All boxes should be checked before merging the PR (just tick any boxes which don't apply to this PR)
*-staticsubpackages, etc.) have had theirReleasetag incremented../cgmanifest.json,./toolkit/scripts/toolchain/cgmanifest.json,.github/workflows/cgmanifest.json)./LICENSES-AND-NOTICES/SPECS/data/licenses.json,./LICENSES-AND-NOTICES/SPECS/LICENSES-MAP.md,./LICENSES-AND-NOTICES/SPECS/LICENSE-EXCEPTIONS.PHOTON)*.signatures.jsonfilessudo make go-tidy-allandsudo make go-test-coveragepassSummary
Fix clang/clang20 stage2 bootstrap failures caused by clang’s generated default GCC triple pointing at the Fedora/RHEL-style runtime path.
Both
llvmandllvm20generate clang config files containing:--gcc-triple=%{_target_cpu}-redhat-linux
In Azure Linux stage2, GCC runtime files are installed under the Azure Linux vendor triple instead:
/usr/lib/gcc/%{_target_cpu}-%{_vendor}-linux/
This mismatch causes clang-driven links to fail when looking for crtbeginS.o, libgcc, and libgcc_s. That affects both the primary LLVM toolchain and the llvm20 compatibility toolchain during
stage2/self-bootstrap builds, and can also break downstream packages that link through clang.
This change updates both llvm and llvm20 to:
The %build bootstrap config injection and PGO clang wrapper are intended as temporary workarounds. The plan is to remove them once stage2 reaches a stable state where a usable clang with the corrected default config is already available in the buildroot.
Change Log
Associated issues
Test Methodology
Validated both llvm and llvm20 through Koji stage2 builds.
Both Koji builds completed successfully and produced the expected clang/LLVM/lld RPMs.