1、下载termcap-1.3.1.tar.gz和gdb-7.5.tar.gz
2、编译termcap:
./configure --host=powerpc-none-linux-gnuspe --prefix=/home/admin/gdb/install/
修改Makefile:vim Makefile
---> CC = gcc ====> CC = powerpc-none-linux-gnuspe-gcc
AR = ar ====> AR = powerpc-none-linux-gnuspe-ar
RANLIB = ranlib ====> RANLIB = powerpc-none-linux-gnuspe-ranlib
make;
make install
3、拷贝头文件、库文件到交叉编译的默认路径下
powerpc-none-linux-gnuspe-gcc -print-file-name=libc.a ===>查看 交叉编译的默认路径 /opt/freescale/usr/local/gcc-4.3.74-eglibc-2.8.74-dp-2/powerpc-none-linux-
gnuspe/powerpc-none-linux-gnuspe/libc/usr/
cd /opt/freescale/usr/local/gcc-4.3.74-eglibc-2.8.74-dp-2/powerpc-none-linux-gnuspe/powerpc-none-linux-gnuspe/libc/usr
sudo cp /home/admin/gdb/install/include/* include
sudo cp /home/admin/gdb/install/lib/* lib
4、编译gdb-7.5 :
./configure --prefix=/home/admin/gdb/install/ --host=powerpc-none-linux-gnuspe
其中powerpc-none-linux-gnuspe为powerpc交叉编译工具前缀
make;
make install;
5、strip gdb :
cd /home/admin/gdb/install/bin/
powerpc-none-linux-gnuspe-strip gdb -o gdb-strip
6、编译应用程序时,必须加上编译选项 -g |