toolchain: gcc: add initial support for GCC 16.1#23194
Conversation
openwrt-ai
left a comment
There was a problem hiding this comment.
Commit checks
- d7a2738 "CI: DROP ME!!!!!!!!!!!!!!!!!!!!!!!!!!!!" — author-flagged placeholder; the commit body says "Please remove this commit before merging." Drop it (and rebase) before this PR is mergeable.
To address review feedback, force-push fixes to this branch. Don't close and open a new PR — that loses the review history and the bot starts from scratch.
Generated by Claude Code
| default "16.1.0" if GCC_VERSION_16 | ||
| default "16.1.0" |
There was a problem hiding this comment.
When GCC_USE_VERSION_14 is selected, GCC_VERSION now resolves to "16.1.0" instead of "14.3.0": there's no config GCC_VERSION_14 symbol and no explicit default "14.3.0" if GCC_VERSION_14, so a GCC 14 selection falls past every conditional and lands on the unconditional "16.1.0" default that replaced the old "14.3.0" fallback. The gcc 14.x choice in Config.in is still selectable, so this silently mis-versions GCC 14 builds.
Separately, default "16.1.0" if GCC_VERSION_16 immediately followed by an unconditional default "16.1.0" is redundant — the unconditional line already covers the same case.
Related, default y if !TOOLCHAINOPTS || GCC_USE_VERSION_14 at Config.version:28 is not updated by this PR: GCC_USE_DEFAULT_VERSION (which implys KERNEL_WERROR) is still keyed off GCC 14, so building with the new default GCC 16 no longer implies KERNEL_WERROR. It should reference GCC_USE_VERSION_16.
A self-consistent fix is to add a config GCC_VERSION_14 block and an explicit default "14.3.0" if GCC_VERSION_14, drop the redundant default "16.1.0" if GCC_VERSION_16 (keeping only the unconditional fallback as the marker of the current default version, matching the prior style), and update GCC_USE_DEFAULT_VERSION to key off GCC_USE_VERSION_16.
Generated by Claude Code
|
I would take a look in next days or so (I've finally got GCC 16.1 as host compiler). |
Release Notes: https://gcc.gnu.org/gcc-16/changes.html Add GCC 16.1 relevant configs and copy patches from patches-15.x. Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Removed upstreamed: 004-libcody-Make-it-buildable-by-C-11-to-C-26.patch [1] 980-fix-build-error-with-Xcode-16.3.patch [2] [1] https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=07a767c7a50d1daae8ef7d4aba73fe53ad40c0b7 [2] https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=7a79219383c83c71cc9751c0d72830428fac0db0 Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
openwrt-ai
left a comment
There was a problem hiding this comment.
Re-reviewed against 684e5ca after the force-push. The "CI: DROP ME" commit flagged previously was rebased away and replaced with 684e5ca ("refresh GCC 16.1 patches"); thanks for cleaning that up.
I want to retract my prior comment on toolchain/gcc/Config.version — I misread the kconfig flow. With GCC_USE_VERSION_14 selected, none of the if GCC_VERSION_* defaults match, so GCC_VERSION correctly falls through to the unconditional "14.3.0". That is the project's existing convention for "the current default has no explicit GCC_VERSION_N symbol" (see the same shape at Config.version pre-PR), and keeping GCC_USE_DEFAULT_VERSION keyed off GCC_USE_VERSION_14 is consistent with Config.in still defaulting the choice to GCC 14. Sorry for the noise.
The patch refresh in 684e5ca looks like a mechanical line-number update to match GCC 16.1's upstream context, and the two removals (004-libcody-*, 980-fix-build-error-with-Xcode-16.3) are plausibly upstreamed per the SHAs cited in the commit body. PR is still marked draft with the author's -mips16 question outstanding, so no further blocking comments from me.
To address review feedback, force-push fixes to this branch. Don't close and open a new PR — that loses the review history and the bot starts from scratch.
Generated by Claude Code
|
Hey @DragonBluep, i was able to boot with this change set, thank you very much! Packages Patch for Patch for Build system: I'll be daily-driving it from today 😄 |
|
Here is a hacky workaround: |
|
@graysky2 I'll bump glibc to recent HEAD in next couple of days. This may or may not help of course. |
|
@rockdrilla - this is a good idea as our glibc is pretty old: #23467 but still hitting the error |
@DragonBluep - I think I solved the build error. Created DragonBluep#2 |
#23468 makes that patch unnecessary. |
Patches rebased: - 003-libintl-compatibility.patch - 005-build_only_libs.patch - 006-Fix-build-on-aarch64-musl.patch - 007-add-libeu-symbols-to-libelf.patch - 101-no-fts.patch Patches removed due being upstreamed: - 008-fix-autoconf-ENABLE_IMA_VERIFICATION.patch - 009-fix-null-dereference-with-lto.patch - 101-no-fts.patch Note that this release is needed in order to build against GCC 16.1 openwrt#23194 Release notes from 0.192 to 0.195: https://inbox.sourceware.org/elfutils-devel/CAJDtP-RjuT13zehLgSvz9TnwQZ1VYPOS=q_kuut5a2g+KLamgw@mail.gmail.com/T/ https://inbox.sourceware.org/elfutils-devel/CAJDtP-S0rYAOZQeDZvMtPkQztgK9RboWtYwpqNLCNGNdaSGn-A@mail.gmail.com/T/ https://inbox.sourceware.org/elfutils-devel/CAJDtP-Qok4ViNzvrr28WgkCCqrFH0iAZStiD8C7nbpDhrPzLWA@mail.gmail.com/T/ Signed-off-by: John Audia <therealgraysky@proton.me>
Patches rebased: - 003-libintl-compatibility.patch - 005-build_only_libs.patch - 006-Fix-build-on-aarch64-musl.patch - 007-add-libeu-symbols-to-libelf.patch - 101-no-fts.patch Patches removed due being upstreamed: - 008-fix-autoconf-ENABLE_IMA_VERIFICATION.patch - 009-fix-null-dereference-with-lto.patch - 101-no-fts.patch Note that this release is needed in order to build against GCC 16.1 openwrt#23194 Release notes from 0.192 to 0.195: https://inbox.sourceware.org/elfutils-devel/CAJDtP-RjuT13zehLgSvz9TnwQZ1VYPOS=q_kuut5a2g+KLamgw@mail.gmail.com/T/ https://inbox.sourceware.org/elfutils-devel/CAJDtP-S0rYAOZQeDZvMtPkQztgK9RboWtYwpqNLCNGNdaSGn-A@mail.gmail.com/T/ https://inbox.sourceware.org/elfutils-devel/CAJDtP-Qok4ViNzvrr28WgkCCqrFH0iAZStiD8C7nbpDhrPzLWA@mail.gmail.com/T/ Signed-off-by: John Audia <therealgraysky@proton.me>
GCC 16 tightens enforcement of -Wdiscarded-qualifiers, causing strchr() return values assigned to char * locals to hard-error when the input is const char *. Demote to warning until upstream fixes const correctness in handler.c. This is needed for openwrt#23194 Signed-off-by: John Audia <therealgraysky@proton.me>
GCC 16 tightens enforcement of -Wdiscarded-qualifiers, causing strpbrk() return values assigned to char * locals to hard-error when the input is const char *. Demote to warning until upstream fixes const correctness in config.c. This is needed for openwrt#23194 Signed-off-by: John Audia <therealgraysky@proton.me>
|
After applying this PR and the following PRs, I was able to build and boot into a functional image as far as I can tell, great job with this @DragonBluep! DragonBluep#2 |
Patches rebased: - 003-libintl-compatibility.patch - 005-build_only_libs.patch - 006-Fix-build-on-aarch64-musl.patch - 007-add-libeu-symbols-to-libelf.patch - 101-no-fts.patch Patches removed due being upstreamed: - 008-fix-autoconf-ENABLE_IMA_VERIFICATION.patch - 009-fix-null-dereference-with-lto.patch - 101-no-fts.patch Note that this release is needed in order to build against GCC 16.1 openwrt#23194 Release notes from 0.192 to 0.195: https://inbox.sourceware.org/elfutils-devel/CAJDtP-RjuT13zehLgSvz9TnwQZ1VYPOS=q_kuut5a2g+KLamgw@mail.gmail.com/T/ https://inbox.sourceware.org/elfutils-devel/CAJDtP-S0rYAOZQeDZvMtPkQztgK9RboWtYwpqNLCNGNdaSGn-A@mail.gmail.com/T/ https://inbox.sourceware.org/elfutils-devel/CAJDtP-Qok4ViNzvrr28WgkCCqrFH0iAZStiD8C7nbpDhrPzLWA@mail.gmail.com/T/ Signed-off-by: John Audia <therealgraysky@proton.me>
-mips16option doesn't take effect on MIPS platforms, need help.