关于 使用不同的交叉编译工具链,对gdb-8.1.1进行编译的结果

gdb-8.1.1解压编译,使用厂家自带交叉编译工具
../configure CC=aarch64-buildroot-linux-gnu-gcc -host=aarch64-buildroot-linux-gnu -target=aarch64-buildroot-linux-gnu
make
make报错:
In file included from ../../gdb/nat/linux-ptrace.c:20:
../../gdb/nat/linux-ptrace.h:180:22: 错误:expected identifier before numeric constant
180 | # define TRAP_HWBKPT 4
| ^
../../gdb/nat/linux-ptrace.h:180:22: 错误:expected ‘}’ before numeric constant
In file included from /media/harddisk1/ema/3ok3568/rk356x_linux/buildroot/output/rockchip_rk3568_med3568/host/aarch64-buildroot-linux-gnu/sysroot/usr/include/signal.h:58,
from build-gnulib/import/signal.h:52,
from /media/harddisk1/ema/3ok3568/rk356x_linux/buildroot/output/rockchip_rk3568_med3568/host/aarch64-buildroot-linux-gnu/sysroot/usr/include/sys/wait.h:36,
from ../../gdb/common/gdb_wait.h:23,
from ../../gdb/nat/linux-ptrace.c:24:
/media/harddisk1/ema/3ok3568/rk356x_linux/buildroot/output/rockchip_rk3568_med3568/host/aarch64-buildroot-linux-gnu/sysroot/usr/include/bits/siginfo-consts.h:156:1: 附注:to match this ‘{’
156 | {
| ^
In file included from ../../gdb/nat/linux-ptrace.c:20:
../../gdb/nat/linux-ptrace.h:180:22: 错误:expected unqualified-id before numeric constant
180 | # define TRAP_HWBKPT 4
| ^
In file included from /media/harddisk1/ema/3ok3568/rk356x_linux/buildroot/output/rockchip_rk3568_med3568/host/aarch64-buildroot-linux-gnu/sysroot/usr/include/features.h:450,
from /media/harddisk1/ema/3ok3568/rk356x_linux/buildroot/output/rockchip_rk3568_med3568/host/aarch64-buildroot-linux-gnu/sysroot/usr/include/bits/libc-header-start.h:33,
from /media/harddisk1/ema/3ok3568/rk356x_linux/buildroot/output/rockchip_rk3568_med3568/host/aarch64-buildroot-linux-gnu/sysroot/usr/include/stdio.h:27,
from build-gnulib/import/stdio.h:43,
from ../../gdb/common/common-defs.h:52,
from ../../gdb/nat/linux-ptrace.c:19:
/media/harddisk1/ema/3ok3568/rk356x_linux/buildroot/output/rockchip_rk3568_med3568/host/aarch64-buildroot-linux-gnu/sysroot/usr/include/sys/wait.h:158:1: 错误:expected declaration before ‘}’ token
158 | __END_DECLS
| ^~~~~~~~~~~
Makefile:1643: recipe for target 'linux-ptrace.o' failed
make[2]: *** [linux-ptrace.o] Error 1
make[2]: 离开目录“/opt/opensource/gdb-8.1.1/build-buildroot/gdb”
Makefile:9126: recipe for target 'all-gdb' failed
make[1]: *** [all-gdb] Error 2
make[1]: 离开目录“/opt/opensource/gdb-8.1.1/build-buildroot”
Makefile:849: recipe for target 'all' failed
make: *** [all] Error 2

解决方法:https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/commit/e6600bbefd667810744fbe8eed3830bf5644c354

 

gdb-8.1.1解压编译,使用自下载gcc-linaro工具
../configure CC=aarch64-linux-gnu-gcc -host=aarch64-linux-gnu -target=aarch64-linux-gnu
make

 

posted @ 2022-11-07 14:12  果园2018  阅读(788)  评论(0编辑  收藏  举报