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

Message ID DB9PR83MB0923B5CA74A8B1FA66B371EB9241A@DB9PR83MB0923.EURPRD83.prod.outlook.com
State New
Headers
Series [v2] newlib: increase jump buffer length to 25 to fit all non-volatile registers for aarch64-pc-cygwin |

Commit Message

Radek Barton July 1, 2025, 12:24 p.m. UTC
  Hello.

If that's the case, here is the updated patch changing it to 25.

Radek

---
From 1ff3281cfb67719fe8103ed0bb11f7aa3cf39b3c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Radek=20Barto=C5=88?= <radek.barton@microsoft.com>
Date: Thu, 29 May 2025 20:34:56 +0200
Subject: [PATCH v2] newlib: increase jump buffer length to 25 to fit
 all non-volatile registers for aarch64-pc-cygwin
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Radek Bartoň <radek.barton@microsoft.com>
---
 newlib/libc/include/machine/setjmp.h | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
  

Comments

Corinna Vinschen July 2, 2025, 4:15 p.m. UTC | #1
On Jul  1 12:24, Radek Barton wrote:
> Hello.
> 
> If that's the case, here is the updated patch changing it to 25.

Pushed.

Thanks,
Corinna

> 
> Radek
> 
> ---
> >From 1ff3281cfb67719fe8103ed0bb11f7aa3cf39b3c Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Radek=20Barto=C5=88?= <radek.barton@microsoft.com>
> Date: Thu, 29 May 2025 20:34:56 +0200
> Subject: [PATCH v2] newlib: increase jump buffer length to 25 to fit
>  all non-volatile registers for aarch64-pc-cygwin
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
> 
> Signed-off-by: Radek Bartoň <radek.barton@microsoft.com>
> ---
>  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 102582c8e..001e1d999 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
>  
> -- 
> 2.49.0.vfs.0.4
  

Patch

diff --git a/newlib/libc/include/machine/setjmp.h b/newlib/libc/include/machine/setjmp.h
index 102582c8e..001e1d999 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