linux powerpc 交叉編譯gdb
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