1、以4.3.2版本的編譯器為例 將arm-linux-gcc-4.3.2.tar.bz2放在/work目錄下 解壓縮: sudo tar jxvf /work/arm-linux-gcc-4.3.2.tar.bz2 -C / 添加環境變數: sudo vi /etc/environment 註釋掉 ...
1、以4.3.2版本的編譯器為例
將arm-linux-gcc-4.3.2.tar.bz2放在/work目錄下
解壓縮:
sudo tar jxvf /work/arm-linux-gcc-4.3.2.tar.bz2 -C /
添加環境變數:
sudo vi /etc/environment
註釋掉原有的環境變數
#PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/work/tools/gcc-3.4.5-glibc-2.3.6/bin"
增加新的環境變數並保存
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/arm/4.3.2/bin/"
使生效
source /etc/environment檢查是否成功
book@book-desktop:/usr/local/arm/4.3.2/bin$ 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)
2、更換3.4.5版本的編譯器
將arm-linux-gcc-3.4.5-glibc-2.3.6.tar.bz2放置在/work目錄
解壓縮
sudo tar jxvf /work/arm-linux-gcc-3.4.5-glibc-2.3.6.tar.bz2 -C /
更改環境變數
sudo vi /etc/environment
註釋掉原來的環境變數,增加新的環境變數
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/gcc-3.4.5-glibc-2.3.6/bin"
使生效
source /etc/environment
檢查是否成功
book@book-desktop:/gcc-3.4.5-glibc-2.3.6/bin$ arm-linux-gcc -v
Reading specs from /gcc-3.4.5-glibc-2.3.6/bin/../lib/gcc/arm-linux/3.4.5/specs
Configured with:
/work/tools/create_crosstools/crosstool-0.43/build/arm-linux/gcc-3.4.5-glibc-2.3.6/gcc-3.4.5/configure
--target=arm-linux --host=i686-host_pc-linux-gnu
--prefix=/work/tools/gcc-3.4.5-glibc-2.3.6 --with-float=soft
--with-headers=/work/tools/gcc-3.4.5-glibc-2.3.6/arm-linux/include
--with-local-prefix=/work/tools/gcc-3.4.5-glibc-2.3.6/arm-linux
--disable-nls --enable-threads=posix --enable-symvers=gnu
--enable-__cxa_atexit --enable-languages=c,c++ --enable-shared
--enable-c99 --enable-long-long
Thread model: posix
gcc version 3.4.5