交叉编译GDB

PC主机安装必要软件

sudo apt-get install bison flex expect-dev build-essential m4 autoconf automake texi2html

源码下载

编译termcap

wget https://ftp.gnu.org/gnu/termcap/termcap-1.3.1.tar.gz
# 编译命令
./configure --host=armv7-fullhanv3-linux-gnueabihf --prefix=/opt/arm_root
make && make install 

make install的时候报错/usr/bin/install: cannot remove ‘/usr/include/termcap.h’: Permission denied 不用理它。

编译ncurses

./configure --prefix=/opt/arm_root --host=armv7-fullhanv3-linux-gnueabihf --with-shared
make && make install

make install时出错,可以手动把lib/目录下文件拷贝到install/lib目录。

编译gdb

wget https://ftp.gnu.org/gnu/gdb/gdb-8.2.1.tar.xz
# 编译命令
LDFLAGS="-L/opt/arm_root/lib" CFLAGS="-I/opt/arm_root/include" CXXFLAGS="-I/opt/arm_root/include" ./configure --host=armv7-fullhanv3-linux-gnueabihf --target=armv7-fullhanv3-linux-gnueabihf --prefix=/opt/arm_root --enable-static --disable-tui
make && make install

uclibc交叉编译出错处理

gdb交叉编译&&mips平台bug修改

参考

posted @ 2022-05-31 15:29  山岚2013  阅读(239)  评论(0编辑  收藏  举报