进入Toolchain,进行如下选择:
Kernel Headers—>Manually specified Linux version,内核版本选择手动指定,然后在下面的linux version 中填入2.6.30;
C library —>glibc,不能选uClibc和eglibc;
GCC compiler Version —>gcc 4.7.x;
[*] Enable C++ support
[*] Build cross gdb for the host
GDB debugger Version (gdb 7.5.x)
其他默认;
4. 生成交叉编译工具链
进行编译,期间会自动连通网络下载相应压缩包。
make
如果没有错误,生成的编译工具就在目录的output/host/usr/下面。
拷贝出来:
cp -ra output/host/usr/* /opt/arm-toolchain-4.7.x
5. 配置环境
编辑环境脚本:
vi /etc/profile
然后在最后面加上:
export PATH=${PATH}:/opt/arm-toolchain-4.7.x/bin
验证下:
/opt/buildroot-2014.02#arm-buildroot-linux-gnueabi-gcc-v使用内建specs。COLLECT_GCC=arm-buildroot-linux-gnueabi-gccCOLLECT_LTO_WRAPPER=/opt/arm-toolchain-4.7.x/bin/../libexec/gcc/arm-buildroot-linux-gnueabi/4.7.3/lto-wrapper目标:arm-buildroot-linux-gnueabi配置为:./configure--prefix=/opt/buildroot-2014.02/output/host/usr--sysconfdir=/opt/buildroot-2014.02/output/host/etc--enable-shared--enable-static--target=arm-buildroot-linux-gnueabi--with-sysroot=/opt/buildroot-2014.02/output/host/usr/arm-buildroot-linux-gnueabi/sysroot--disable-__cxa_atexit--with-gnu-ld--disable-libssp--disable-multilib--with-gmp=/opt/buildroot-2014.02/output/host/usr--with-mpfr=/opt/buildroot-2014.02/output/host/usr--enable-target-optspace--disable-libquadmath--enable-tls--disable-libmudflap--enable-threads--with-mpc=/opt/buildroot-2014.02/output/host/usr--with-float=soft--disable-decimal-float--with-arch=armv5te--with-abi=aapcs-linux--with-cpu=arm926ej-s--with-float=soft--with-mode=arm--with-pkgversion='Buildroot2014.02'--with-bugurl=http://bugs.buildroot.net/--enable-languages=c,c++--with-build-time-tools=/opt/buildroot-2014.02/output/host/usr/arm-buildroot-linux-gnueabi/bin--disable-libgomp线程模型:posixgcc版本4.7.3(Buildroot2014.02)
好了,万事大吉,可以编译程序了。