我想将 gdb 8.2 交叉编译到一个 arm64 设备中。 这是我要做的步骤:
/usr/include/x86_64-linux-gnu/asm/sigcontext.h:40:8: error: redefinition of ‘struct _fpx_sw_bytes’
40 | struct _fpx_sw_bytes {
| ^~~~~~~~~~~~~
In file included from /usr/include/signal.h:291,
from build-gnulib/import/signal.h:52,
from ../../gdb/linux-nat.h:23,
from ../../gdb/aarch64-linux-nat.c:26:
/usr/include/x86_64-linux-gnu/bits/sigcontext.h:31:8: note: previous definition of ‘struct _fpx_sw_bytes’
31 | struct _fpx_sw_bytes
| ^~~~~~~~~~~~~
In file included from ../../gdb/nat/aarch64-sve-linux-ptrace.h:23,
from ../../gdb/aarch64-linux-nat.c:35:
/usr/include/x86_64-linux-gnu/asm/sigcontext.h:85:8: error: redefinition of ‘struct _fpreg’
85 | struct _fpreg {
| ^~~~~~
In file included from /usr/include/signal.h:291,
from build-gnulib/import/signal.h:52,
from ../../gdb/linux-nat.h:23,
from ../../gdb/aarch64-linux-nat.c:26:
/usr/include/x86_64-linux-gnu/bits/sigcontext.h:40:8: note: previous definition of ‘struct _fpreg’
40 | struct _fpreg
| ^~~~~~
In file included from ../../gdb/nat/aarch64-sve-linux-ptrace.h:23,
from ../../gdb/aarch64-linux-nat.c:35:
/usr/include/x86_64-linux-gnu/asm/sigcontext.h:91:8: error: redefinition of ‘struct _fpxreg’
91 | struct _fpxreg {
| ^~~~~~~
In file included from /usr/include/signal.h:291,
from build-gnulib/import/signal.h:52,
from ../../gdb/linux-nat.h:23,
from ../../gdb/aarch64-linux-nat.c:26:
/usr/include/x86_64-linux-gnu/bits/sigcontext.h:46:8: note: previous definition of ‘struct _fpxreg’
46 | struct _fpxreg
| ^~~~~~~
In file included from ../../gdb/nat/aarch64-sve-linux-ptrace.h:23,
from ../../gdb/aarch64-linux-nat.c:35:
/usr/include/x86_64-linux-gnu/asm/sigcontext.h:98:8: error: redefinition of ‘struct _xmmreg’
98 | struct _xmmreg {
| ^~~~~~~
In file included from /usr/include/signal.h:291,
from build-gnulib/import/signal.h:52,
from ../../gdb/linux-nat.h:23,
from ../../gdb/aarch64-linux-nat.c:26:
/usr/include/x86_64-linux-gnu/bits/sigcontext.h:53:8: note: previous definition of ‘struct _xmmreg’
53 | struct _xmmreg
| ^~~~~~~
In file included from ../../gdb/nat/aarch64-sve-linux-ptrace.h:23,
from ../../gdb/aarch64-linux-nat.c:35:
/usr/include/x86_64-linux-gnu/asm/sigcontext.h:180:8: error: redefinition of ‘struct _ymmh_state’
180 | struct _ymmh_state {
| ^~~~~~~~~~~
In file included from /usr/include/signal.h:291,
from build-gnulib/import/signal.h:52,
from ../../gdb/linux-nat.h:23,
from ../../gdb/aarch64-linux-nat.c:26:
/usr/include/x86_64-linux-gnu/bits/sigcontext.h:184:8: note: previous definition of ‘struct _ymmh_state’
184 | struct _ymmh_state
| ^~~~~~~~~~~
In file included from ../../gdb/nat/aarch64-sve-linux-ptrace.h:23,
from ../../gdb/aarch64-linux-nat.c:35:
/usr/include/x86_64-linux-gnu/asm/sigcontext.h:192:8: error: redefinition of ‘struct _xstate’
192 | struct _xstate {
| ^~~~~~~
In file included from /usr/include/signal.h:291,
from build-gnulib/import/signal.h:52,
from ../../gdb/linux-nat.h:23,
from ../../gdb/aarch64-linux-nat.c:26:
/usr/include/x86_64-linux-gnu/bits/sigcontext.h:189:8: note: previous definition of ‘struct _xstate’
189 | struct _xstate
| ^~~~~~~
In file included from ../../gdb/nat/aarch64-sve-linux-ptrace.h:23,
from ../../gdb/aarch64-linux-nat.c:35:
/usr/include/x86_64-linux-gnu/asm/sigcontext.h:317:8: error: redefinition of ‘struct sigcontext’
317 | struct sigcontext {
| ^~~~~~~~~~
In file included from /usr/include/signal.h:291,
from build-gnulib/import/signal.h:52,
from ../../gdb/linux-nat.h:23,
from ../../gdb/aarch64-linux-nat.c:26:
/usr/include/x86_64-linux-gnu/bits/sigcontext.h:139:8: note: previous definition of ‘struct sigcontext’
139 | struct sigcontext
| ^~~~~~~~~~
In file included from ../../gdb/nat/aarch64-sve-linux-ptrace.h:29,
from ../../gdb/aarch64-linux-nat.c:35:
../../gdb/nat/aarch64-sve-linux-sigcontext.h:25:22: error: field ‘head’ has incomplete type ‘_aarch64_ctx’
25 | struct _aarch64_ctx head;
| ^~~~
../../gdb/nat/aarch64-sve-linux-sigcontext.h:25:9: note: forward declaration of ‘struct _aarch64_ctx’
25 | struct _aarch64_ctx head;
| ^~~~~~~~~~~~
../../gdb/aarch64-linux-nat.c: In function ‘void fetch_fpregs_from_thread(regcache*)’:
../../gdb/aarch64-linux-nat.c:320:37: error: ‘elf_fpregset_t’ {aka ‘struct user_fpregs_struct’} has no member named ‘vregs’
320 | regcache->raw_supply (regno, ®s.vregs[regno - AARCH64_V0_REGNUM]);
| ^~~~~
../../gdb/aarch64-linux-nat.c:322:56: error: ‘elf_fpregset_t’ {aka ‘struct user_fpregs_struct’} has no member named ‘fpsr’
322 | regcache->raw_supply (AARCH64_FPSR_REGNUM, ®s.fpsr);
| ^~~~
../../gdb/aarch64-linux-nat.c:323:56: error: ‘elf_fpregset_t’ {aka ‘struct user_fpregs_struct’} has no member named ‘fpcr’
323 | regcache->raw_supply (AARCH64_FPCR_REGNUM, ®s.fpcr);
| ^~~~
../../gdb/aarch64-linux-nat.c: In function ‘void store_fpregs_to_thread(const regcache*)’:
../../gdb/aarch64-linux-nat.c:368:29: error: ‘elf_fpregset_t’ {aka ‘struct user_fpregs_struct’} has no member named ‘vregs’
368 | (regno, (char *) ®s.vregs[regno - AARCH64_V0_REGNUM]);
| ^~~~~
../../gdb/aarch64-linux-nat.c:371:61: error: ‘elf_fpregset_t’ {aka ‘struct user_fpregs_struct’} has no member named ‘fpsr’
371 | regcache->raw_collect (AARCH64_FPSR_REGNUM, (char *) ®s.fpsr);
| ^~~~
../../gdb/aarch64-linux-nat.c:373:61: error: ‘elf_fpregset_t’ {aka ‘struct user_fpregs_struct’} has no member named ‘fpcr’
373 | regcache->raw_collect (AARCH64_FPCR_REGNUM, (char *) ®s.fpcr);
| ^~~~
最奇怪的是,如果我不配置--host=aarch64-linux-gnu,编译就OK了。 但是我想把“gdb”放到我的开发板上,我该如何解决这个错误? 我不知道为什么。请帮忙。
如何解决这个重新定义的错误?