compiling native GCC for arm using cross-compiler

白昼怎懂夜的黑 提交于 2019-12-19 08:31:05

问题


I am looking to create a native build of GCC for an ARM system and I am running into some trouble. The build machine is i686-linux. Every tutorial I see tells me how to set up the actual cross compiling suite (which I have already done using crosstools-ng). However, I don't see anything related to compiling native ARM GCC. The configure string I used is below, I have set up the sysroot only with headers. I have also cross-compiled and installed GMP and MPFR.

../../gcc-4.3.5/configure \
    --host=arm-unknown-linux-gnueabi \
    --build=i686-build_pc-linux-gnu \
    --target=arm-unknown-linux-gnueabi \
    --prefix=/home/vm/gcc-native/sysroot \
    --with-sysroot=/home/vm/gcc-native/sysroot \
    --enable-shared --enable-threads --disable-libmudflap --disable-libssp \
    --disable-libgomp --disable-libstdcxx-pch --with-gnu-as --with-gnu-ld \
    --enable-languages=c,c++ --enable-symvers=gnu --enable-__cxa_atexit \
    --disable-nls --disable-multilib \
    --with-gmp=/home/vm/gcc-native/sysroot/ \
    --with-mpfr=/home/vm/gcc-native/sysroot/

GCC will build for a while but then dies with this:

checking for suffix of object files... configure: error: cannot compute suffix of object files: cannot compile.

I am not sure how this would even run on my system as I am building on i686-linux and the target/host are both arm-linux. My thought right now is to find a ltib distro and looking at a spec file for GCC and trying to follow all of the steps. The GCC that ltib shipped with for my board fails to compile on my system due to conflicts with the std namespace.

Any info/links would be appreciated!


回答1:


Look in the config.log file (maybe not the top-level one) and see what it was trying to do when the test failed. Just grep for the cannot compute suffix message and you should find the right bit (it won't be at the end of the file).

Note that you'll need a working arm-unknown-linux-gnueabi-gcc on your path somewhere if you want to build a cross-native toolchain. I.e. you need a cross compiler to build cross-native compiler.



来源:https://stackoverflow.com/questions/7663684/compiling-native-gcc-for-arm-using-cross-compiler

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!