Page 1 of 2

Gcc cross compiler creation error

Posted: Thu Oct 30, 2014 11:35 am
by sonus
I followed this link http://wiki.osdev.org/GCC_Cross-Compiler to create cross compiler , downloaded following files gcc-4.8.2 , mpc-1.0 , isl-0.14 , mpfr -3.1.2 and gmp 6.0.0a and extracted to folder gccx .It works fine for

Code: Select all

cd $HOME/src
mkdir build-binutils
cd build-binutils
../binutils-x.y.z/configure --target=$TARGET --prefix="$PREFIX" --with-sysroot --disable-nls --disable-werror
make
make install
When i run "make all-gcc" then it produces errors which can be found here http://pastebin.com/cjfX43C8

I tried by downloading gcc-4.9.0 but it didn't work .
gcc and g++ are already installed version 4.8.2 , OS ubuntu 14.04 LTS.
How to resolve this error ?

Re: Gcc cross compiler creation error ?

Posted: Thu Oct 30, 2014 1:54 pm
by sortie
You are not following the instructions. You are not giving us enough information to help you.

There is no "make gcc-all" command. You mean "make all-gcc". This means we cannot trust anything you say if it is wrong.

You need to:
  • Go into the preferences of your terminal emulator and set scrollback to unlimited.
  • Delete what you currently have. Build directories, extracted source code, delete it all.
  • Close your terminal.
  • Open a new terminal.
  • Start over.
  • Follow the instructions carefully.
  • When things go wrong, stop.
  • Copy everything in your terminal into a text file.
  • Upload that text file in a pastebin.
  • Post a link to the paste.
This way we can see *exactly* what you did. If you don't follow the instructions and tell us exactly what you did, then you won't succeed.

Don't be stupid. Replace gcc-x.y.z with gcc 4.9.1 if that is the version you used.

Re: Gcc cross compiler creation error

Posted: Thu Oct 30, 2014 3:08 pm
by b.zaar
I had some similar trouble once. Adding the extra option to the configure command line fixed it for me

Code: Select all

../binutils-x.y.z/configure --target=$TARGET --prefix="$PREFIX" --with-sysroot --disable-nls --disable-werror CC=gcc-4.8.2

Re: Gcc cross compiler creation error

Posted: Thu Oct 30, 2014 8:58 pm
by sonus
sorry for typo error, it is make all-gcc .
pastebin link for error .
http://pastebin.com/BaKkuZEs

Edit:
I had used "make all-gcc > xyz.txt" so it did not copied error from terminal .
New link which contains error .
http://pastebin.com/cjfX43C8

Re: Gcc cross compiler creation error

Posted: Thu Oct 30, 2014 9:58 pm
by Brynet-Inc
sonus wrote:sorry for typo error, it is make all-gcc .
pastebin link for error .
http://pastebin.com/BaKkuZEs
There is no error in that output.

Re: Gcc cross compiler creation error

Posted: Fri Oct 31, 2014 12:44 am
by sonus
Brynet-Inc wrote:
sonus wrote:sorry for typo error, it is make all-gcc .
pastebin link for error .
http://pastebin.com/BaKkuZEs
There is no error in that output.
Check updated post .

Re: Gcc cross compiler creation error

Posted: Fri Oct 31, 2014 12:47 am
by sonus
b.zaar wrote:I had some similar trouble once. Adding the extra option to the configure command line fixed it for me

Code: Select all

../binutils-x.y.z/configure --target=$TARGET --prefix="$PREFIX" --with-sysroot --disable-nls --disable-werror CC=gcc-4.8.2
This setting didn't work for make all-gcc .

Re: Gcc cross compiler creation error

Posted: Fri Oct 31, 2014 1:22 am
by xenos
What are your exact configure and make command lines? (Copy/paste, no typos this time please.)

Re: Gcc cross compiler creation error

Posted: Fri Oct 31, 2014 2:08 am
by sonus
XenOS wrote:What are your exact configure and make command lines? (Copy/paste, no typos this time please.)

Code: Select all

export PREFIX="$HOME/opt/cross"
export TARGET=i686-elf
export PATH="$PREFIX/bin:$PATH"

cd $HOME/src
mkdir build-binutils
cd build-binutils
../binutils-2.24/configure --target=$TARGET --prefix="$PREFIX" --with-sysroot --disable-nls --disable-werror
make
make install

cd $HOME/src

mv gmp-6.0.0a gcc-4.8.2/gmp
mv mpfr-3.1.2  gcc-4.8.2/mpfr
mv mpc-1.0  gcc-4.8.2/mpc
mv isl-0.14   gcc-4.8.2/isl
 
mkdir build-gcc
cd build-gcc
../gcc-4.8.2/configure --target=$TARGET --prefix="$PREFIX" --disable-nls --enable-languages=c,c++ --without-headers
make all-gcc

Re: Gcc cross compiler creation error

Posted: Fri Oct 31, 2014 2:31 am
by b.zaar
why --prefix="$PREFIX" and not --prefix=$PREFIX?

Re: Gcc cross compiler creation error

Posted: Fri Oct 31, 2014 2:38 am
by Combuster
no typos this time please.
sonus wrote:mv gmp<space>6.0.0a gcc-4.8.2/gmp
mv mpfr<space>-3.1.2 gcc-4.8.2/mpfr
](*,)


EDIT: I just finished building the crosscompiler on a borrowed 14.04.1 Ubuntu LTS without problems.

Re: Gcc cross compiler creation error

Posted: Fri Oct 31, 2014 4:58 am
by xenos
Combuster wrote:EDIT: I just finished building the crosscompiler on a borrowed 14.04.1 Ubuntu LTS without problems.
I just did the same on my Ubuntu 14.04.1 Ubuntu LTS notebook - for i786-elf, x86_64-elf, mips-elf... and m68k-elf is compiling right now. I expect it to work for arm-eabi, powerpc-elf and my other build targets as well.

Re: Gcc cross compiler creation error

Posted: Fri Oct 31, 2014 6:23 am
by sonus
Combuster wrote:
no typos this time please.
sonus wrote:mv gmp<space>6.0.0a gcc-4.8.2/gmp
mv mpfr<space>-3.1.2 gcc-4.8.2/mpfr
](*,)


EDIT: I just finished building the crosscompiler on a borrowed 14.04.1 Ubuntu LTS without problems.
Ok let forget about typo error . Check pastebin file , there is an error . This error doesn't occur due to copy/paste there is something behind the error .

Re: Gcc cross compiler creation error

Posted: Fri Oct 31, 2014 6:25 am
by sonus
b.zaar wrote:why --prefix="$PREFIX" and not --prefix=$PREFIX?
I have no idea about this as this syntax is given in the link so i just copied and paste in terminal .

Re: Gcc cross compiler creation error

Posted: Fri Oct 31, 2014 6:30 am
by sonus
XenOS wrote:
Combuster wrote:EDIT: I just finished building the crosscompiler on a borrowed 14.04.1 Ubuntu LTS without problems.
I just did the same on my Ubuntu 14.04.1 Ubuntu LTS notebook - for i786-elf, x86_64-elf, mips-elf... and m68k-elf is compiling right now. I expect it to work for arm-eabi, powerpc-elf and my other build targets as well.
You can check pastebin link there is an error .