From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13499 invoked by alias); 17 Mar 2009 00:05:17 -0000 Received: (qmail 13491 invoked by uid 22791); 17 Mar 2009 00:05:16 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.33.17) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 17 Mar 2009 00:05:07 +0000 Received: from wpaz33.hot.corp.google.com (wpaz33.hot.corp.google.com [172.24.198.97]) by smtp-out.google.com with ESMTP id n2H053hJ026965 for ; Tue, 17 Mar 2009 00:05:04 GMT Received: from rv-out-0506.google.com (rvbk40.prod.google.com [10.140.87.40]) by wpaz33.hot.corp.google.com with ESMTP id n2H04lGp020022 for ; Mon, 16 Mar 2009 17:05:01 -0700 Received: by rv-out-0506.google.com with SMTP id k40so3069995rvb.29 for ; Mon, 16 Mar 2009 17:05:01 -0700 (PDT) MIME-Version: 1.0 Received: by 10.141.27.16 with SMTP id e16mr2575747rvj.219.1237248301218; Mon, 16 Mar 2009 17:05:01 -0700 (PDT) Date: Tue, 17 Mar 2009 01:56:00 -0000 Message-ID: Subject: [RFA] Fix compiling amd64-linux-nat.c on old glibcs [was Re: new siginfo support doesn't build on glibc 2.2.2] From: Doug Evans To: Pedro Alves Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-03/txt/msg00290.txt.bz2 On Mon, Feb 9, 2009 at 3:55 PM, Pedro Alves wrote: > On Monday 09 February 2009 21:07:41, Doug Evans wrote: >> fyi, glibc 2.2.2 doesn't have si_timerid, si_overrun. compilation of >> amd64-linux-nat.c fails. > > Bummer. According to sigaction(2), those exist only since kernel > 2.6. Those are defines, we could #ifdef on them, assuming we're > ok with a gdb built on that platform and then moved to some more > recent glibc will not translate those fields. > > I don't know if the siginfo layout in that version is the same > as defined by the gdbarch callback, or even if your glibc's siginfo_t > declaration matches your kernel's siginfo_t object layout --- there's > a history of breakage on these matters. > >> Dunno how old a glibc we intend to support for 7.0. > > Could you try ifdefing those fields, and see what comes out of > $_siginfo; and taking a peek at your headers, to see if we're > doing something reasonable? We have a couple of siginfo related > testcases that may help as small test apps. > > -- > Pedro Alves > How about this? 2009-03-16 Doug Evans * amd64-linux-nat.c (si_timerid,si_overrun): Provide definition for glibc 2.3.2 and earlier. Index: amd64-linux-nat.c =================================================================== RCS file: /cvs/src/src/gdb/amd64-linux-nat.c,v retrieving revision 1.24 diff -u -p -u -p -r1.24 amd64-linux-nat.c --- amd64-linux-nat.c 23 Feb 2009 00:03:48 -0000 1.24 +++ amd64-linux-nat.c 17 Mar 2009 00:00:40 -0000 @@ -501,6 +501,15 @@ typedef struct compat_siginfo #define cpt_si_band _sifields._sigpoll._band #define cpt_si_fd _sifields._sigpoll._fd +/* glibc at least up to 2.3.2 doesn't have si_timerid, si_overrun. + In their place is si_timer1,si_timer2. */ +#ifndef si_timerid +#define si_timerid si_timer1 +#endif +#ifndef si_overrun +#define si_overrun si_timer2 +#endif + static void compat_siginfo_from_siginfo (compat_siginfo_t *to, siginfo_t *from) {