all-patches/gcc: scope libsanitizer-musl-compat patch to gcc 11+#2161
Merged
Conversation
The patch targets libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
but in gcc 8.x that file is sanitizer_platform_limits_posix.cc (the .cc -> .cpp
rename happened in gcc 11). Buildroot applies patches from
$(BR2_GLOBAL_PATCH_DIR)/gcc/<version>/ AND $(BR2_GLOBAL_PATCH_DIR)/gcc/
additively, so the patch in the unversioned gcc/ dir was applied to all
gcc versions including 8.4.0, causing host-gcc-{initial,final}-8.4.0 to
fail patching for every platform that selects BR2_GCC_VERSION_LEGACY
(gk7102/gk7102s/gk7202v300/gk7205v*/gk7605v100, gm8135/gm8136, xm510, ...).
The failure stayed latent because the toolchain workflow's wget --spider
skip-check kept reusing the pre-patch (Feb 2025) tarballs; a full
release-asset wipe exposed it on the next dispatch.
Move the patch from the unversioned dir into the three modern-gcc
subdirs (11.4.0/, 12.4.0/, 13.3.0/). gcc 8.4.0 doesn't need it — those
platforms have built libsanitizer on musl fine without it for years.
3 tasks
widgetii
added a commit
that referenced
this pull request
May 30, 2026
Remove the explicit "# Legacy" three-line block (BR2_TOOLCHAIN_EXTERNAL_GCC_8=y +
BR2_GCC_VERSION_LEGACY=y) from all defconfigs that still carried it:
Goke (11): gk7102, gk7102s, gk7202v300_{lite,ultimate},
gk7205v200_{lite,original,ultimate}, gk7205v210_lite,
gk7205v300_{lite,ultimate}, gk7605v100_lite
Grainmedia (2): gm8135_lite, gm8136_lite
Novatek (2): nt98562_lite, nt98566_lite
Xiongmai (3): xm510_lite, xm530_lite, xm550_lite
Without an explicit pin these defconfigs fall through to
BR2_GCC_VERSION_13_X (Buildroot 2024.02.10 default per
general/package/gcc/Config.in.host), so the cross-toolchains rebuild
with gcc 13.3.0 instead of 8.4.0.
All 18 platforms are ARM (arm1176jzf_s through later Cortex-A cores)
and supported by gcc 13's musl/libsanitizer code paths — the recently
scoped libsanitizer-musl-compat patch (#2161) now applies as expected.
The legacy pin originated in #1726 ("Set legacy GCC version for Goke",
2023) but the rationale has dissolved as upstream gcc/musl/libsanitizer
caught up.
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.
Summary
Move `general/package/all-patches/gcc/0001-libsanitizer-musl-compat.patch` into version-specific subdirs for gcc 11.4.0, 12.4.0, and 13.3.0 so it is no longer applied to gcc 8.4.0.
Root cause
The patch targets `libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp`, but in gcc 8.x that file is still named `sanitizer_platform_limits_posix.cc` (the `.cc` → `.cpp` rename happened upstream in gcc 11). Buildroot's `BR2_GLOBAL_PATCH_DIR` mechanism applies patches from BOTH `gcc//` AND the unversioned `gcc/` dir additively — so the patch in the unversioned dir was being applied to all gcc versions including 8.4.0, where it could not find its target file:
```
Impact (latent until full-rebuild was forced)
Every platform that selects `BR2_GCC_VERSION_LEGACY=y` (gcc 8.4.0) has been silently broken since the patch landed:
The toolchain workflow's `wget --spider` skip-check kept reusing the pre-patch (Feb 2025) tarballs in the `toolchain` release, so the bug stayed latent. The recent full asset-wipe (intentional, to re-roll all toolchains after the libevent update) exposed it on the next dispatch — visible in run #26643453022 as failures on gk7102_lite, gk7205v200_lite, xm510_lite (and counting — more gcc 8.4 platforms still in flight at time of filing).
Fix
Move the patch from `gcc/` into version-specific subdirs `gcc/11.4.0/`, `gcc/12.4.0/`, `gcc/13.3.0/`. gcc 8.4.0 does not need it — those platforms have built libsanitizer on musl for years without this patch in place.
Test plan