Просмотр исходного кода

gcc: add csky DWARF_ALT_FRAME_RETURN_COLUMN patch

The csky signal-frame fallback (config/csky/linux-unwind.h) records the
interrupted PC in DWARF column 32, but csky.h never declares it, so
init_dwarf_reg_size_table leaves the column unsized and _Unwind_GetGR
aborts when unwinding through a signal frame (NPTL cancellation
SIGABRT, 8 uClibc-ng cancel tests). Declare it as the alternate return
column, like the microblaze patch does for column 36.

This patch was applied by hand when toolchain-csky-gcc-15.2.0_soft was
built; commit it so the toolchain is reproducible from the patch stack.

Signed-off-by: Ramin Moussavi <ramin.moussavi@yacoub.de>
Ramin Moussavi 2 дней назад
Родитель
Сommit
cb9e46f675

+ 16 - 0
toolchain/gcc/patches/15.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)
+