[gdb/build] Fix x86_64 x32 build
authorTom de Vries <tdevries@suse.de>
Mon, 22 Nov 2021 11:21:46 +0000 (12:21 +0100)
committerTom de Vries <tdevries@suse.de>
Mon, 22 Nov 2021 11:21:46 +0000 (12:21 +0100)
commita92d031d7ef6e192fb404a86d53fa834e1e3eb8c
treeec138f68311e43efd9ef3664b42c38dd5445674e
parent577bf39f10c6d50a52866eb8fc32d6d1e34bb215
[gdb/build] Fix x86_64 x32 build

A build error on x86_64 with x32 abi was reported here (
https://sourceware.org/pipermail/gdb/2021-November/049787.html ):
...
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
| ^~~~~~~~~~~
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;
| ^~~~~~~~~~~~
...

The problem is that code added in commit d3d7d1ba3bb "[gdb/tdep] Handle
si_addr_bnd in compat_siginfo_from_siginfo" doesn't compile on an x86_64 x32
setup, because compat_x32_siginfo_t doesn't have the si_addr_bnd fields.

Fix this conservatively by disabling the code for x32.

Tested on x86_64-linux.
gdb/nat/amd64-linux-siginfo.c