最好用最近的arm-linux-gcc版本
download cross-3.2.tar.gz
download gdb6.8.tar.gz
and copy them to /usr/src
Follow is root user
1 Install arm-linux-gcc
tar xf cross-3.2.tar.gz && cd usr/local&&mv arm /usr/local/arm
now you can use arm-linux-gcc in /usr/local/arm/bin
sudo gedit /etc/bash.bashrc
#add this at the end of bash.bashrc
if [ -d /usr/local/arm/gnuarm4.1.1 ]; then
PATH=/usr/local/arm/gnuarm4.1.1/bin:"${PATH}"
fi
2 Install arm-linux-gdb
mkdir /usr/src/arm
cd /usr/src/arm
export PATH=$PATH:/usr/local/arm/bin
#add your arm-linux-* in your path
./configure --target=arm-linux --prefix=/usr/src/arm
make &&make install
#--target指定编译后的文件针对的是什么目标 ,example arm-elf mips-linux armv5-linux-uclibc
#--prefix参数就可以方便的移植到别的平台,其实就是你要安装到的地方
#--host指定编译后的文件的运行环境,取值可以是i386-linux或者交叉编译器的前缀,缺省为i386-linux
--------------------------------my error for arm-linux-gdb---------
if you make return No curses/termcap library found
you must install ncurses for termcap-compat in ubuntu
Install arm-linux-gdb
wget
http://www.sfr-fresh.com/unix/misc/ncurses-5.6.tar.gz
cd binutils-2.18
sudo make &&sudo make install
-----------------------------------------------------------------------------
If you finish you can find
arm-linux-gdb arm-linux-gdbtui arm-linux-run in
/usr/src/arm/bin
3 Install gdbserver
export PATH=$PATH:/usr/local/arm/bin
#add your arm-linux-* in your path
/usr/src/gdb-6.8/gdb/gdbserver/configure --target=arm-linux --prefix=/usr/src/arm-gdbsever
make
If you finish successful , you can find gdbserver gdbreplay in /usr/src/arm-gdbserver
Good Luck