(一) odroid-xu4交叉编译过程

目录

文章目录

  • 目录
  • 前言
  • Toolchain安装过程
  • 总结

前言

现在转到ODROID-xu4的平台,需要安装ODROID-xu4的交叉编译环境,特此记录!
本文参照ODROID Wiki

Toolchain安装过程

ODROID-xu4使用交叉编译工具链是:gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux
安装过程非常简单:

  1. 在/opt下创建自己要安装工具链的目录,我的目录是/opt/odroid-arm-4.9-toolchains
sudo mkdir -p /opt/odroid-arm-4.9-toolchains
sudo unxz gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux.tar.xz
sudo tar xf gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux.tar -C /opt/odroid-arm-4.9-toolchains
  1. 打开目录下的bashrc:vi $HOME/.bashrc,复制以下语句到bashrc的末尾把交叉编译工具链加入到环境变量中
export PATH=/opt/odroid-arm-4.9-toolchains/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/:$PATH
export CROSS_COMPILE=arm-linux-gnueabihf-
export ARCH=arm
  1. source ~/.bashrc
  2. 测试,输入arm-linux-gnueabihf-gcc -v,如果打印如下信息,可以找到gcc version4.9.2表示工具链安装成功
Using built-in specs.
COLLECT_GCC=arm-linux-gnueabihf-gcc
COLLECT_LTO_WRAPPER=/opt/odroid-arm-4.9-toolchains/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/../libexec/gcc/arm-linux-gnueabihf/4.9.2/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: /cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/src/gcc-linaro-4.9-2014.09/configure --build=i686-build_pc-linux-gnu --host=i686-build_pc-linux-gnu --target=arm-linux-gnueabihf --prefix=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/install --with-sysroot=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/install/arm-linux-gnueabihf/libc --enable-languages=c,c++,fortran --disable-multilib --enable-multiarch --with-arch=armv7-a --with-tune=cortex-a9 --with-fpu=vfpv3-d16 --with-float=hard --with-pkgversion='crosstool-NG linaro-1.13.1-4.9-2014.09 - Linaro GCC 4.9-2014.09' --with-bugurl=https://bugs.launchpad.net/gcc-linaro --enable-__cxa_atexit --enable-libmudflap --enable-libgomp --enable-libssp --with-gmp=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --with-mpfr=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --with-mpc=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --with-isl=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --with-cloog=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --with-libelf=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --enable-threads=posix --disable-libstdcxx-pch --enable-linker-build-id --enable-plugin --enable-gold --with-local-prefix=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/install/arm-linux-gnueabihf/libc --enable-c99 --enable-long-long --with-mode=thumb --disable-multilib --with-float=hard
Thread model: posix
gcc version 4.9.2 20140904 (prerelease) (crosstool-NG linaro-1.13.1-4.9-2014.09 - Linaro GCC 4.9-2014.09) 

总结

刚开始接触ODROID,先记录下来,方便查询!

你可能感兴趣的:(嵌入式)