This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Compiler porting



> 	How do your port a compiler to a platform (either a new CPU or a
> new OS) when there doesn't exist a compiler for that platform?

In the case of gcc:

gcc can be configured as a cross-compiler (run on platform A, but generate
code for platform B).  So when the port is first developed, it's run as a
cross-compiler.  Then the cross-compiler is used to compile gcc itself,
and the result will run on the new platform.

binutils (the assembler, linker, and other tools like "ar") can also be
built as cross-tools.

For embedded systems, gcc and binutils are *only* used as cross-compilers
(and assemblers and linkers), since the embedded system will be too
small to run something like gcc native.  Similarly gdb can be run on a
remote target.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]