Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/cairo: work around gcc bug 125410 on hppa
@ 2026-11-12 14:45 Yegor Yefremov
  2026-11-14  9:41 ` Peter Korsgaard
  0 siblings, 1 reply; 2+ messages in thread
From: Yegor Yefremov @ 2026-11-12 14:45 UTC (permalink / raw)
  To: buildroot
  Cc: Thomas Petazzoni, Romain Naour, Vincent Stehlé,
	Fabrice Fontaine, Giulio Benetti

GCC 16 uses LRA by default on hppa, and crashes while compiling
cairo-pattern.c:

../src/cairo-pattern.c: In function 'cairo_mesh_pattern_end_patch':
../src/cairo-pattern.c:1417:1: error: unrecognizable insn:
(insn 325 0 0 (set (reg/f:SI 381)
        (mem/f/c:SI (plus:SI (reg/f:SI 89 sfp)
                (const_int -184 [0xffffffffffffff48])) [25 p[0][0]+0 S4 A64])) -1
     (nil))
during RTL pass: reload
../src/cairo-pattern.c:1417:1: internal compiler error: in extract_insn, at recog.cc:2892

This is GCC bug 125410 [1], reported upstream with a test case reduced
from this very cairo function, and still open. GCC 15 is not affected,
and with GCC 16 both the test case and cairo build when passing
-mno-lra, as reported in [2].

Add BR2_TOOLCHAIN_HAS_GCC_BUG_125410 for hppa with GCC >= 16, and pass
-mno-lra to cairo in that case, so that the old reload pass is used.

This issue has been present since commit 1b290781cf37 ("package/gcc:
add version 16.1.0"), which made GCC 16 available. It therefore
affects 2026.08 and later, including the 2026.08.x maintenance
branch.

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125410
[2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125410#c2

Fixes:
https://autobuild.buildroot.org/results/f76b8f361d01eef892ad21722b099ba8bacfcc57
https://autobuild.buildroot.org/results/a5ee815bd49784cc522e76e49a2a021a151a9e57
https://autobuild.buildroot.org/results/54bbea14bef321c193d9b6450b253edf832c6b8d

Fixes: 1b290781cf3782576091dbeacdd7d1a30b051856 ("package/gcc: add version 16.1.0")
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
---
 package/cairo/cairo.mk | 5 +++++
 toolchain/Config.in    | 9 +++++++++
 2 files changed, 14 insertions(+)

diff --git a/package/cairo/cairo.mk b/package/cairo/cairo.mk
index 26c2555f9d..0c354c7414 100644
--- a/package/cairo/cairo.mk
+++ b/package/cairo/cairo.mk
@@ -24,6 +24,11 @@ ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),)
 CAIRO_CFLAGS += -DCAIRO_NO_MUTEX=1
 endif
 
+# Use the old reload pass instead of LRA to work around an ICE
+ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_125410),y)
+CAIRO_CFLAGS += -mno-lra
+endif
+
 # cairo can use C++11 atomics when available, so we need to link with
 # libatomic for the architectures who need libatomic.
 ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
diff --git a/toolchain/Config.in b/toolchain/Config.in
index 5f4c5f5fb7..3f5d9760b9 100644
--- a/toolchain/Config.in
+++ b/toolchain/Config.in
@@ -249,6 +249,15 @@ config BR2_TOOLCHAIN_HAS_GCC_BUG_111001
 		   BR2_OPTIMIZE_2 || \
 		   BR2_OPTIMIZE_3
 
+# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125410
+# ICE: on hppa: in extract_insn, at recog.cc:2892 during RTL pass:
+# reload, with LRA, which is the default since gcc 16.
+# This bug exists in gcc = 16.1.0 and gcc = 16.2.0
+config BR2_TOOLCHAIN_HAS_GCC_BUG_125410
+	bool
+	default y if BR2_hppa
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_16
+
 config BR2_TOOLCHAIN_HAS_NATIVE_RPC
 	bool
 
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-14  9:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-12 14:45 [Buildroot] [PATCH] package/cairo: work around gcc bug 125410 on hppa Yegor Yefremov
2026-11-14  9:41 ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox