Setting up GCC 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
stanko51
Member
Member
Posts: 32
Joined: Fri Mar 27, 2009 6:58 pm

Setting up GCC Cross Compiler

Post by stanko51 »

Hello,

I'm trying to set up a cross compoiler in cygwin using the gcc cross compiler tutorial.

In the first step we refer to /usr/cross. What is this directory, what is suppose to be in there.
"export PREFIX=/usr/cross"

When I try the first thing, configure the binutil all checking return "no", as in :
checking wether the c compiler (gcc ) is a cross-compiler... no
...
checking for i586-elf-ar... no

when i look at my path ($PATH), there is /usr/cross/bin : No such file or directory

I guess, I'm missing something.. any ideas ?

Sorry I'm not too familiar with the system coding. I'd just like to boot a kernel to try some algorithms of mine.


Thank you for your help.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: Setting up GCC Cross Compiler

Post by Solar »

At the beginning of the tutorial, /usr/cross does not exist. It is the location where your cross-compiler toolchain should eventually be located.

"Integrating" the cross-compiler with the existing system compiler would be more elegant, I agree, but no-one was able to tell me about how that would be supposed to happen, so I decided to put the cross-compiler somewhere it cannot do damage to the system - /usr/cross.
Every good solution is obvious once you've found it.
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Re: Setting up GCC Cross Compiler

Post by pcmattman »

checking wether the c compiler (gcc ) is a cross-compiler... no
No's in the configure script are OK - as long as by the time it's done it creates config.status and the Makefiles. It's just trying to figure out the system configuration so it can make the correct Makefiles for the build.
Raven
Member
Member
Posts: 41
Joined: Sun Feb 01, 2009 12:20 am

Re: Setting up GCC Cross Compiler

Post by Raven »

Hi
I myself had tough time doing it, just make sure you are using correct binutil and gcc releases compatible with cygwin.
stanko51 wrote:In the first step we refer to /usr/cross. What is this directory, what is suppose to be in there.
"export PREFIX=/usr/cross"
As mentioned by Solar it a directory where your cross-compiler toolchain will reside.
It is not present intially, you have to create it.
Good Luck.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: Setting up GCC Cross Compiler

Post by Solar »

Raven wrote: It is not present intially, you have to create it.
Unless my memory deceives me, the directory will be created automatically by "make install".
Every good solution is obvious once you've found it.
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Re: Setting up GCC Cross Compiler

Post by pcmattman »

It doesn't deceive you Solar - make install will make the directory tree for you.

Basically, $PREFIX/bin will have all your cross-compiler executables, $PREFIX/include, $PREFIX/lib, etc... will have includes, libraries, man pages.
Post Reply