Talk:Cross-Compiler Successful Builds
Latest comment: 14 years ago by Creature in topic GCC 4.5.0
GCC 4.5.0
User Bluechill marked GCC 4.5.0 / Binutils 2.20 as "Yes / Successful" in the cross-compiler tutorial.
I just tried it (Linux Mint 7 / Gloria)... it requires the MPC library, which is not covered by the tutorial. And even with the library installed, I get a MPC-related error:
make[2]: Leaving directory '/home/solar/Projekte/propos/build-gcc/gcc' Checking multilib configuration for libgcc... mkdir -p -- i586-elf/libgcc Configuring in i586-elf/libgcc configure: creating cache ./config.cache checking for --enable-version-specific-runtime-libs... no checking for a BSD-compatible install... /usr/bin/install -c checking for gawk... gawk checking build system type... i686-pc-linux-gnu checking host system type... i586-pc-elf checking for i586-elf-ar... /usr/cross/i586-elf/bin/ar checking for i586-elf-lipo... i586-elf-lipo checking for i586-elf-nm... /home/solar/Projekte/propos/build-gcc/./gcc/nm checking for i586-elf-ranlib... /usr/cross/i586-elf/bin/ranlib checking for i586-elf-strip... /usr/cross/i586-elf/bin/strip checking whether ln -s works... yes checking for i586-elf-gcc... /home/solar/Projekte/propos/build-gcc/./gcc/xgcc -B/home/solar/Projekte/propos/build-gcc/./gcc/ -B/usr/cross/i586-elf/bin/ -B/usr/cross/i586-elf/lib/ -isystem /usr/cross/i586-elf/include -isystem /usr/cross/i586-elf/sys-include checking for suffix of object files... configure: error: in `/home/solar/Projekte/propos/build-gcc/i586-elf/libgcc': configure: error: cannot compute suffix of object files: cannot compile See `config.log' for more details. make[1]: *** [configure-target-libgcc] Fehler 1 make[1]: Leaving directory '/home/solar/Projekte/propos/build-gcc' make: *** [all] Error 2
And from i586-elf/libgcc/config.log:
configure:3233: /home/solar/Projekte/propos/build-gcc/./gcc/xgcc -B/home/solar/Projekte/propos/build-gcc/./gcc/ -B/usr/cross/i586-elf/bin/ -B/usr/cross/i586-elf/lib/ -isystem /usr/cross/i586-elf/include -isystem /usr/cross/i586-elf/sys-include -c -g -O2 conftest.c >&5 /home/solar/Projekte/propos/build-gcc/./gcc/cc1: error while loading shared libraries: libmpc.so.2: cannot open shared object file: No such file or directory configure:3237: $? = 1 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "GNU C Runtime Library" | #define PACKAGE_TARNAME "libgcc" | #define PACKAGE_VERSION "1.0" | #define PACKAGE_STRING "GNU C Runtime Library 1.0" | #define PACKAGE_BUGREPORT "" | #define PACKAGE_URL "http://www.gnu.org/software/libgcc/" | /* end confdefs.h. */ | | int | main () | { | | ; | return 0; | } configure:3251: error: in `/home/solar/Projekte/propos/build-gcc/i586-elf/libgcc': configure:3254: error: cannot compute suffix of object files: cannot compile See `config.log' for more details.
The configure line:
$ ../gcc-4.5.0/configure --target=$TARGET --prefix=$PREFIX --disable-nls --enable-languages=c,c++ --without-headers --with-gmp=/usr/cross --with-mpfr=/usr/cross --with-mpc=/usr/cross[/code]
And, just to make sure it's not the library being missing:
$ ls /usr/cross/lib/ libgmp.a libgmp.so libgmp.so.10.0.1 libmpc.a libmpc.so libmpc.so.2.0.0 libmpfr.la libmpfr.so.1 libgmp.la libgmp.so.10 libiberty.a libmpc.la libmpc.so.2 libmpfr.a libmpfr.so libmpfr.so.1.2.2
Seems like we need some different steps / options for the 4.5.0 build, or perhaps it's actually broken; as long the steps and options presented in the tutorial don't work, I remove the 4.5.0 / 2.20 "successful" tag. Perhaps user Bluechill can shed some light on what he did to make it work.
- I had no trouble building GCC 4.5 with the latest MPC version. You follow exactly the same steps as in MPFR/GMP (--prefix=/usr/local), except that you need to compile GCC specifying --with-mpc=/usr/local or something similar. Have you tried using /usr/local as prefix? Also note that MPC depends on GMP and MPFR, so you need both of those to be built (possibly specifying them while configuring MPC) before you can build MPC properly. --Creature 10:41, 5 May 2010 (UTC)