Page 1 of 1

Setting up GCC Cross Compiler

Posted: Sat Mar 28, 2009 11:08 am
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.

Re: Setting up GCC Cross Compiler

Posted: Sat Mar 28, 2009 5:30 pm
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.

Re: Setting up GCC Cross Compiler

Posted: Sat Mar 28, 2009 7:30 pm
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.

Re: Setting up GCC Cross Compiler

Posted: Sun Mar 29, 2009 12:53 am
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.

Re: Setting up GCC Cross Compiler

Posted: Sun Mar 29, 2009 1:21 am
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".

Re: Setting up GCC Cross Compiler

Posted: Sun Mar 29, 2009 1:25 am
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.