arm单板上移植gdb

虚拟机 : vmware 12 

image: ubuntukylin 14.04.1 

系统版本:Linux dancy 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:12 UTC 2014 i686 i686 i686 GNU/Linux

 

虚拟机安装好之后,安装一下基本的工具环境

sudo apt-get update

sudo apt-get install build-essential

 

arm交叉编译工具链: arm-none-linux-gnueabi , 下载地址 http://www.veryarm.com/cross-tools ,选择 2012.09 月的版本

gdb 源码下载地址: http://ftp.gnu.org/gnu/gdb/

我下载了 gdb-7.4.1.tar.bz2 ,解压进入代码目录:

./configure --host=arm-none-linux-gnueabi

 

貌似很正常,开始make

然而过了一会,就会出现 

configure: WARNING: no enhanced curses library found; disabling TUI
checking for library containing tgetent... no
configure: error: no termcap library found

 

网上找了很多方法,都不管用

比如安装ncurses库: sudo  apt-get install libncurses5-dev, 装了也没用

 

比如下载 termcap-1.3.1.tar.gz 编译 放入到 工具链的 /lib目录,比如 /home/arm-2012.09/arm-none-linux-gnueabi/lib  也是没用的,于是我仔细的想上面的错误信息,在configure的过程里,应该首先是使用ncurses库,没找到呢,也不会继续找termcap库,所以

 

下载 ncurses-5.5-tar.gz 编译安装如下,这个问题总算解决了。

下载地址: http://ftp.gnu.org/gnu/ncurses/

./configure --host=arm-none-linux-gnueabi --prefix=/home/arm-2012.09/arm-none-linux-gnueabi

make

make install

 

这个时候,再去make gdb就不会出上面的错误了,然而事情并不会那么简单,后面会继续出现新的问题。

In file included from arm-linux-nat.c:25:0:
linux-nat.h:79:18: error: field 'siginfo' has incomplete type
arm-linux-nat.c: In function 'arm_linux_stopped_data_address':
arm-linux-nat.c:1141:23: error: dereferencing pointer to incomplete type
arm-linux-nat.c:1144:16: error: dereferencing pointer to incomplete type
arm-linux-nat.c:1145:20: error: dereferencing pointer to incomplete type
arm-linux-nat.c:1157:46: error: dereferencing pointer to incomplete type

这里应该是源码跟linux系统的头文件匹配不上啦,有人建议修改这个siginfo为siginfo_t这个结构体,但是我觉得没必要去修改了,直接下载了 gdb-7.6.1.tar.gz 编译OK

编译命令:

./configure --host=arm-none-linux-gnueabi

make

make install

 

然后在源码的gdb目录就可以看到gdb可执行文件:

dancy@dancy:~/downloads/gdb-7.6.1/gdb$ file gdb
gdb: ELF 32-bit LSB  executable, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, not stripped

 

posted @ 2017-09-11 14:56  丹西  阅读(843)  评论(0编辑  收藏  举报