Jelajahi Sumber

gcc: add required c-sky patches from gcc 15 to gcc 16

Waldemar Brodkorb 1 bulan lalu
induk
melakukan
0ce60c3b38

+ 16 - 0
toolchain/gcc/patches/16.2.0/0010-csky-dwarf-alt-frame-return-column.patch

@@ -0,0 +1,16 @@
+--- a/gcc/config/csky/csky.h	2026-05-31 20:55:03.197855806 +0000
++++ gcc/config/csky/csky.h	2026-05-31 20:55:03.204856192 +0000
+@@ -1007,6 +1007,13 @@
+    define DWARF_FRAME_RETURN_COLUMN to DWARF_FRAME_REGNUM.  */
+ #define DWARF_FRAME_RETURN_COLUMN DWARF_FRAME_REGNUM (CSKY_LR_REGNUM)
+ 
++/* Signal frames (config/csky/linux-unwind.h) put the interrupted PC in
++   DWARF column 32, which is not a hard register and thus is left unsized
++   in dwarf_reg_size_table.  Declare it as the alternate return column so
++   init_dwarf_reg_size_table sizes it; otherwise _Unwind_GetGR aborts when
++   unwinding through a signal frame (e.g. pthread cancellation).  */
++#define DWARF_ALT_FRAME_RETURN_COLUMN 32
++
+ /* Use r0 and r1 to pass exception handling information.  */
+ #define EH_RETURN_DATA_REGNO(N) ((N) < 2 ? N : INVALID_REGNUM)
+ 

+ 12 - 0
toolchain/gcc/patches/16.2.0/csky.patch

@@ -0,0 +1,12 @@
+diff -Nur gcc-11.2.0.orig/libgcc/config/csky/linux-atomic.c gcc-11.2.0/libgcc/config/csky/linux-atomic.c
+--- gcc-11.2.0.orig/libgcc/config/csky/linux-atomic.c	2021-07-28 08:55:08.760307899 +0200
++++ gcc-11.2.0/libgcc/config/csky/linux-atomic.c	2021-12-14 14:19:23.685729233 +0100
+@@ -24,7 +24,7 @@
+    <http://www.gnu.org/licenses/>.	 */
+ 
+ /* Kernel helper for compare-and-exchange.  */
+-inline int
++int
+ __kernel_cmpxchg (int oldval, int newval, volatile int *ptr)
+ {
+   register int _a0 asm ("a0") = oldval;