From 7ef922a485f89103ef693d0a9465aa3bfeb99ebc Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Fri, 24 Feb 2023 08:00:00 +0000 Subject: Fix build on alpha Workaround a bug in glibc headers that fail to provide si_trapno field in their definition of siginfo_t on alpha. Link: https://sourceware.org/bugzilla/show_bug.cgi?id=30173 Resolves: https://github.com/strace/strace/issues/220 * configure.ac (AC_CHECK_MEMBERS): Add siginfo_t.si_trapno. * src/printsiginfo.c [ALPHA]: Guard use of si_trapno with HAVE_SIGINFO_T_SI_TRAPNO. * tests/ptrace.c [ALPHA]: Likewise. * NEWS: Mention this fix. --- src/printsiginfo.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/printsiginfo.c b/src/printsiginfo.c index 3923b9045..49b31fc05 100644 --- a/src/printsiginfo.c +++ b/src/printsiginfo.c @@ -168,7 +168,7 @@ print_si_info(struct tcb *tcp, const siginfo_t *sip) case SIGFPE: tprint_struct_next(); PRINT_FIELD_PTR(*sip, si_addr); -#ifdef ALPHA +#if defined ALPHA && defined HAVE_SIGINFO_T_SI_TRAPNO tprint_struct_next(); PRINT_FIELD_XVAL_D(*sip, si_trapno, alpha_trap_codes, "GEN_???"); @@ -214,15 +214,16 @@ print_si_info(struct tcb *tcp, const siginfo_t *sip) case SIGTRAP: tprint_struct_next(); PRINT_FIELD_PTR(*sip, si_addr); -#if defined(ALPHA) || defined(HAVE_SIGINFO_T_SI_PERF_DATA) +#if (defined ALPHA && defined HAVE_SIGINFO_T_SI_TRAPNO) \ + || defined HAVE_SIGINFO_T_SI_PERF_DATA switch (sip->si_code) { -# ifdef ALPHA +# if defined ALPHA && defined HAVE_SIGINFO_T_SI_TRAPNO case TRAP_UNK: tprint_struct_next(); PRINT_FIELD_XVAL_D(*sip, si_trapno, alpha_trap_codes, "GEN_???"); break; -# endif /* ALPHA */ +# endif /* ALPHA && HAVE_SIGINFO_T_SI_TRAPNO */ # ifdef HAVE_SIGINFO_T_SI_PERF_DATA case TRAP_PERF: tprint_struct_next(); -- cgit v1.2.1