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
suthers
Member
Member
Posts: 672
Joined: Tue Feb 20, 2007 3:00 pm
Location: London UK
Contact:

Building a cross compiler

Post by suthers »

I have recently encountered problems building my kernel.
I could not call asm functions from my kernel.
I was told to build a cross compiler to solve this problem.
I followed the steps as described here:
http://www.osdev.org/wiki/GCC_Cross-Compiler

But when i reach the make all-gcc, I get an error:
"make: *** No rule to make target all-gcc'. Stop."
Any ideas what is going wrong?
Thanks in advance,

Jules
User avatar
Zenith
Member
Member
Posts: 224
Joined: Tue Apr 10, 2007 4:42 pm

Post by Zenith »

Simple check - is there a Makefile in the directory? If no, configure failed. If yes, does it have a target for all-gcc? If not, something else went wrong. Also if you're using Cygwin, do not use the special Cygwin GCC sources, download the ones from gcc.gnu.org.
"Sufficiently advanced stupidity is indistinguishable from malice."
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Post by JamesM »

Configure almost certainly failed. Look at the error messages - don't just ignore them.
User avatar
suthers
Member
Member
Posts: 672
Joined: Tue Feb 20, 2007 3:00 pm
Location: London UK
Contact:

Post by suthers »

Thanks JamesM, I didn't read the error messages :oops:
Repaired I didn't have GMP or MPFR installed.
But now when I run My cross compiler I get the error message:
The procedure entry point __getreent could not be located in the dynamic link library cygwin1.dll
Any ideas what i did wrong?
Thanks in advance,

Jules
User avatar
Zenith
Member
Member
Posts: 224
Joined: Tue Apr 10, 2007 4:42 pm

Post by Zenith »

It shouldn't be using that DLL. Are you using -nostdlib as a compiler option?
"Sufficiently advanced stupidity is indistinguishable from malice."
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Post by Solar »

More importantly, are you really using the crosscompiler?

From the tutorial:
Usage

Once you are finished, your toolset resides in /usr/cross. For example, you have a gcc executable in /usr/cross/bin/$TARGET-gcc (and /usr/cross/$TARGET/gcc as well), which spits out binaries for your TARGET. Add /usr/cross/bin to your PATH environment variable, so that gcc invokes your system compiler, and $TARGET-gcc invokes your cross-compiler.
Every good solution is obvious once you've found it.
Post Reply