cross gcc

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.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:cross gcc

Post by Solar »

GernotFrisch wrote: again - the compiler you create can compile...
No it can't - it would complain about missing crt0.o (C Runtime).
If so, I (hope I) only have to copy my .h and .a files from my running Linux distri into the compiler's include/lib directories and can use it to compile anything just as if it were running on a linux box, no?
No. The Linux target is i586-gnu-linux, which is "ELF with stuff added".
Does the compiler need to know the .a and .h files when it is about to be created? If so, why?
It needs to know what all is provided by the system, how to handle C++ exceptions, what to link in for startup / shutdown, what builtin commands have to be replaced by system-provided functions, etc. etc.
Every good solution is obvious once you've found it.
Post Reply