Compiler porting

Joe Buck jbuck@synopsys.COM
Mon Aug 27 15:40:00 GMT 2001


> 	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.



More information about the Gcc mailing list