Page 1 of 1

some issues when creating cross compiler

Posted: Sat Nov 02, 2013 4:20 am
by gideond
So the problem is all in the title. I'm following the tutorial here to build a GCC cross Compiler:
http://wiki.osdev.org/GCC_Cross-Compiler

Only thing is I'm doing this on a raspberry pi. Bin utils works and is installed.

Now at this step :

Code: Select all

cd $HOME/src 
# If you wish to build these packages as part of gcc:
mv libiconv-x.y.z gcc-x.y.z/libiconv # Mac OS X users
mv gmp-x.y.z gcc-x.y.z/gmp
mv mpfr-x.y.z gcc-x.y.z/mpfr
mv mpc-x.y.z gcc-x.y.z/mpc
mkdir build-gcc
cd build-gcc
../gcc-x.y.z/configure --target=$TARGET --prefix="$PREFIX" --disable-nls --enable-languages=c,c++ --without-headers
make all-gcc #FAILS HERE ################################
make all-target-libgcc
make install-gcc
make install-target-libgcc

It fails with this as the last line:

Code: Select all

make: *** [all-gmp] Error 2
I wish I could give more detail, the whole damn thing took so long and then the power got cut of to the PI. This happened twice and I lost all the detail. I can try again and reproduce it. (But Ive done this twice so far with this same error)

So, can I maybe build and install gmp, mpc and mpfr separately? I will try this whole thing again on my CentOS machine and see how it goes.

Re: some issues when creating cross compiler

Posted: Sat Nov 02, 2013 6:19 am
by sortie
Hi,

You need to give more detail. 'Make error 2' just means that one of the programs make ran had an error (with was error code 2, which is just an generic error) and this reveals almost nothing. Indeed, if a program had an error, the exact error should be listed exactly above. Anytime make gives an error, simply look above and post the couple last lines, but preferably more.

The good thing is that make can be continued if it failed, which will reproduce the error. Simply run 'make all-gcc' again (possibly without the -j option, if you used it - as this will force the make output to be sequential). You can use a program like 'script' to record your shell session or by redirecting the output of Make to a file. Perhaps you can do:

Code: Select all

(make all-gcc 2>&1) | tee cross.log
To redirect the standard error output to standard output, then log every line in the cross.log file, but also repeat every line on the terminal. In any case, you must give us more information. The only piece that's of interest here is 'all-gmp', which may suggest you set up gmp incorrectly. Mind you that if you already have libgmp (libraries and headers) installed, you don't need to build it along with your gcc.

Re: some issues when creating cross compiler

Posted: Sat Nov 02, 2013 8:58 am
by gideond
Thanks very much for your reply.
Mind you that if you already have libgmp (libraries and headers) installed, you don't need to build it along with your gcc.
How can I find out if libgmp is already installed. (Does it matter if it is installed under /usr/local or /usr/bin but I'm installing my cross compiler under home/opt/cross.

I will log the errors to a file liek you suggested and put the details here.