目录
arm-linux-gcc-4.3.2.tgz大约84M,为已经编译好的交叉编译链工具。
arm-linux-gcc-4.3.2下载地址:[download title=”本地下载”]https://pan.baidu.com/s/1eRDJrzW[/download]密码:tkrl
配置root用户环境
[root@Hebut ~]#mv arm-linux-gcc-4.3.2.tgz /tmp [root@Hebut ~]#cd /tmp [root@Hebut tmp]#tar xvzf arm-linux-gcc-4.3.2 -C /
解压命令必须要有-C而且是大写的,后面有个空格也要注意。解压完毕自动生成/usr/local/arm /4.3.2文件夹,然后配置下编译环境路径:
[root@Hebut tmp]#gedit /root/.bashrc //最后一行添加代码 export PATH=/usr/local/arm/4.3.2/bin:$PATH //保存文件退出编辑,登出系统确保配置生效 [root@Hebut tmp]#logout
root用户通过 arm-linux-gcc -v验证是否成功。
配置普通用户环境
[user@Hebut ~]$vi .bashrc //最后一行添加代码 export PATH=$PATH:/usr/local/arm/4.3.2/bin [user@Hebut ~]$gedit /etc/profile //最后一行添加代码 PATH=$PATH:/usr/local/arm/4.3.2/bin [user@Hebut ~]$source /etc/profile [user@Hebut ~]$logout
验证(root或者普通用户均可)
[root@Hebut ~]# arm-linux-gcc -v Using built-in specs. Target: arm-none-linux-gnueabi Configured with: /scratch/julian/lite-respin/linux/src/gcc-4.3/configure --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=arm-none-linux-gnueabi --enable-threads --disable-libmudflap --disable-libssp --disable-libstdcxx-pch --with-gnu-as --with-gnu-ld --enable-languages=c,c++ --enable-shared --enable-symvers=gnu --enable-__cxa_atexit --with-pkgversion='Sourcery G++ Lite 2008q3-72' --with-bugurl=https://support.codesourcery.com/GNUToolchain/ --disable-nls --prefix=/opt/codesourcery --with-sysroot=/opt/codesourcery/arm-none-linux-gnueabi/libc --with-build-sysroot=/scratch/julian/lite-respin/linux/install/arm-none-linux-gnueabi/libc --with-gmp=/scratch/julian/lite-respin/linux/obj/host-libs-2008q3-72-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr --with-mpfr=/scratch/julian/lite-respin/linux/obj/host-libs-2008q3-72-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr --disable-libgomp --enable-poison-system-directories --with-build-time-tools=/scratch/julian/lite-respin/linux/install/arm-none-linux-gnueabi/bin --with-build-time-tools=/scratch/julian/lite-respin/linux/install/arm-none-linux-gnueabi/bin Thread model: posix gcc version 4.3.2 (Sourcery G++ Lite 2008q3-72)