GDB ARM Llinux移植、编译错误记录

1、编译配置

./configure --host=aarch64-rockchip-linux-gnu --target=aarch64-rockchip-linux-gnu --prefix=${PWD}/output
make -j8
make install
aarch64-rockchip-linux-gnu-strip output/gdb #去除符号,减小程序体积

若在PC机上运行,则--host不要指定;若在ARM板上运行则需要指定。gdbserver编译同理。通常gdb可以编译为PC上运行,gdbserver编译为arm板上运行

2、出现bfd头文件定义错误

--disable-werror

3、error: no termcap library found
checking for library containing gethostbyname… none required
checking for library containing socketpair… none required
checking for library containing waddstr… no
checking for library containing dlgetmodinfo… no
checking for library containing tgetent… no
configure: error: no termcap library found
make[1]: *** [configure-gdb] 错误 1
上述错误的原因是:缺少前置文件,执行安装:sudo apt-get install libncurses5-dev
安装过程如果出现texinfo相关的错误,则请执行:sudo apt-get install texinfo
正确安装后,会在指定安装路径下生成:bin、include、lib、share文件夹
在文件/etc/profile最后加上export PATH=$PATH:/opt/arm-gdb/bin 使刚配置的环境变量生效: source/etc/profile
注意如果之前安装的arm-linux-gcc里面也存在gdb的话,为了使用刚刚安装的7.5版本gdb,应将gdb7.5添加在gcc的环境变量前面。保证优先使用gdb7.5而不是gcc套件里的gdb

4、如果出现出现各种奇怪错误,网上无法查到,建议更换GDB版本,由于GCC版本问题,新旧GDB交叉编译存在编译不兼容的问题

参考:

https://blog.csdn.net/capture_bbom/article/details/64437791

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值