From 0bf4bb4bd306c1f038aa5cb9c96cdb83d7846f87 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Wed, 30 Sep 2015 20:59:13 +0200 Subject: Fix build of jumps.c on i386/linux. --- src/grt/config/jumps.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/grt') diff --git a/src/grt/config/jumps.c b/src/grt/config/jumps.c index 775225e..a544f83 100644 --- a/src/grt/config/jumps.c +++ b/src/grt/config/jumps.c @@ -24,10 +24,15 @@ covered by the GNU Public License. */ +#define _GNU_SOURCE #include #include #include + +#if defined (__linux__) && defined (__i386__) +/* On i386/Linux, the context must be inspected. */ #include +#endif /* There is a simple setjmp/longjmp mechanism used to report failures. We have the choice between 3 mechanisms: @@ -37,11 +42,10 @@ */ #if defined (__GNUC__) && !defined (__clang__) -#define USE_BUILTIN_SJLJ +# define USE_BUILTIN_SJLJ #else -#define USE__SETJMP +# define USE__SETJMP #endif -/* #define USE_SETJMP */ #ifdef USE_BUILTIN_SJLJ typedef void *JMP_BUF[5]; @@ -88,6 +92,8 @@ static struct sigaction prev_sigsegv_act; static void grt_sigsegv_handler (int signo, siginfo_t *info, void *ptr) { #if defined (__linux__) && defined (__i386__) + ucontext_t *uctxt = (ucontext_t *)ptr; + /* Linux generates a SIGSEGV (!) for an overflow exception. */ if (uctxt->uc_mcontext.gregs[REG_TRAPNO] == 4) { -- cgit