Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries via Gdb-patches <gdb-patches@sourceware.org>
To: Jan Palus <atler@pld-linux.org>,
	"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: Build failure on x32 (gdb 11.1)
Date: Mon, 22 Nov 2021 07:46:25 +0100	[thread overview]
Message-ID: <d717a5b5-a56a-89e3-9093-30783fbbb34c@suse.de> (raw)
In-Reply-To: <20211121194556.nreowfixabal5ebj@pine>

[-- Attachment #1: Type: text/plain, Size: 1133 bytes --]

On 11/21/21 8:45 PM, Jan Palus wrote:
> gdb 11.1 fails during compilation on x32 ABI:
> 
> ../.././gdbserver/../gdb/nat/amd64-linux-siginfo.c:280:42: error: 'struct compat_x32_siginfo_t::<unnamed union>::<unnamed>' has no member named 'si_addr_bnd'
> 280 | #define cpt_si_lower _sifields._sigfault.si_addr_bnd._lower
> | ^~~~~~~~~~~
> ../.././gdbserver/../gdb/nat/amd64-linux-siginfo.c:337:38: note: in expansion of macro 'cpt_si_lower'
> 337 | to->cpt_si_lower = from_ptrace.cpt_si_lower;
> | ^~~~~~~~~~~~
> ../.././gdbserver/../gdb/nat/amd64-linux-siginfo.c:281:42: error: 'struct compat_x32_siginfo_t::<unnamed union>::<unnamed>' has no member named 'si_addr_bnd'
> 281 | #define cpt_si_upper _sifields._sigfault.si_addr_bnd._upper
> | ^~~~~~~~~~~
> ../.././gdbserver/../gdb/nat/amd64-linux-siginfo.c:338:38: note: in expansion of macro 'cpt_si_upper'
> 338 | to->cpt_si_upper = from_ptrace.cpt_si_upper;
> | ^~~~~~~~~~~~
> 
> I believe it is caused by https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=d3d7d1b

Hi,

I've attached a conservative fix, can you check whether that fixes the
build breaker?

Thanks,
- Tom

[-- Attachment #2: tmp.patch --]
[-- Type: text/x-patch, Size: 868 bytes --]

diff --git a/gdb/nat/amd64-linux-siginfo.c b/gdb/nat/amd64-linux-siginfo.c
index 342840e5085..fc52b5b6056 100644
--- a/gdb/nat/amd64-linux-siginfo.c
+++ b/gdb/nat/amd64-linux-siginfo.c
@@ -330,6 +330,9 @@ compat_siginfo_from_siginfo (compat_siginfo_t *to, const siginfo_t *from)
       to->cpt_si_pid = from_ptrace.cpt_si_pid;
       to->cpt_si_uid = from_ptrace.cpt_si_uid;
     }
+#ifndef __ILP32__
+  /* The struct compat_x32_siginfo_t doesn't contain
+     cpt_si_lower/cpt_si_upper.  */
   else if (to->si_code == SEGV_BNDERR
 	   && to->si_signo == SIGSEGV)
     {
@@ -337,6 +340,7 @@ compat_siginfo_from_siginfo (compat_siginfo_t *to, const siginfo_t *from)
       to->cpt_si_lower = from_ptrace.cpt_si_lower;
       to->cpt_si_upper = from_ptrace.cpt_si_upper;
     }
+#endif
   else if (to->si_code < 0)
     {
       to->cpt_si_pid = from_ptrace.cpt_si_pid;

       reply	other threads:[~2021-11-22  6:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20211121194556.nreowfixabal5ebj@pine>
2021-11-22  6:46 ` Tom de Vries via Gdb-patches [this message]
2021-11-22  8:38   ` Jan Palus
2021-11-22 11:23     ` [pushed][gdb/build] Fix x86_64 x32 build Tom de Vries via Gdb-patches

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=d717a5b5-a56a-89e3-9093-30783fbbb34c@suse.de \
    --to=gdb-patches@sourceware.org \
    --cc=atler@pld-linux.org \
    --cc=tdevries@suse.de \
    /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