Page 2 of 2

Re:cross gcc

Posted: Wed May 05, 2004 10:25 pm
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.