From: Bruno Haible Date: Fri, 7 Jan 2022 18:11:25 +0000 (+0100) Subject: sigsegv: Improve support for Linux/LoongArch64. X-Git-Tag: v1.0~2416 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=cfaebd1eaf093e481dddbc5c57d3fc76135d136b;p=gnulib.git sigsegv: Improve support for Linux/LoongArch64. * lib/sigsegv.c (SIGSEGV_FAULT_STACKPOINTER): Add special case for Linux/LoongArch. --- diff --git a/ChangeLog b/ChangeLog index 1208d4c6d5..60ca624f1d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2022-01-07 Bruno Haible + + sigsegv: Improve support for Linux/LoongArch64. + * lib/sigsegv.c (SIGSEGV_FAULT_STACKPOINTER): Add special case for + Linux/LoongArch. + 2022-01-05 Glenn Washburn bootstrap: When a commit is specified, do a shallow fetch if possible. diff --git a/lib/sigsegv.c b/lib/sigsegv.c index ef00f61393..da70ffa5fd 100644 --- a/lib/sigsegv.c +++ b/lib/sigsegv.c @@ -168,6 +168,15 @@ int libsigsegv_version = LIBSIGSEGV_VERSION; because $bsp and $bspstore never differ by more than ca. 1 KB. */ # define SIGSEGV_FAULT_BSP_POINTER ((ucontext_t *) ucp)->uc_mcontext.sc_ar_bsp +# elif defined __loongarch__ + +/* See . + Note that the 'mcontext_t' defined in + and the 'struct sigcontext' defined in + (see also ) are effectively the same. */ + +# define SIGSEGV_FAULT_STACKPOINTER ((ucontext_t *) ucp)->uc_mcontext.__gregs[3] + # elif defined __m68k__ /* See glibc/sysdeps/unix/sysv/linux/m68k/sys/ucontext.h