Page 1 of 1

Building a cross compiler

Posted: Sun Apr 13, 2008 9:49 am
by narke
Hello,

I'm trying to build a cross compiler with gcc and binutils.
I do what the http://www.osdev.org/wiki/GCC_Cross-Compiler explains.

Binutils (2.15) compiles right but the directory /usr/cross is not created even if I setted up environment variables as explained ($PREFIX and $PATH).

When I compile gcc (3.3.6) I get an error because i586-elf-ar is not found.
As I guess i586-elf-ar would be in /usr/cross but even the directory is not created.

find /usr -name "i586-elf-ar" says that there is nothing like i586-elf-ar on the system.

My question is: What I missed?

Posted: Sun Apr 13, 2008 11:13 am
by Combuster
Why are you using such a dated version of binutils? 2.18 has been tested successfully while 2.15 is not even on the list, and I know of several issues that were present in earlier versions of binutils.

Also, have you made sure this part of the article doesn't apply to you:
Problems have been reported on trying to build bintils 2.14 with Cygwin GCC < 3.3.3.3 as host compiler, as well as on trying to build binutils <= 2.15 with GCC 4.x as host compiler.
In all, I recommend using at least 2.17 if not a later version.

Posted: Sun Apr 13, 2008 12:59 pm
by Zenith
This might be a stupid question, but:

Did you ever bother to run make install?

If you did, then -
- check if compilation really did succeed (are the executables present in the build directory)
- or if you actually set the prefix/target properly during configuration

And I also strongly advise using the latest version of binutils.

Posted: Sun Apr 13, 2008 3:18 pm
by gedd
Before compiling gcc you must set /usr/cross/bin wich contains i586-elf-ar and all other binutils you just compile in your PATH

After you can compile gcc quietly !

I had the same problem today ;o)

Posted: Sun Apr 13, 2008 3:25 pm
by narke
Thank you

I tried it again with binutils 2.17 and it worked fine.
Maybe I not run "make install" I don't remember but the important thing is that it works.

Posted: Mon Apr 14, 2008 12:28 am
by xyzzy
Why even 2.17? 2.18 has many bug fixes and is probably more reliable...

Posted: Mon Apr 14, 2008 12:36 pm
by narke
Ok, next time I will do it with a newer version.
I did not know that there was bug fixings.