From patchwork Wed Mar 21 14:56:04 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 147989 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 57313B6F9F for ; Thu, 22 Mar 2012 01:57:02 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1332946623; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: From:To:Cc:Subject:In-Reply-To:References:User-Agent:Date: Message-ID:MIME-Version:Content-Type:Mailing-List:Precedence: List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=8BUfhqG7ayoBQoSGCrLh28UA4bg=; b=XM8igOtCiCQ9sBL NBXPzAX4aweNStpJ2RTW99fqp1mTxDNdLAwRLj3CWQzYE2mM6MGgiNN3lGI1O6Wd +NnkJTOAEb5pQffSbs1IVRMUxAXsrH2Qwd4zLLXbTCQd/TojTbOj+1Yz3iD2kPro 6dM5f6z4ACC84bfLqs33sSRAzAXs= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:From:To:Cc:Subject:In-Reply-To:References:User-Agent:Date:Message-ID:MIME-Version:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=U6EKMo1j5I9l01CexWKJFh5gX7eQ7iOI4aWUSEb8wj3nQ95rXbJyY9xZXtX4dd QaQJqx9YbKd3Kqpbq2eyVi3taQvS0W4xjCU6vhxnrnsaDukmZhjIl3GnrZ7NeBx1 q5U+TpVqfk8eXFfxeDx6JumbbT8gI6pqu+MWbrv+1cYMM=; Received: (qmail 19166 invoked by alias); 21 Mar 2012 14:56:45 -0000 Received: (qmail 19146 invoked by uid 22791); 21 Mar 2012 14:56:42 -0000 X-SWARE-Spam-Status: No, hits=-0.4 required=5.0 tests=AWL,BAYES_50 X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 21 Mar 2012 14:56:24 +0000 Received: from nat-dem.mentorg.com ([195.212.93.2] helo=eu2-mail.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1SAMxa-00046T-RI from Thomas_Schwinge@mentor.com ; Wed, 21 Mar 2012 07:56:23 -0700 Received: from feldtkeller.schwinge.homeip.net ([172.30.64.78]) by eu2-mail.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Wed, 21 Mar 2012 15:56:20 +0100 From: Thomas Schwinge To: gcc-patches@gcc.gnu.org, ian@airs.com Cc: libc-alpha@sourceware.org, drepper@gmail.com, Carlos O'Donell Subject: Re: struct siginfo vs. siginfo_t In-Reply-To: References: <20120226181752.1175.qmail@sourceware.org> <87zkbhkipp.fsf@schwinge.name> User-Agent: Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu) Date: Wed, 21 Mar 2012 15:56:04 +0100 Message-ID: <87fwd2f1ff.fsf@schwinge.name> MIME-Version: 1.0 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Hi! On Thu, 15 Mar 2012 11:57:00 -0400, Carlos O'Donell wrote: > On Thu, Mar 15, 2012 at 11:05 AM, Thomas Schwinge > wrote: > > On 26 Feb 2012 18:17:52 -0000, drepper@sourceware.org wrote: > >> http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=4efeffc1d583597e4f52985b9747269e47b754e2 > >> > >> commit 4efeffc1d583597e4f52985b9747269e47b754e2 > >> Author: Ulrich Drepper > >> Date:   Sun Feb 26 13:17:27 2012 -0500 > >> > >>     Fix up POSIX testing in conformtest > > > >> [...] > >> +     * sysdeps/unix/sysv/linux/bits/siginfo.h: Don't name siginfo_t > >> +     struct.  [...] > >> [...] > > > >> diff --git a/sysdeps/unix/sysv/linux/bits/siginfo.h b/sysdeps/unix/sysv/linux/bits/siginfo.h > >> index ecef39d..0635e2f 100644 > >> --- a/sysdeps/unix/sysv/linux/bits/siginfo.h > >> +++ b/sysdeps/unix/sysv/linux/bits/siginfo.h > >> [...] > >> @@ -47,7 +47,7 @@ typedef union sigval > >>  #  define __SI_PAD_SIZE     ((__SI_MAX_SIZE / sizeof (int)) - 3) > >>  # endif > >> > >> -typedef struct siginfo > >> +typedef struct > >>    { > >>      int si_signo;            /* Signal number.  */ > >>      int si_errno;            /* If non-zero, an errno value associated with > >> [...] > > > > This change breaks GCC: > > > >    In file included from /scratch/tschwing/FM_sh-linux-gnu-mk2/src/gcc-mainline/libgcc/unwind-dw2.c:377:0: > >    ./md-unwind-support.h: In function 'sh_fallback_frame_state': > >    ./md-unwind-support.h:182:17: error: field 'info' has incomplete type > > > > In my case, this is really libgcc/config/sh/linux-unwind.h: > > > >    [...] > >       181            struct rt_sigframe { > >       182              struct siginfo info; > >       183              struct ucontext uc; > >       184            } *rt_ = context->cfa; > >    [...] > > POSIX says you get "siginto_t" *not* "struct siginfo," please fix the code. There is one usage in boehm-gc/os_dep.c, but it is only used if SUNOS5SIGS is defined, which it is only if one of SUNOS5, DRSNX, HPUX, or FREEBSD is defined, which are all not using Linux-based glibc ports. Likewise, gcc/ada/init.c has a struct __siginfo occurence, but only for __FreeBSD__. config/rs6000/linux-unwind.h uses ``char siginfo[128]'', and config/s390/linux-unwind.h also uses a constant. I tested the following patch for sh-linux-gnu. This only covers one configuration, but the change is pretty mechanic anyway and every place that used to refer to struct siginfo already must have had in its include path, which is the same file that declares siginfo_t. OK to commit? This should probably also go into any active release branches, to keep them buildable once this glibc change ripples through? libgcc/ * config/alpha/linux-unwind.h (alpha_fallback_frame_state): Use siginfo_t instead of struct siginfo. * config/bfin/linux-unwind.h (bfin_fallback_frame_state): Likewise. * config/i386/linux-unwind.h (x86_fallback_frame_state): Likewise. * config/ia64/linux-unwind.h (ia64_fallback_frame_state) (ia64_handle_unwabi): Likewise. * config/mips/linux-unwind.h (mips_fallback_frame_state): Likewise. * config/pa/linux-unwind.h (pa32_fallback_frame_state): Likewise. * config/sh/linux-unwind.h (shmedia_fallback_frame_state) (sh_fallback_frame_state): Likewise. * config/tilepro/linux-unwind.h (tile_fallback_frame_state): Likewise. * config/xtensa/linux-unwind.h (xtensa_fallback_frame_state): Likewise. Grüße, Thomas diff --git a/libgcc/config/alpha/linux-unwind.h b/libgcc/config/alpha/linux-unwind.h index 4c811dc..f747053 100644 --- a/libgcc/config/alpha/linux-unwind.h +++ b/libgcc/config/alpha/linux-unwind.h @@ -49,7 +49,7 @@ alpha_fallback_frame_state (struct _Unwind_Context *context, else if (pc[1] == 0x201f015f) /* lda $0,NR_rt_sigreturn */ { struct rt_sigframe { - struct siginfo info; + siginfo_t info; struct ucontext uc; } *rt_ = context->cfa; sc = &rt_->uc.uc_mcontext; diff --git a/libgcc/config/bfin/linux-unwind.h b/libgcc/config/bfin/linux-unwind.h index 88c8285..6e8f1ad 100644 --- a/libgcc/config/bfin/linux-unwind.h +++ b/libgcc/config/bfin/linux-unwind.h @@ -48,10 +48,10 @@ bfin_fallback_frame_state (struct _Unwind_Context *context, { struct rt_sigframe { int sig; - struct siginfo *pinfo; + siginfo_t *pinfo; void *puc; char retcode[8]; - struct siginfo info; + siginfo_t info; struct ucontext uc; } *rt_ = context->cfa; diff --git a/libgcc/config/i386/linux-unwind.h b/libgcc/config/i386/linux-unwind.h index f17a46c..33810c5 100644 --- a/libgcc/config/i386/linux-unwind.h +++ b/libgcc/config/i386/linux-unwind.h @@ -139,9 +139,9 @@ x86_fallback_frame_state (struct _Unwind_Context *context, { struct rt_sigframe { int sig; - struct siginfo *pinfo; + siginfo_t *pinfo; void *puc; - struct siginfo info; + siginfo_t info; struct ucontext uc; } *rt_ = context->cfa; /* The void * cast is necessary to avoid an aliasing warning. diff --git a/libgcc/config/ia64/linux-unwind.h b/libgcc/config/ia64/linux-unwind.h index 93f762d..baf80ee 100644 --- a/libgcc/config/ia64/linux-unwind.h +++ b/libgcc/config/ia64/linux-unwind.h @@ -47,7 +47,7 @@ ia64_fallback_frame_state (struct _Unwind_Context *context, struct sigframe { char scratch[16]; unsigned long sig_number; - struct siginfo *info; + siginfo_t *info; struct sigcontext *sc; } *frame_ = (struct sigframe *)context->psp; struct sigcontext *sc = frame_->sc; @@ -137,7 +137,7 @@ ia64_handle_unwabi (struct _Unwind_Context *context, _Unwind_FrameState *fs) struct sigframe { char scratch[16]; unsigned long sig_number; - struct siginfo *info; + siginfo_t *info; struct sigcontext *sc; } *frame = (struct sigframe *)context->psp; struct sigcontext *sc = frame->sc; diff --git a/libgcc/config/mips/linux-unwind.h b/libgcc/config/mips/linux-unwind.h index 02f7cd5..69d96f1 100644 --- a/libgcc/config/mips/linux-unwind.h +++ b/libgcc/config/mips/linux-unwind.h @@ -75,7 +75,7 @@ mips_fallback_frame_state (struct _Unwind_Context *context, struct rt_sigframe { u_int32_t ass[4]; /* Argument save space for o32. */ u_int32_t trampoline[2]; - struct siginfo info; + siginfo_t info; _sig_ucontext_t uc; } *rt_ = context->cfa; sc = &rt_->uc.uc_mcontext; diff --git a/libgcc/config/pa/linux-unwind.h b/libgcc/config/pa/linux-unwind.h index a0560e9..dd8f590 100644 --- a/libgcc/config/pa/linux-unwind.h +++ b/libgcc/config/pa/linux-unwind.h @@ -63,7 +63,7 @@ pa32_fallback_frame_state (struct _Unwind_Context *context, int i; struct sigcontext *sc; struct rt_sigframe { - struct siginfo info; + siginfo_t info; struct ucontext uc; } *frame; diff --git a/libgcc/config/sh/linux-unwind.h b/libgcc/config/sh/linux-unwind.h index 94ed95d..c1e1adb 100644 --- a/libgcc/config/sh/linux-unwind.h +++ b/libgcc/config/sh/linux-unwind.h @@ -80,9 +80,9 @@ shmedia_fallback_frame_state (struct _Unwind_Context *context, && (*(unsigned long *) (pc+11) == 0x6ff0fff0)) { struct rt_sigframe { - struct siginfo *pinfo; + siginfo_t *pinfo; void *puc; - struct siginfo info; + siginfo_t info; struct ucontext uc; } *rt_ = context->cfa; /* The void * cast is necessary to avoid an aliasing warning. @@ -179,7 +179,7 @@ sh_fallback_frame_state (struct _Unwind_Context *context, && (*(unsigned short *) (pc+14) == 0x00ad)))) { struct rt_sigframe { - struct siginfo info; + siginfo_t info; struct ucontext uc; } *rt_ = context->cfa; /* The void * cast is necessary to avoid an aliasing warning. diff --git a/libgcc/config/tilepro/linux-unwind.h b/libgcc/config/tilepro/linux-unwind.h index 0ed662c..27a6c43 100644 --- a/libgcc/config/tilepro/linux-unwind.h +++ b/libgcc/config/tilepro/linux-unwind.h @@ -61,7 +61,7 @@ tile_fallback_frame_state (struct _Unwind_Context *context, struct rt_sigframe { unsigned char save_area[C_ABI_SAVE_AREA_SIZE]; - struct siginfo info; + siginfo_t info; struct ucontext uc; } *rt_; diff --git a/libgcc/config/xtensa/linux-unwind.h b/libgcc/config/xtensa/linux-unwind.h index 32e9349..dda1f29 100644 --- a/libgcc/config/xtensa/linux-unwind.h +++ b/libgcc/config/xtensa/linux-unwind.h @@ -62,7 +62,7 @@ xtensa_fallback_frame_state (struct _Unwind_Context *context, struct sigcontext *sc; struct rt_sigframe { - struct siginfo info; + siginfo_t info; struct ucontext uc; } *rt_;