From: Doug Evans <dje@google.com>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: [RFA] Fix compiling amd64-linux-nat.c on old glibcs [was Re: new siginfo support doesn't build on glibc 2.2.2]
Date: Tue, 17 Mar 2009 01:56:00 -0000 [thread overview]
Message-ID: <e394668d0903161705u632e5fa2uada5860a110dafa0@mail.gmail.com> (raw)
On Mon, Feb 9, 2009 at 3:55 PM, Pedro Alves <pedro@codesourcery.com> 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 <dje@google.com>
* 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)
{
next reply other threads:[~2009-03-17 0:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-17 1:56 Doug Evans [this message]
2009-03-17 4:14 ` Pedro Alves
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e394668d0903161705u632e5fa2uada5860a110dafa0@mail.gmail.com \
--to=dje@google.com \
--cc=gdb-patches@sourceware.org \
--cc=pedro@codesourcery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox