[newlib-cygwin/main] newlib: increase jump buffer length to 25 to fit all non-volatile registers for aarch64-pc-cygwin

Corinna Vinschen corinna@sourceware.org
Wed Jul 2 16:15:50 GMT 2025


https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=9b6361b0ff0cf8e00beac9b7b0721ad90a3fea7d

commit 9b6361b0ff0cf8e00beac9b7b0721ad90a3fea7d
Author:     Radek Bartoň <radek.barton@microsoft.com>
AuthorDate: Thu May 29 20:34:56 2025 +0200
Commit:     Corinna Vinschen <corinna@vinschen.de>
CommitDate: Wed Jul 2 18:08:14 2025 +0200

    newlib: increase jump buffer length to 25 to fit all non-volatile registers for aarch64-pc-cygwin
    
    Signed-off-by: Radek Bartoň <radek.barton@microsoft.com>

Diff:
---
 newlib/libc/include/machine/setjmp.h | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/newlib/libc/include/machine/setjmp.h b/newlib/libc/include/machine/setjmp.h
index 102582c8e255..ab820ed94e33 100644
--- a/newlib/libc/include/machine/setjmp.h
+++ b/newlib/libc/include/machine/setjmp.h
@@ -22,7 +22,16 @@ _BEGIN_STD_C
 #endif
 
 #if defined(__aarch64__)
-#define _JBLEN 22
+# if defined(__CYGWIN__)
+/*
+ * Windows Arm64 ABI requires saving x19-x28, FP, LR, SP, FPCR, FPSR, d8-d15
+ * and jump address to jmp_buf. On top of that, Cygwin requires saving
+ * TLS stack pointer.
+ */
+#  define _JBLEN 25
+# else
+#  define _JBLEN 22
+# endif
 #define _JBTYPE long long
 #endif


More information about the Newlib-cvs mailing list