[PATCH V2] Cygwin: gendef: Implement sigsetjmp for AArch64

Thirumalai Nagalingam thirumalai.nagalingam@multicorewareinc.com
Fri Jan 16 18:01:24 GMT 2026


Hi,



No additional changes in this version.

This V2 patch was regenerated on top of `cygwin/main` and applies cleanly as-is, without any additional dependencies.



Thanks,

Thirumalai Nagalingam



In-lined Patch:



diff --git a/winsup/cygwin/scripts/gendef b/winsup/cygwin/scripts/gendef

index b0e4d2a3e..ff13f1daa 100755

--- a/winsup/cygwin/scripts/gendef

+++ b/winsup/cygwin/scripts/gendef

@@ -607,7 +607,28 @@ EOF

        # TODO: These are only stubs, they need to be implemented properly for AArch64.

        return <<EOF;

        .globl  sigsetjmp

+       .seh_proc sigsetjmp

 sigsetjmp:

+       // prologue

+       stp             fp, lr, [sp, #-0x10]!   // save FP and LR registers

+       mov             fp, sp                  // set FP to current SP

+       .seh_endprologue

+       str     w1, [x0, #0x100]                // buf->savemask = savemask

+       cbz     w1, 1f                          // If savemask == 0, skip fetching sigmask

+       mov     x3, x0                          // save buf in x3

+       sub     sp, sp, #32                     // Allocate 32 bytes on stack call

+       mov     x0, #0                          // SIG_SETMASK

+       mov     x1, xzr                         // newmask = NULL

+       add     x2, x3, #0x108                  // &buf->sigmask

+       bl      pthread_sigmask

+       add     sp, sp, #32

+1:

+       bl      setjmp

+       // epilogue

+       ldp     fp, lr, [sp], #0x10             // restore saved FP and LR registers

+       ret

+       .seh_endproc

+

        .globl  setjmp

 setjmp:

        .globl  siglongjmp

--

2.52.0.windows.1


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0006-Cygwin-gendef-Implement-sigsetjmp-for-AArch64.patch
Type: application/octet-stream
Size: 1704 bytes
Desc: 0006-Cygwin-gendef-Implement-sigsetjmp-for-AArch64.patch
URL: <https://cygwin.com/pipermail/cygwin-patches/attachments/20260116/640a6e42/attachment-0001.obj>


More information about the Cygwin-patches mailing list