From cba678ba02428b02e08a9a169d57e70f271d789f Mon Sep 17 00:00:00 2001 From: Kito Cheng Date: Fri, 17 Nov 2017 14:50:52 +0800 Subject: [PATCH] RISC-V: Fix alignment issue in sigjmp_buf --- newlib/libc/include/machine/setjmp.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/newlib/libc/include/machine/setjmp.h b/newlib/libc/include/machine/setjmp.h index b33f437d7..9212f840b 100644 --- a/newlib/libc/include/machine/setjmp.h +++ b/newlib/libc/include/machine/setjmp.h @@ -359,7 +359,9 @@ _BEGIN_STD_C #endif #ifdef __riscv -#define _JBTYPE long +/* _JBTYPE using long long to make sure the alignment is align to 8 byte, + otherwise in rv32imafd, store/restore FPR may mis-align. */ +#define _JBTYPE long long #ifdef __riscv_32e #define _JBLEN ((4*sizeof(long))/sizeof(long)) #else