From e7b3b8b467bad2cd32470b5edd5cb9938b934316 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Thu, 6 Apr 2023 14:44:50 -0700 Subject: [PATCH] setjmp.h: increase riscv64 jmp_buf size. If we switch from x18 to gp for shadow call stack, we're going to need another slot in jmp_buf. We'll need this even for hardware shadow call stacks too. While I'm here, and because this is likely my last chance, let's just round this up to 32 for safety. musl and glibc only have the minimum needed (which I think means they'll need an ABI break to support SCS unless they just use a callee-saved general purpose register), but since we can't do ABI breaks after we ship, let's play it safe. Bug: https://github.com/google/android-riscv64/issues/72 Test: treehugger Change-Id: I60661fb7a308c900bfd08c9361f51919b798c005 --- libc/include/setjmp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libc/include/setjmp.h b/libc/include/setjmp.h index a3de9c785..141e925c1 100644 --- a/libc/include/setjmp.h +++ b/libc/include/setjmp.h @@ -53,7 +53,7 @@ #elif defined(__i386__) #define _JBLEN 10 #elif defined(__riscv) -#define _JBLEN 29 +#define _JBLEN 32 #elif defined(__x86_64__) #define _JBLEN 11 #endif