* [Buildroot] [PATCH 1/2] toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_104820
@ 2026-10-24 21:50 Yegor Yefremov
2026-10-24 21:50 ` [Buildroot] [PATCH 2/2] package/openssh: fix build on MIPS before R6 at -O0 Yegor Yefremov
2026-10-25 20:49 ` [Buildroot] [PATCH 1/2] toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_104820 Thomas Petazzoni via buildroot
0 siblings, 2 replies; 3+ messages in thread
From: Yegor Yefremov @ 2026-10-24 21:50 UTC (permalink / raw)
To: buildroot; +Cc: Giulio Benetti, Romain Naour, Thomas Petazzoni
-fzero-call-used-regs is broken on MIPS before R6, which still has the
hi/lo registers: gcc either rejects -fzero-call-used-regs=used for
functions using them:
sorry, unimplemented: argument 'used' is not supported for '-fzero-call-used-regs' on this target
or, depending on the code, the ABI and the optimization level, ICEs:
during RTL pass: zero_call_used_regs
channels.c:437:1: internal compiler error: in int_mode_for_mode, at stor-layout.cc:408
This has been reported upstream, and is still present in gcc 15.3.0:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104820
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104817
MIPS R6 doesn't have hi/lo and is not affected.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
---
toolchain/Config.in | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/toolchain/Config.in b/toolchain/Config.in
index 4e6a8d7927..5f4c5f5fb7 100644
--- a/toolchain/Config.in
+++ b/toolchain/Config.in
@@ -210,6 +210,16 @@ config BR2_TOOLCHAIN_HAS_GCC_BUG_104028
bool
default y if BR2_m68k
+# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104820
+# ICE: on MIPS: in int_mode_for_mode, at stor-layout.cc:408 during
+# RTL pass: zero_call_used_regs. MIPS before R6 also rejects
+# -fzero-call-used-regs=used in functions using the hi/lo registers.
+# This bug still exists in gcc = 15.3.0
+config BR2_TOOLCHAIN_HAS_GCC_BUG_104820
+ bool
+ default y if (BR2_mips || BR2_mipsel || BR2_mips64 || BR2_mips64el) \
+ && !BR2_MIPS_CPU_MIPS32R6 && !BR2_MIPS_CPU_MIPS64R6
+
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107728
# https://sourceware.org/bugzilla/show_bug.cgi?id=29621
config BR2_TOOLCHAIN_HAS_GCC_BUG_107728
--
2.34.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH 2/2] package/openssh: fix build on MIPS before R6 at -O0
2026-10-24 21:50 [Buildroot] [PATCH 1/2] toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_104820 Yegor Yefremov
@ 2026-10-24 21:50 ` Yegor Yefremov
2026-10-25 20:49 ` [Buildroot] [PATCH 1/2] toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_104820 Thomas Petazzoni via buildroot
1 sibling, 0 replies; 3+ messages in thread
From: Yegor Yefremov @ 2026-10-24 21:50 UTC (permalink / raw)
To: buildroot; +Cc: Giulio Benetti, Romain Naour, Thomas Petazzoni
openssh fails to build on MIPS64 (n32/n64 ABI) before R6 with
BR2_OPTIMIZE_0:
during RTL pass: zero_call_used_regs
channels.c: In function 'channel_set_xtype':
channels.c:437:1: internal compiler error: in int_mode_for_mode, at stor-layout.cc:408
Since version 9.6p1, openssh builds with -fzero-call-used-regs=used if
the compiler supports it. On MIPS before R6, gcc rejects this option or
ICEs on functions using the hi/lo registers (gcc bug 104820). The
configure check usually catches this, but at -O0 its test program
builds fine with n32/n64, so the option ends up being used.
Disable -fzero-call-used-regs on MIPS before R6, through the configure
cache variable already used for powerpc64le. This doesn't lose anything,
as the option is never usable there.
This issue has been present since commit 3c047ea463e2
("package/openssh: security bump to version 9.6p1"), which switched
from -fzero-call-used-regs=all (always rejected by the configure check
on MIPS before R6) to -fzero-call-used-regs=used. It therefore affects
2024.02 and later, including all maintained branches. The cache
variable only exists since openssh 10.1, so for branches with an older
openssh, --without-hardening would be needed instead.
Fixes:
https://autobuild.buildroot.org/results/68d260341341afb0dfb7244f641f5196df3649a8
Fixes: 3c047ea463e27ceaafde76d64406862c3322daa0 ("package/openssh: security bump to version 9.6p1")
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
---
package/openssh/openssh.mk | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/package/openssh/openssh.mk b/package/openssh/openssh.mk
index 6808db9962..a0cd3168e0 100644
--- a/package/openssh/openssh.mk
+++ b/package/openssh/openssh.mk
@@ -36,7 +36,9 @@ define OPENSSH_PERMISSIONS
/var/empty d 755 root root - - - - -
endef
-ifeq ($(BR2_powerpc64le),y)
+# -fzero-call-used-regs=used is not supported on powerpc64le and makes
+# gcc ICE on MIPS before R6
+ifneq ($(BR2_powerpc64le)$(BR2_TOOLCHAIN_HAS_GCC_BUG_104820),)
OPENSSH_CONF_ENV += ossh_cv_cflag__fzero_call_used_regs_used=no
endif
--
2.34.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Buildroot] [PATCH 1/2] toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_104820
2026-10-24 21:50 [Buildroot] [PATCH 1/2] toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_104820 Yegor Yefremov
2026-10-24 21:50 ` [Buildroot] [PATCH 2/2] package/openssh: fix build on MIPS before R6 at -O0 Yegor Yefremov
@ 2026-10-25 20:49 ` Thomas Petazzoni via buildroot
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni via buildroot @ 2026-10-25 20:49 UTC (permalink / raw)
To: Yegor Yefremov; +Cc: buildroot, Giulio Benetti, Romain Naour
On Sat, Oct 24, 2026 at 11:50:08PM +0200, Yegor Yefremov wrote:
> -fzero-call-used-regs is broken on MIPS before R6, which still has the
> hi/lo registers: gcc either rejects -fzero-call-used-regs=used for
> functions using them:
>
> sorry, unimplemented: argument 'used' is not supported for '-fzero-call-used-regs' on this target
>
> or, depending on the code, the ABI and the optimization level, ICEs:
>
> during RTL pass: zero_call_used_regs
> channels.c:437:1: internal compiler error: in int_mode_for_mode, at stor-layout.cc:408
>
> This has been reported upstream, and is still present in gcc 15.3.0:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104820
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104817
>
> MIPS R6 doesn't have hi/lo and is not affected.
>
> Assisted-by: Claude:claude-opus-5-5
> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Series applied to master, thanks!
Best regards,
Thomas Petazzoni
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-10-25 20:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-24 21:50 [Buildroot] [PATCH 1/2] toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_104820 Yegor Yefremov
2026-10-24 21:50 ` [Buildroot] [PATCH 2/2] package/openssh: fix build on MIPS before R6 at -O0 Yegor Yefremov
2026-10-25 20:49 ` [Buildroot] [PATCH 1/2] toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_104820 Thomas Petazzoni via buildroot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox