Building a cross compiler

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
narke
Member
Member
Posts: 119
Joined: Wed Dec 26, 2007 3:37 am
Location: France

Building a cross compiler

Post 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?
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Post 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.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
Zenith
Member
Member
Posts: 224
Joined: Tue Apr 10, 2007 4:42 pm

Post 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.
"Sufficiently advanced stupidity is indistinguishable from malice."
gedd
Member
Member
Posts: 104
Joined: Thu Apr 10, 2008 1:47 am

Post 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)
User avatar
narke
Member
Member
Posts: 119
Joined: Wed Dec 26, 2007 3:37 am
Location: France

Post 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.
xyzzy
Member
Member
Posts: 391
Joined: Wed Jul 25, 2007 8:45 am
Libera.chat IRC: aejsmith
Location: London, UK
Contact:

Post by xyzzy »

Why even 2.17? 2.18 has many bug fixes and is probably more reliable...
User avatar
narke
Member
Member
Posts: 119
Joined: Wed Dec 26, 2007 3:37 am
Location: France

Post by narke »

Ok, next time I will do it with a newer version.
I did not know that there was bug fixings.
Post Reply