5
votes

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
Perhaps you can look inside the configure script, find the part that computes object file suffix and figure out why it fails. Or maybe just fix it to always return .o.n. 1.8e9-where's-my-share m.
Actually the build system probably tries to run a cross-built (arm) executable, and fails. It would make little sense to fix this particular test. It will fail to run the next one. It's necessary to look at the build logs to figure out what's going wrong.n. 1.8e9-where's-my-share m.

1 Answers

3
votes

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.