XiZi's Blog
交叉编译Gcc For ARM
1、编译binutils
/path/to/binutils/source/configure --build=x86_64-centos-linux-gnu \ --host=x86_64-centos-linux-gnu --target=arm-cortex_a8-linux-gnueabi \ --prefix=/path/to/install make -j4 make install
2、编译安装gcc-core
make all-gcc make install-gcc
3、编译目标libc(glibc或eglibc)
/path/to/libc/source/configure --build=x86_64-centos-linux-gnu \ --host=arm-cortex_a8-linux-gnueabi --target=arm-cortex_a8-gnueabi \ --prefix=/usr make -j4 make -j4 install_root=${SYSROOT} install
4、编译完整gcc
make -j4 make install
Just For Me
1.
../binutils-2.23.2/configure --build=x86_64-centos-linux-gnu \ --host=x86_64-centos-linux-gnu --target arm-cortex_a8-linux-gnueabi \ --prefix=/opt/arm-cortex_a8-linux-gnueabi --with-float=softfp \ --with-sysroot=/opt/arm-cortex_a8-linux-gnueabi/sysroot --enable-lto \ --disable-nls make -j6 make install
2.
../gcc-4.8-4.8.1.orig/gcc-4.8.1/configure --build=x86_64-centos-linux-gnu \ --host=x86_64-centos-linux-gnu --target=arm-cortex_a8-linux-gnueabi \ --prefix=/opt/arm-cortex_a8-linux-gnueabi \ --with-sysroot=/opt/arm-cortex_a8-linux-gnueabi/sysroot \ --with-newlib --enable-threads=no --disable-shared \ --with-arch=armv7-a --with-cpu=cortex-a8 \ --with-tune=cortex-a8 --with-fpu=neon --with-float=softfp --enable-__cxa_atexit \ #--with-host-libstdcxx="-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm \ #-L/home/renxifeng/linaro-gcc/.build/arm-cortex_a8-linux-gnueabi/buildtools/lib -lpwl" / --enable-lto --disable-libgomp --disable-libmudflap --disable-nls --enable-multilib make -j6 all-gcc make install
3.
../libc/configure --prefix=/usr --build=x86_64-centos-linux-gnu \ --host=arm-cortex_a8-linux-gnueabi --cache-file=config.cache --without-cvs \ --disable-profile --without-gd \ --with-hearders=/opt/arm-cortex_a8-linux-gnueabi/sysroot/usr/include \ --enable-obsolete-rpc --enable-kernel=3.0.83 --with-__thread --with-tls \ --enable-shared --with-fp --enable-add-ons=nptl,ports make -j6 make -j6 install_root=/opt/arm-cortex_a8-linux-gnueabi/sysroot/ install
4.
../gcc-4.8-4.8.1.orig/gcc-4.8.1/configure --build=x86_64-centos-linux-gnu \ --host=x86_64-centos-linux-gnu --target=arm-cortex_a8-linux-gnueabi \ --prefix=/opt/arm-cortex_a8-linux-gnueabi \ --with-sysroot=/opt/arm-cortex_a8-linux-gnueabi/sysroot --enable-shared \ --with-arch=armv7-a --with-cpu=cortex-a8 \ --with-tune=cortex-a8 --with-fpu=neon --with-float=softfp --enable-__cxa_atexit \ #--with-host-libstdcxx="-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm \ #-L/home/renxifeng/linaro-gcc/.build/arm-cortex_a8-linux-gnueabi/buildtools/lib -lpwl" / --enable-lto --disable-libgomp --disable-libmudflap --disable-nls --enable-multilib make -j6 make install