移植gdb到海思3716板子的方法【转】

本文转载自:https://blog.csdn.net/yuhengyue/article/details/78414403

一,移植方法

环境:ubuntu12.04

交叉编译工具链路径:/opt/hisi-linux/x86-arm/arm-hisiv200-linux/target/bin

交叉编译工具链默认加载静态库路径:/opt/hisi-linux/x86-arm/arm-hisiv200-linux/target/usr/lib

步骤1:下载gdb源码,地址http://ftp.gnu.org/gnu/gdb/ 我下载的是gdb-7.6.tar.bz2。

步骤2:解压后进入目录,运行./configure --host=arm-hisiv200-linux --prefix=/usr/local/gdbarm --program-prefix=hisi3716,生成Makefile文件。

注意,arm-hisiv200-linux换成你实际的交叉编译工具链名称。

步骤3:执行make,

3.1,如果提示

In function 'bfd_fopen':
bfd.h:537:65: error: right-hand operand of comma expression has no effect [-Werror=unused-value]

这是因为源码中有些函数定义不规范,高版本的gcc编译时会报错。解决办法是在./configure 后面加上--disable-werror

3.2,重新make,如果提示找不到libtermcap.a。下载termcap库源代码,地址http://ftp.gnu.org/gnu/termcap/ 我下载的是termcap-1.3.1.tar.gz。

解压后进入目录,运行./configure --host=arm-hisiv200-linux --prefix=/usr/local/termcaparm。然后make & make install。如果顺利,则生成arm架构的libtermcap.a。

如果你像我一样,提示找不到autoconf,那么直接apt-get install autoconf即可。

如果还提示找不到makeinfo,则直接apt-get install texinfo就行。

将编译好的libtermcap.a放到x86-arm/arm-hisiv200-linux/target/usr/lib下。

注意,如果你的工具链不是这个路径,那么你找下里面有没有/usr/lib目录,有的话把库放那里。

再次重新对gdb make &make install,成功!

祝君好运。

猜你喜欢

转载自www.cnblogs.com/zzb-Dream-90Time/p/9626637.html