Talk:Cross-Compiler Successful Builds

From OSDev Wiki
Jump to: navigation, search

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: 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_URL ""
| /* 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

And, just to make sure it's not the library being missing:

$ ls /usr/cross/lib/
libgmp.a  libmpc.a  libiberty.a  libmpfr.a

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)
I used /usr/cross consistently because I don't like mixing hand-installed stuff with what's been installed by my system's packet manager. I know I'm the first to cry "follow it to the letter" usually, but that's the only thing where I strayed from the letter, and the tutorial should be independent of where you put the code. You can see both that I used --with-mpc=/usr/cross and that /usr/cross/lib actually contains GMP, MPFR and MPC, from the information I pasted above.
I'll double-check this tonight. -- Solar 13:48, 5 May 2010 (UTC)
That kindof confirms that the tutorial alone is incomplete. Can't we just stick to recommending 4.2.x? That's so much less troublesome than having to get all GCC's dependencies. At this rate it seems we need a hand install of a full linux package set in a years time. Try it! cross-compiles were never this easy(!) - Combuster 11:38, 5 May 2010 (UTC)
I admit that idea was tempting for some time, but it'd get stale pretty fast, and people would opt for the latest release version anyway, ignoring the tutorial (and returning with their questions as to why it didn't work). That being said, I'm pretty annoyed by how GCC seems to be collecting non-standard dependencies with each version. -- Solar 13:48, 5 May 2010 (UTC)
Maybe creating a separate page with a small script to make and install GMP, MPFR and MPC. I can't say I have this problem as I install Cygwin complete on my system and have all the devel libs --Kieran 15:31, 8 August 2011 (UTC)
I've come across this error when trying to automate my toolchain build process, you NEED to have binutils in your path and gcc and binutils need to be compiled using the same prefix, i'm just leaving this for whoever might run into this error -- Bauen1 02:48, 29 December 2016 (CST)

Table re-shuffle

I've been thinking about the table orientation. It seems wrong. On the horizontal, we've put the program with the fast-growing version numbers, and on the vertical, binutils, which is updated once in a blue moon. This has caused people to split the tables up so they don't go off the right of the brower screen.

I propose flipping GCC to the vertical and binutils to the horizontal, then merging all the tables. What do you all think? Phillid 01:02, 16 November 2014 (CST)

  • Looks like it's been done, and now we've got binutils going off the right of the screen. :) Perhaps untried combinations could be pruned. Eekee 05:31, 19 December 2019 (CST)
Personal tools