From ad9d4c8351016c0501eabaafde56d9f719d7ce1d Mon Sep 17 00:00:00 2001 From: Romain Naour Date: Mon, 29 Jun 2026 22:54:52 +0200 Subject: [PATCH] package/gcc: add missing 15.3.0 patches git am failed locally while the patch sent by Bernd looked correct [1]. Fixes: f8f6bcec0f523510a22882e4391999be81dc0e94 [1] https://lists.busybox.net/pipermail/buildroot/2026-June/805485.html Reported-by: Bernd Kuhls Signed-off-by: Romain Naour --- ...le-split-stack-for-non-thread-builds.patch | 26 +++++++++ ...-config-microblaze-fix-ira-for-GCC15.patch | 56 +++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 package/gcc/15.3.0/0001-disable-split-stack-for-non-thread-builds.patch create mode 100644 package/gcc/15.3.0/0002-gcc-config-microblaze-fix-ira-for-GCC15.patch diff --git a/package/gcc/15.3.0/0001-disable-split-stack-for-non-thread-builds.patch b/package/gcc/15.3.0/0001-disable-split-stack-for-non-thread-builds.patch new file mode 100644 index 0000000000..c3b600cfb8 --- /dev/null +++ b/package/gcc/15.3.0/0001-disable-split-stack-for-non-thread-builds.patch @@ -0,0 +1,26 @@ +From 7d5f59e035341430e20f47420535d0e987516e55 Mon Sep 17 00:00:00 2001 +From: Waldemar Brodkorb +Date: Mon, 25 Jul 2022 00:29:55 +0200 +Subject: [PATCH] disable split-stack for non-thread builds + +Signed-off-by: Waldemar Brodkorb +[Romain: convert to git format] +Signed-off-by: Romain Naour +--- + libgcc/config/t-stack | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/libgcc/config/t-stack b/libgcc/config/t-stack +index cc0366b4cd8..f3f97e86d60 100644 +--- a/libgcc/config/t-stack ++++ b/libgcc/config/t-stack +@@ -1,4 +1,6 @@ + # Makefile fragment to provide generic support for -fsplit-stack. + # This should be used in config.host for any host which supports + # -fsplit-stack. ++ifeq ($(enable_threads),yes) + LIB2ADD_ST += $(srcdir)/generic-morestack.c $(srcdir)/generic-morestack-thread.c ++endif +-- +2.50.1 + diff --git a/package/gcc/15.3.0/0002-gcc-config-microblaze-fix-ira-for-GCC15.patch b/package/gcc/15.3.0/0002-gcc-config-microblaze-fix-ira-for-GCC15.patch new file mode 100644 index 0000000000..663aab7218 --- /dev/null +++ b/package/gcc/15.3.0/0002-gcc-config-microblaze-fix-ira-for-GCC15.patch @@ -0,0 +1,56 @@ +From d2fdbd8c4abe67eea86877dfb3b3b9d8508c165f Mon Sep 17 00:00:00 2001 +From: Romain Naour +Date: Wed, 6 Aug 2025 22:32:30 +0200 +Subject: [PATCH] gcc/config/microblaze: fix ira for GCC15 + +Add new hooks for callee-save on microblaze defined by [1] and +return 1 to restore the old behavior prior to the commit [3]. + +Tested with qemu_microblazeel_mmu_defconfig and used to generate +Microblaze toolchains for the Bootlin toolchains 2025.08-1 [4][5]. + +Upstream: suggested in the bug report: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121432#c10 + +[1] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=b191e8bdecf881d11c1544c441e38f4c18392a15 +[2] https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/config/i386/i386.cc;h=3128973ba79cccfc6761f451dcb716b9558cc4da;hb=d3ff498c478acefce35de04402f99171b4f64a1a#l20606 +[3] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=3b9b8d6cfdf59337f4b7ce10ce92a98044b2657b +[4] https://lore.kernel.org/buildroot/87sehzndtp.fsf@dell.be.48ers.dk/T/#mce7decd0b3f6a41008d5de577538a8525c91b374 +[5] https://toolchains.bootlin.com/ + +Signed-off-by: Romain Naour +--- + gcc/config/microblaze/microblaze.cc | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/gcc/config/microblaze/microblaze.cc b/gcc/config/microblaze/microblaze.cc +index 78b9428ef3b..84ea7e8d55a 100644 +--- a/gcc/config/microblaze/microblaze.cc ++++ b/gcc/config/microblaze/microblaze.cc +@@ -3228,6 +3228,14 @@ microblaze_secondary_reload (bool in_p ATTRIBUTE_UNUSED, rtx x ATTRIBUTE_UNUSED, + return NO_REGS; + } + ++/* Implement TARGET_CALLEE_SAVE_COST. */ ++static int ++microblaze_callee_save_cost (spill_cost_type, unsigned int hard_regno, machine_mode, ++ unsigned int, int mem_cost, const HARD_REG_SET &, bool) ++{ ++ return 1; ++} ++ + static void + microblaze_globalize_label (FILE * stream, const char *name) + { +@@ -4066,6 +4074,9 @@ microblaze_starting_frame_offset (void) + #undef TARGET_SECONDARY_RELOAD + #define TARGET_SECONDARY_RELOAD microblaze_secondary_reload + ++#undef TARGET_CALLEE_SAVE_COST ++#define TARGET_CALLEE_SAVE_COST microblaze_callee_save_cost ++ + #undef TARGET_ASM_OUTPUT_MI_THUNK + #define TARGET_ASM_OUTPUT_MI_THUNK microblaze_asm_output_mi_thunk + +-- +2.50.1 +