Skip to content

toolchain: gcc: add initial support for GCC 16.2 - #23194

Draft
DragonBluep wants to merge 2 commits into
openwrt:mainfrom
DragonBluep:gcc-16.1
Draft

toolchain: gcc: add initial support for GCC 16.2#23194
DragonBluep wants to merge 2 commits into
openwrt:mainfrom
DragonBluep:gcc-16.1

Conversation

@DragonBluep

@DragonBluep DragonBluep commented May 2, 2026

Copy link
Copy Markdown
Contributor
  • It seems that -mips16 option doesn't take effect on MIPS platforms, need help.

@github-actions github-actions Bot added the toolchain pull request/issue with toolchain related changes label May 2, 2026

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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

Comment thread toolchain/gcc/Config.version Outdated
Comment on lines +23 to +24
default "16.1.0" if GCC_VERSION_16
default "16.1.0"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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

@rockdrilla

Copy link
Copy Markdown
Contributor

I would take a look in next days or so (I've finally got GCC 16.1 as host compiler).

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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

@Jebaitedneko

Jebaitedneko commented May 17, 2026

Copy link
Copy Markdown

Hey @DragonBluep, i was able to boot with this change set, thank you very much!

Packages ppp and elfutils needed patches for satisfying LTO
Other than that, everything went well 🎉

Patch for ppp: Jebaitedneko@fa19b91
I'm not sure if this is the right approach, but ppp is functioning well with this change

Patch for elfutils: Jebaitedneko@bcd61e5 (taken from upstream)

Build system: x86/64
Target: mediatek/filogic
Device: dlink_aquila-pro-ai-m30-a1
Kernel Log
Build Config
Build Config (diff)

I'll be daily-driving it from today 😄

@graysky2

graysky2 commented May 20, 2026

Copy link
Copy Markdown
Contributor

Here is a hacky workaround:

--- a/scripts/patch-specs.sh
+++ b/scripts/patch-specs.sh
@@ -27,15 +27,18 @@ fi
 
 patch_specs() {
 	local found=0
+	local has_libatomic=0
+	find "$DIR" -name "libatomic.so*" -o -name "libatomic.a" 2>/dev/null | grep -q . && has_libatomic=1
 
 	for lib in $(STAGING_DIR="$DIR" "$CPP" -x c -v /dev/null 2>&1 | sed -ne 's#:# #g; s#^LIBRARY_PATH=##p'); do
 		if [ -d "$lib" ]; then
 			grep -qs "STAGING_DIR" "$lib/specs" && rm -f "$lib/specs"
 			if [ $found -lt 1 ]; then
 				echo -n "Patching specs ... "
-				STAGING_DIR="$DIR" "$CPP" -dumpspecs | awk '
+				STAGING_DIR="$DIR" "$CPP" -dumpspecs | awk -v has_libatomic="$has_libatomic" '
 					mode ~ "link" {
 						sub(/(%@?\{L.\})/, "& -L %:getenv(STAGING_DIR /usr/lib) -rpath-link %:getenv(STAGING_DIR /usr/lib)")
+						if (!has_libatomic) gsub(/-latomic_asneeded/, "")
 					}
 					mode ~ "cpp" {
 						$0 = $0 " -idirafter %:getenv(STAGING_DIR /usr/include)"

@rockdrilla

Copy link
Copy Markdown
Contributor

@graysky2 I'll bump glibc to recent HEAD in next couple of days. This may or may not help of course.

@graysky2

Copy link
Copy Markdown
Contributor

@rockdrilla - this is a good idea as our glibc is pretty old: #23467 but still hitting the error

@graysky2

graysky2 commented May 21, 2026

Copy link
Copy Markdown
Contributor

I'm attempting to build x86/64-glibc but I'm running into some problems.

@DragonBluep - I think I solved the build error. Created DragonBluep#2

@graysky2

Copy link
Copy Markdown
Contributor

@Jebaitedneko -

Patch for elfutils: Jebaitedneko@bcd61e5 (taken from upstream)

#23468 makes that patch unnecessary.

hardfalcon pushed a commit to hardfalcon/openwrt that referenced this pull request May 22, 2026
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>
hardfalcon pushed a commit to hardfalcon/openwrt that referenced this pull request May 22, 2026
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>
graysky2 added a commit to graysky2/openwrt that referenced this pull request May 22, 2026
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>
graysky2 added a commit to graysky2/openwrt that referenced this pull request May 22, 2026
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>
@graysky2

graysky2 commented May 22, 2026

Copy link
Copy Markdown
Contributor

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!

Build system: x86/64
Build-tested: x86/64-glibc
Run-tested: x86/64-glibc
% dmesg|grep -i gcc
[    0.000000] Linux version 6.18.32 (squish@redline) (x86_64-openwrt-linux-gnu-gcc (OpenWrt GCC 16.1.0 r34553+41-74da669505b0) 16.1.0, GNU ld (GNU Binutils) 2.46.0.20260210) #0 SMP Fri May 22 16:17:08 2026

DragonBluep#2
#23467
#23468
#23469
#23470
openwrt/packages#29518

hardfalcon pushed a commit to hardfalcon/openwrt that referenced this pull request May 23, 2026
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>
hardfalcon pushed a commit to hardfalcon/openwrt that referenced this pull request May 25, 2026
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>
hardfalcon pushed a commit to hardfalcon/openwrt that referenced this pull request May 25, 2026
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>
graysky2 added a commit to graysky2/packages that referenced this pull request May 25, 2026
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/openwrt#23194

Signed-off-by: John Audia <therealgraysky@proton.me>
graysky2 added a commit to graysky2/openwrt that referenced this pull request May 26, 2026
Add pending openwrt/netifd#82

This is needed for openwrt#23194

Signed-off-by: John Audia <therealgraysky@proton.me>
graysky2 added a commit to graysky2/openwrt that referenced this pull request May 26, 2026
Add pending openwrt/odhcp6c#158

This is needed for openwrt#23194

Signed-off-by: John Audia <therealgraysky@proton.me>
graysky2 added a commit to graysky2/packages that referenced this pull request May 26, 2026
Add pending https://github.com/jow-/nlbwmon/pull/75

This is needed for: openwrt/openwrt#23194

Signed-off-by: John Audia <therealgraysky@proton.me>
BKPepe pushed a commit to openwrt/packages that referenced this pull request May 27, 2026
Add pending https://github.com/jow-/nlbwmon/pull/75

This is needed for: openwrt/openwrt#23194

Signed-off-by: John Audia <therealgraysky@proton.me>
hardfalcon pushed a commit to hardfalcon/openwrt that referenced this pull request Jun 1, 2026
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>
hardfalcon pushed a commit to hardfalcon/openwrt that referenced this pull request Jun 1, 2026
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>

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed 2 new commits; no new issues found.

The branch was rebased since my last review at 684e5ca, so the head is now 7f53b6e ("add initial support for GCC 16.1") + af95e63 ("refresh GCC 16.1 patches"). Both commit messages match their diffs. The patches-16.x set is identical to the current patches-15.x set except for 980-fix-build-error-with-Xcode-16.3.patch, which af95e63 drops as upstreamed in gcc-16.1.0 (matching the commit body). The refresh itself is a mechanical hunk-offset/whitespace update consistent with make target/linux/refresh-style regeneration. PR remains draft with the author's outstanding -mips16 question, so no blocking comments.


Generated by Claude Code

hardfalcon pushed a commit to hardfalcon/openwrt that referenced this pull request Jul 3, 2026
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>
hardfalcon pushed a commit to hardfalcon/openwrt that referenced this pull request Jul 3, 2026
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>
hardfalcon pushed a commit to hardfalcon/openwrt that referenced this pull request Jul 28, 2026
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>
hardfalcon pushed a commit to hardfalcon/openwrt that referenced this pull request Jul 28, 2026
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>
hardfalcon pushed a commit to hardfalcon/openwrt that referenced this pull request Jul 29, 2026
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>
hardfalcon pushed a commit to hardfalcon/openwrt that referenced this pull request Jul 29, 2026
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>
hardfalcon pushed a commit to hardfalcon/openwrt that referenced this pull request Aug 1, 2026
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>
hardfalcon pushed a commit to hardfalcon/openwrt that referenced this pull request Aug 2, 2026
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>
@graysky2

graysky2 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

I went ahead and rebased the PR in your repo @DragonBluep. It's still required in order to have the build complete successfully.

Changelog:
  https://gcc.gnu.org/gcc-16/changes.html

Add GCC 16.2 relevant configs and copy patches from patches-15.x.

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Remove upstreamed patch:
- 980-fix-build-error-with-Xcode-16.3.patch[1]

[1] https://gcc.gnu.org/cgit/gcc/commit/?h=releases/gcc-16.2.0&id=7a79219383c83c71cc9751c0d72830428fac0db0
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
@openwrt

openwrt Bot commented Aug 7, 2026

Copy link
Copy Markdown

Formality Check: Suggestions Available

We checked this pull request against the contribution guidelines. Here is what needs your attention:

⚠️ STYLISTIC WARNINGS & SUGGESTIONS

Commit 6d17a1d - toolchain: gcc: add initial support for GCC 16.2:

  • ⚠️ - Embedded patch file 'toolchain/gcc/patches-16.x/002-case_insensitive.patch' violates standard guidelines. Missing required Git header parameters ('From Mon Sep 17 00:00:00 2001' / 'From:' / 'Date:' / 'Subject:') to ensure 'git am' application compatibility
  • ⚠️ - Embedded patch file 'toolchain/gcc/patches-16.x/003-dont-choke-when-building-32bit-on-64bit.patch' violates standard guidelines. Missing required Git header parameters ('From Mon Sep 17 00:00:00 2001' / 'From:' / 'Date:' / 'Subject:') to ensure 'git am' application compatibility
  • ⚠️ - Embedded patch file 'toolchain/gcc/patches-16.x/010-documentation.patch' violates standard guidelines. Missing required Git header parameters ('From Mon Sep 17 00:00:00 2001' / 'From:' / 'Date:' / 'Subject:') to ensure 'git am' application compatibility
  • ⚠️ - Embedded patch file 'toolchain/gcc/patches-16.x/230-musl_libssp.patch' violates standard guidelines. Missing required Git header parameters ('From Mon Sep 17 00:00:00 2001' / 'From:' / 'Date:' / 'Subject:') to ensure 'git am' application compatibility
  • ⚠️ - Embedded patch file 'toolchain/gcc/patches-16.x/300-mips_Os_cpu_rtx_cost_model.patch' violates standard guidelines. Missing required Git header parameters ('From Mon Sep 17 00:00:00 2001' / 'From:' / 'Date:' / 'Subject:') to ensure 'git am' application compatibility
  • ⚠️ - Embedded patch file 'toolchain/gcc/patches-16.x/800-arm_v5te_no_ldrd_strd.patch' violates standard guidelines. Missing required Git header parameters ('From Mon Sep 17 00:00:00 2001' / 'From:' / 'Date:' / 'Subject:') to ensure 'git am' application compatibility
  • ⚠️ - Embedded patch file 'toolchain/gcc/patches-16.x/810-arm-softfloat-libgcc.patch' violates standard guidelines. Missing required Git header parameters ('From Mon Sep 17 00:00:00 2001' / 'From:' / 'Date:' / 'Subject:') to ensure 'git am' application compatibility
  • ⚠️ - Embedded patch file 'toolchain/gcc/patches-16.x/820-libgcc_pic.patch' violates standard guidelines. Missing required Git header parameters ('From Mon Sep 17 00:00:00 2001' / 'From:' / 'Date:' / 'Subject:') to ensure 'git am' application compatibility
  • ⚠️ - Embedded patch file 'toolchain/gcc/patches-16.x/830-aarch64-libatomic.patch' violates standard guidelines. Missing required Git header parameters ('From Mon Sep 17 00:00:00 2001' / 'From:' / 'Date:' / 'Subject:') to ensure 'git am' application compatibility
  • ⚠️ - Embedded patch file 'toolchain/gcc/patches-16.x/840-armv4_pass_fix-v4bx_to_ld.patch' violates standard guidelines. Missing required Git header parameters ('From Mon Sep 17 00:00:00 2001' / 'From:' / 'Date:' / 'Subject:') to ensure 'git am' application compatibility
  • ⚠️ - Embedded patch file 'toolchain/gcc/patches-16.x/850-use_shared_libgcc.patch' violates standard guidelines. Missing required Git header parameters ('From Mon Sep 17 00:00:00 2001' / 'From:' / 'Date:' / 'Subject:') to ensure 'git am' application compatibility
  • ⚠️ - Embedded patch file 'toolchain/gcc/patches-16.x/851-libgcc_no_compat.patch' violates standard guidelines. Missing required Git header parameters ('From Mon Sep 17 00:00:00 2001' / 'From:' / 'Date:' / 'Subject:') to ensure 'git am' application compatibility
  • ⚠️ - Embedded patch file 'toolchain/gcc/patches-16.x/870-ppc_no_crtsavres.patch' violates standard guidelines. Missing required Git header parameters ('From Mon Sep 17 00:00:00 2001' / 'From:' / 'Date:' / 'Subject:') to ensure 'git am' application compatibility
  • ⚠️ - Embedded patch file 'toolchain/gcc/patches-16.x/900-bad-mips16-crt.patch' violates standard guidelines. Missing required Git header parameters ('From Mon Sep 17 00:00:00 2001' / 'From:' / 'Date:' / 'Subject:') to ensure 'git am' application compatibility
  • ⚠️ - Embedded patch file 'toolchain/gcc/patches-16.x/910-mbsd_multi.patch' violates standard guidelines. Missing required Git header parameters ('From Mon Sep 17 00:00:00 2001' / 'From:' / 'Date:' / 'Subject:') to ensure 'git am' application compatibility
  • ⚠️ - Embedded patch file 'toolchain/gcc/patches-16.x/920-specs_nonfatal_getenv.patch' violates standard guidelines. Missing required Git header parameters ('From Mon Sep 17 00:00:00 2001' / 'From:' / 'Date:' / 'Subject:') to ensure 'git am' application compatibility
  • ⚠️ - Embedded patch file 'toolchain/gcc/patches-16.x/970-macos_arm64-building-fix.patch' violates standard guidelines. Missing required Git header parameters ('From Mon Sep 17 00:00:00 2001' / 'From:' / 'Date:' / 'Subject:') to ensure 'git am' application compatibility

Commit d024377 - toolchain: gcc: refresh GCC 16.2 patches:

  • ⚠️ - Embedded patch file 'toolchain/gcc/patches-16.x/010-documentation.patch' violates standard guidelines. Missing required Git header parameters ('From Mon Sep 17 00:00:00 2001' / 'From:' / 'Date:' / 'Subject:') to ensure 'git am' application compatibility
  • ⚠️ - Embedded patch file 'toolchain/gcc/patches-16.x/230-musl_libssp.patch' violates standard guidelines. Missing required Git header parameters ('From Mon Sep 17 00:00:00 2001' / 'From:' / 'Date:' / 'Subject:') to ensure 'git am' application compatibility
  • ⚠️ - Embedded patch file 'toolchain/gcc/patches-16.x/300-mips_Os_cpu_rtx_cost_model.patch' violates standard guidelines. Missing required Git header parameters ('From Mon Sep 17 00:00:00 2001' / 'From:' / 'Date:' / 'Subject:') to ensure 'git am' application compatibility
  • ⚠️ - Embedded patch file 'toolchain/gcc/patches-16.x/800-arm_v5te_no_ldrd_strd.patch' violates standard guidelines. Missing required Git header parameters ('From Mon Sep 17 00:00:00 2001' / 'From:' / 'Date:' / 'Subject:') to ensure 'git am' application compatibility
  • ⚠️ - Embedded patch file 'toolchain/gcc/patches-16.x/820-libgcc_pic.patch' violates standard guidelines. Missing required Git header parameters ('From Mon Sep 17 00:00:00 2001' / 'From:' / 'Date:' / 'Subject:') to ensure 'git am' application compatibility
  • ⚠️ - Embedded patch file 'toolchain/gcc/patches-16.x/830-aarch64-libatomic.patch' violates standard guidelines. Missing required Git header parameters ('From Mon Sep 17 00:00:00 2001' / 'From:' / 'Date:' / 'Subject:') to ensure 'git am' application compatibility
  • ⚠️ - Embedded patch file 'toolchain/gcc/patches-16.x/910-mbsd_multi.patch' violates standard guidelines. Missing required Git header parameters ('From Mon Sep 17 00:00:00 2001' / 'From:' / 'Date:' / 'Subject:') to ensure 'git am' application compatibility
  • ⚠️ - Embedded patch file 'toolchain/gcc/patches-16.x/920-specs_nonfatal_getenv.patch' violates standard guidelines. Missing required Git header parameters ('From Mon Sep 17 00:00:00 2001' / 'From:' / 'Date:' / 'Subject:') to ensure 'git am' application compatibility
  • ⚠️ - Embedded patch file 'toolchain/gcc/patches-16.x/970-macos_arm64-building-fix.patch' violates standard guidelines. Missing required Git header parameters ('From Mon Sep 17 00:00:00 2001' / 'From:' / 'Date:' / 'Subject:') to ensure 'git am' application compatibility

Something broken? Consider reporting an issue.
Running version bebd826 deployed on 2026-08-07 11:35:20 CEST

@DragonBluep

Copy link
Copy Markdown
Contributor Author

I went ahead and rebased the PR in your repo @DragonBluep. It's still required in order to have the build complete successfully.

@graysky2 GCC16.2 was released today. Please check if we still need the fix.

@DragonBluep DragonBluep changed the title toolchain: gcc: add initial support for GCC 16.1 toolchain: gcc: add initial support for GCC 16.2 Aug 7, 2026

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed 2 new commits; no new issues found.

My last review was against af95e63 (GCC 16.1); that object is no longer reachable after the force-push, so I re-reviewed the full PR diff at d024377 (GCC 16.1 → 16.2 respin).

What I checked:

  • Commit messages match their diffs. 6d17a1d adds the three config hunks and copies all 19 patches verbatim from patches-15.x (including 980-fix-build-error-with-Xcode-16.3.patch), exactly as the body says. d024377 refreshes the copies and drops 980-* as upstreamed, matching its body.
  • patches-16.x vs patches-15.x. After both commits the two directories are identical except for the dropped 980-*; every remaining delta is hunk-header/context only (010, 230, 300, 800, 820, 830, 910, 920, 970). The two non-trivial context changes both look like genuine upstream churn rather than a bad rebase: 830-aarch64-libatomic.patch picks up the new @PARTIAL_VXWORKS_FALSE@ automake conditional in libatomic/Makefile.in, and 910-mbsd_multi.patch re-anchors fhonour-copts in gcc/common.opt against the reworded fident comment block. The removed line in each case is still the intended one.
  • Kconfig/make wiring is consistent. GCC_USE_VERSION_16GCC_VERSION_16default "16.2.0", and common.mk keys PKG_HASH off the same 16.2.0; PATCH_DIR resolves to patches-16.x via GCC_MAJOR_VERSION. GCC_USE_DEFAULT_VERSION correctly stays on GCC_USE_VERSION_14, so GCC 14 remains the default and GCC_VERSION's unconditional "14.4.0" fallthrough is still right. The shape matches the GCC 15 addition in 68cb841, which touched the same three files and nothing else.
  • Host prerequisites. tools/gmp 6.3.0, tools/mpfr 4.2.2, tools/mpc 1.3.1 and tools/isl 0.28 are all comfortably above what GCC 16 requires, so no tools-side bump is implied by this PR.

Two things I could not verify from this environment, flagged only so they aren't assumed covered:

  • The 16.2.0 PKG_HASH (e6738e29…c3e) — outbound access to the GNU mirrors is blocked here, so I couldn't recompute the tarball sha256. Worth a manual confirmation, since none of the CI jobs select GCC 16 (GCC 14 is still the default), so a wrong hash would not show up as a red check.
  • The libatomic / -latomic_asneeded build break discussed above — I'm treating that as already tracked in the thread (DragonBluep#2, and your request to re-test now that 16.2 is out), not as a review finding.

CI at d024377 is still running; nothing has failed yet, so no CI-grounded comments.


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

@graysky2

graysky2 commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

@DragonBluep

@graysky2 GCC16.2 was released today. Please check if we still need the fix.

Yep, still fails:

...
/scratch/ow-build/staging_dir/toolchain-x86_64_gcc-16.2.0_glibc/x86_64-openwrt-linux-gnu/bin/ld: cannot find -latomic_asneeded: No such file or directory
collect2: error: ld returned 1 exit status
make[5]: *** [Makefile:248: /scratch/ow-build/build_dir/toolchain-x86_64_gcc-16.2.0_glibc/glibc-2.44-final/elf/sotruss-lib.so] Error 1
make[5]: Leaving directory '/scratch/ow-build/build_dir/toolchain-x86_64_gcc-16.2.0_glibc/glibc-2.44/elf'
make[4]: *** [Makefile:488: elf/subdir_lib] Error 2
make[4]: Leaving directory '/scratch/ow-build/build_dir/toolchain-x86_64_gcc-16.2.0_glibc/glibc-2.44'
make[3]: *** [Makefile:20: all] Error 2
make[3]: Leaving directory '/scratch/ow-build/build_dir/toolchain-x86_64_gcc-16.2.0_glibc/glibc-2.44-final'
make[2]: *** [Makefile:33: /scratch/ow-build/build_dir/toolchain-x86_64_gcc-16.2.0_glibc/glibc-2.44-final/.built] Error 2
make[2]: Leaving directory '/scratch/ow-build/toolchain/glibc'
time: toolchain/glibc/compile#220.03#44.54#20.47
    ERROR: toolchain/glibc failed to build.
make[1]: *** [toolchain/Makefile:93: toolchain/glibc/compile] Error 1
make[1]: Leaving directory '/scratch/ow-build'
make: *** [/scratch/ow-build/include/toplevel.mk:233: toolchain/glibc/compile] Error 2

@gingernut1978

gingernut1978 commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

No problem here building 16.2 for Rockchip & Filogic MT7986 targets, glibc downloaded and compiled without errors. Did need to include your stub libatomic_asneeded.a for GCC 16+ fix.

Also had to patch both targets, assisted by Deepseek V4:

package/boot/uboot-mediatek/patches/504-pylibfdt-fix-build-with-python-3.14.patch
package/boot/uboot-rockchip/patches/109-pylibfdt-fix-build-with-python-3.14.patch

there is a pending upstream dtc PR dgibson/dtc#192

+diff --git a/scripts/dtc/pylibfdt/libfdt.i_shipped b/scripts/dtc/pylibfdt/libfdt.i_shipped
+index e465948..326a15c 100644
+--- a/scripts/dtc/pylibfdt/libfdt.i_shipped
++++ b/scripts/dtc/pylibfdt/libfdt.i_shipped
+@@ -1033,7 +1033,7 @@ typedef uint32_t fdt32_t;
+       PyObject *buff;
+ 
+       if ($1) {
+-              resultobj = PyString_FromString(
++              resultobj = PyUnicode_FromString(
+                       fdt_string(fdt1, fdt32_to_cpu($1->nameoff)));
+               buff = PyByteArray_FromStringAndSize(
+                       (const char *)($1 + 1), fdt32_to_cpu($1->len));
+@@ -1064,13 +1064,13 @@ typedef uint32_t fdt32_t;
+         }
+         $1 = PyBytes_AsString($input);
+     %#else
+-        $1 = PyString_AsString($input);   /* char *str */
++        $1 = PyBytes_AsString($input);   /* char *str */
+     %#endif
+ }
+ 
+ /* typemaps used for fdt_next_node() */
+ %typemap(in, numinputs=1) int *depth (int depth) {
+-   depth = (int) PyInt_AsLong($input);
++   depth = (int) PyLong_AsLong($input);
+    $1 = &depth;
+ }
+ 
+-- 
+2.39.2

@schuettecarsten

Copy link
Copy Markdown
Contributor

For my, build still fails on clean checkout with the known libatomic issue.

aarch64-openwrt-linux-gnu-gcc   -shared -static-libgcc  -Wl,-dynamic-linker=/lib/ld-linux-aarch64.so.1 -Wl,-z,defs -Wl,-z,pack-relative-relocs -B/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/csu/  -Wl,--undefined-version -Wl,-z,relro -Wl,-z,now  -L/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final -L/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/math -L/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/elf -L/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/dlfcn -L/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/nss -L/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/nis -L/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/rt -L/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/resolv -L/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/mathvec -L/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/support -L/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/misc -L/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/debug -L/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/nptl -L./ -Wl,-rpath-link=/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final:/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/math:/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/elf:/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/dlfcn:/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/nss:/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/nis:/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/rt:/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/resolv:/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/mathvec:/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/support:/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/misc:/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/debug:/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/nptl:./ -o /home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/elf/sotruss-lib.so /home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/csu/abi-note.o -Wl,--as-needed /home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/elf/sotruss-lib.os  -Wl,--no-as-needed -Wl,--start-group /home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/libc.so /home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/libc_nonshared.a -Wl,--as-needed /home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/elf/ld.so -Wl,--no-as-needed -Wl,--end-group
/home/cschuette/openwrt/snapshot/openwrt/staging_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/aarch64-openwrt-linux-gnu/bin/ld: cannot find -latomic_asneeded: No such file or directory
collect2: error: ld returned 1 exit status
make[5]: *** [Makefile:245: /home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/elf/sotruss-lib.so] Error 1
make[5]: Leaving directory '/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43/elf'
make[4]: *** [Makefile:484: elf/subdir_lib] Error 2
make[4]: Leaving directory '/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43'
make[3]: *** [Makefile:20: all] Error 2
make[3]: Leaving directory '/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final'
make[2]: *** [Makefile:33: /home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/.built] Error 2
make[2]: Leaving directory '/home/cschuette/openwrt/snapshot/openwrt/toolchain/glibc'
time: toolchain/glibc/compile#12.90#7.39#20.30
    ERROR: toolchain/glibc failed to build.

The already mentioned workaround here might help:
DragonBluep#2

@gingernut1978

Copy link
Copy Markdown
Contributor

For my, build still fails on clean checkout with the known libatomic issue.

aarch64-openwrt-linux-gnu-gcc   -shared -static-libgcc  -Wl,-dynamic-linker=/lib/ld-linux-aarch64.so.1 -Wl,-z,defs -Wl,-z,pack-relative-relocs -B/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/csu/  -Wl,--undefined-version -Wl,-z,relro -Wl,-z,now  -L/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final -L/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/math -L/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/elf -L/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/dlfcn -L/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/nss -L/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/nis -L/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/rt -L/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/resolv -L/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/mathvec -L/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/support -L/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/misc -L/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/debug -L/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/nptl -L./ -Wl,-rpath-link=/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final:/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/math:/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/elf:/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/dlfcn:/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/nss:/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/nis:/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/rt:/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/resolv:/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/mathvec:/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/support:/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/misc:/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/debug:/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/nptl:./ -o /home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/elf/sotruss-lib.so /home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/csu/abi-note.o -Wl,--as-needed /home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/elf/sotruss-lib.os  -Wl,--no-as-needed -Wl,--start-group /home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/libc.so /home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/libc_nonshared.a -Wl,--as-needed /home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/elf/ld.so -Wl,--no-as-needed -Wl,--end-group
/home/cschuette/openwrt/snapshot/openwrt/staging_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/aarch64-openwrt-linux-gnu/bin/ld: cannot find -latomic_asneeded: No such file or directory
collect2: error: ld returned 1 exit status
make[5]: *** [Makefile:245: /home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/elf/sotruss-lib.so] Error 1
make[5]: Leaving directory '/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43/elf'
make[4]: *** [Makefile:484: elf/subdir_lib] Error 2
make[4]: Leaving directory '/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43'
make[3]: *** [Makefile:20: all] Error 2
make[3]: Leaving directory '/home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final'
make[2]: *** [Makefile:33: /home/cschuette/openwrt/snapshot/openwrt/build_dir/toolchain-aarch64_cortex-a76_gcc-16.2.0_glibc/glibc-2.43-final/.built] Error 2
make[2]: Leaving directory '/home/cschuette/openwrt/snapshot/openwrt/toolchain/glibc'
time: toolchain/glibc/compile#12.90#7.39#20.30
    ERROR: toolchain/glibc failed to build.

The already mentioned workaround here might help: DragonBluep#2

It is needed yes.

@vortexilation

Copy link
Copy Markdown
Contributor

For libatomic just use my more proper patch.

Tested.

hardfalcon pushed a commit to hardfalcon/openwrt that referenced this pull request Aug 11, 2026
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>
@schuettecarsten

schuettecarsten commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

For libatomic just use my more proper patch.

Your patch disables libatomic, which causes packages that have a dependency on that to fail (see #23194 (comment))

@vortexilation

vortexilation commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

No, like I said before, please understand how gcc being build in OpenWrt, it's not my first patch which disable libatomic completely, second patch is only disabling libatomic at first initial build of GCC, try it yourself before commenting.

Because I have tested it myself compiling 780 OpenWrt Packages which some of them have libatomic dependencies.

@schuettecarsten

Copy link
Copy Markdown
Contributor

No, like I said before, please understand how gcc being build in OpenWrt, it's not my first patch which disable libatomic completely, second patch is only disabling libatomic at first initial build of GCC, try it yourself before commenting.

Okay, you're right, the first discussion of this kind of solution was about disabling libatomic at all, not only in initial build. But according to https://sourceware.org/git/?p=glibc.git;a=blob;f=scripts/build-many-glibcs.py;h=f6fc0e376b3ac7680594734768719ffe917e9c96;hb=HEAD#l1570, it might be useful to disable more than libatomic? Apologies for discussions about that.

@schuettecarsten

Copy link
Copy Markdown
Contributor

Mold needs to be updated to 2.42.0 to fix compatibility issues with relocation data, see #24672 and rui314/mold#1626

@vortexilation

Copy link
Copy Markdown
Contributor

No, like I said before, please understand how gcc being build in OpenWrt, it's not my first patch which disable libatomic completely, second patch is only disabling libatomic at first initial build of GCC, try it yourself before commenting.

Okay, you're right, the first discussion of this kind of solution was about disabling libatomic at all, not only in initial build. But according to https://sourceware.org/git/?p=glibc.git;a=blob;f=scripts/build-many-glibcs.py;h=f6fc0e376b3ac7680594734768719ffe917e9c96;hb=HEAD#l1570, it might be useful to disable more than libatomic? Apologies for discussions about that.

Based on my test, it only needed in gcc initial phase build, it's enough. No worries :-).

@schuettecarsten

schuettecarsten commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

With the glibc changes and mold update, it builds perfectly fpr my bcm27xx/bcm2712 and bcm2711 devices. I think the glibc changes for the initial stage should be added to this PR.

@dhewg

dhewg commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Build and runtime tested on mediatek/filogic, ipq40xx/generic and spacemit/k1.
All musl builds, seems to work just fine with just this PR (so no additional libatomic workarounds).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

toolchain pull request/issue with toolchain related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants