Ubuntu下arm-Linux-gcc交叉编译环境搭建
参考:http://blog.csdn.net/hebbely/article/details/53992805
1、网上下载arm-linux-gcc-4.4.3.tar.gz
可以在这下载:http://download.csdn.net/download/zlyong0018/4646377
2、解压
sudo tar -xvlfarm-linux-gcc-4.4.3.tar.gz
3、新建目录
sudo mkdir /usr/local/arm_4.4.3
4、移动文件到目录arm_4.4.3
sudo mv /opt/FriendlyARM/toolschain/4.4.3/* /usr/local/arm_4.4.3
5、配置环境变量PATH,有4种方法
export PATH=$PATH:/usr/local/arm_4.4.3/bin
export PATH
2>source/etc/bash.bashrc
export PATH=$PATH:/usr/local/arm_4.4.3/bin
source /etc/profile
C. 直接 export法
直接执行命令:export PATH=$PATH:/usr/local/arm_4.4.3/bin
(注意,如果你关闭了终端,或者新建一个终端,需要重新执行一下这个命令。)
1>sudo gedit /etc/environment
原文件为:
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
将其修改为:
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/local/arm_4.4.3/bin"
2>source/etc/environment
source命令也称为“点命令”,也就是一个点符号(.)。source命令通常用于重新执行刚修改的初始化文件,使之立即生效,而不必注销并重新登录。
6、检查是否将路径加入到PATH
echo $PATH
7、检查是否安装完成:#:arm-linux-gcc -v,此时应打印出交叉编译工具的一些信息,则安装成功。
- root@ubuntu:/usr/local/arm_4.4.3/arm-none-linux-gnueabi#arm-linux-gcc-v @H_2_502@Usingbuilt-inspecs.
- Target:arm-none-linux-gnueabi @H_2_502@Configuredwith:/opt/FriendlyARM/mini2440/build-toolschain/working/src/gcc-4.4.3/configure--build=i386-build_redhat-linux-gnu--host=i386-build_redhat-linux-gnu--target=arm-none-linux-gnueabi--prefix=/opt/FriendlyARM/toolschain/4.4.3--with-sysroot=/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi//sys-root--enable-languages=c,c++--disable-multilib--with-arch=armv4t--with-cpu=arm920t--with-tune=arm920t--with-float=soft--with-pkgversion=ctng-1.6.1--disable-sjlj-exceptions--enable-__cxa_atexit--with-gmp=/opt/FriendlyARM/toolschain/4.4.3--with-mpfr=/opt/FriendlyARM/toolschain/4.4.3--with-ppl=/opt/FriendlyARM/toolschain/4.4.3--with-cloog=/opt/FriendlyARM/toolschain/4.4.3--with-mpc=/opt/FriendlyARM/toolschain/4.4.3--with-local-prefix=/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi//sys-root--disable-nls--enable-threads=posix--enable-symvers=gnu--enable-c99--enable-long-long--enable-target-optspace
- Threadmodel:posix @H_2_502@gccversion4.4.3(ctng-1.6.1)