gdb编译问题记录

1300阅读 0评论2020-03-07 wzzushx
分类:LINUX

gdb交叉编译网上有很多教程,在编译时,会碰到一条错误:

 configure: error: no termcap library found

一般的解决是下载termcap代码,然后编译成目标系统的lib,放入目标系统编译环境中,  但是——————
   有时候发现这样做上面的错误提示还在,原因是,还要把ncurses源码下载下来,和termcap一样,编译成目标系统的lib,放入。。。,然后才行。(这句话是我花了4个晚上才搞定的,看到的同学要珍惜); https://invisible-mirror.net/archives/ncurses/
 ==================================附上编译的一些步骤======================
编译tercap: 以arm-linux为例:
./configure --host=arm-linux CC=arm-linux-gcc
编译出来后,.h,.a文件放入编译环境中,编译环境用这个命令查找: arm-linux-gcc --print-file-name libc.a ,
比如我的环境:/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi//sys-root/usr/

编译ncurses:
./configure --host=arm-linux CC=arm-linux-gcc --prefix=/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi/sys-root/usr/
make
make install

编译gdb-7.4
./configure --host=arm-linux --prefix="$PWD/../gdb"   --without-x --disable-gdbtk --disable-tui --without-included-regex --without-included-gettext CC=arm-linux-gcc
(来自https://www.cnblogs.com/souroot/p/5625516.html
我下载是gdb-7.8
在make过程失败
../../libiberty/libiberty.a(floatformat.o): In function `floatformat_to_double':
floatformat.c:(.text+0x838): undefined reference to `ldexp'
floatformat.c:(.text+0x8a8): undefined reference to `ldexp'
../../libiberty/libiberty.a(floatformat.o): In function `floatformat_from_double':
floatformat.c:(.text+0xce0): undefined reference to `frexp'
floatformat.c:(.text+0xdac): undefined reference to `ldexp'

后来发现有人遇到相同的问题,降低版本到7.7就没有问题了

上一篇:c语言特殊语法(六)typeof的用法
下一篇:Linux Wireless子系统初始化