https://gcc.gnu.org/g:f18388faa4e64849541354801e2481622c1285cd
commit r17-1388-gf18388faa4e64849541354801e2481622c1285cd Author: Ramin Moussavi <[email protected]> Date: Fri Jun 5 23:13:12 2026 -0600 [PATCH] csky: define DWARF_ALT_FRAME_RETURN_COLUMN` Tested with a csky-linux-uclibc gcc 15.2.0 cross compiler against uClibc-ng, running its NPTL test suite on qemu-system-cskyv2: without the fix eight cancellation tests abort (tst-cancel1/10/11/13/15/16/18, tst-cleanup4); with it all pass and the rest of the suite is unchanged. gcc/ChangeLog: * config/csky/csky.h (DWARF_ALT_FRAME_RETURN_COLUMN): Define. Signed-off-by: Ramin Moussavi <[email protected]> Diff: --- gcc/config/csky/csky.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gcc/config/csky/csky.h b/gcc/config/csky/csky.h index 3a570051e4f0..b7dadc92dd70 100644 --- a/gcc/config/csky/csky.h +++ b/gcc/config/csky/csky.h @@ -1007,6 +1007,14 @@ while (0) define DWARF_FRAME_RETURN_COLUMN to DWARF_FRAME_REGNUM. */ #define DWARF_FRAME_RETURN_COLUMN DWARF_FRAME_REGNUM (CSKY_LR_REGNUM) +/* The Linux signal-frame fallback (config/csky/linux-unwind.h) records the + interrupted PC in DWARF column 32, one past the hard registers, and uses + it as the return column. Declare it as the alternate return column so + that init_dwarf_reg_size_table sizes it; otherwise _Unwind_GetGR reads a + zero size and aborts when unwinding through a signal frame, such as + during NPTL 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)
