This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Compiler porting
- To: lukeb at canal dot iaw dot on dot ca (Luke Beaulieu)
- Subject: Re: Compiler porting
- From: Joe Buck <jbuck at synopsys dot COM>
- Date: Mon, 27 Aug 2001 15:38:49 -0700 (PDT)
- Cc: gcc at gcc dot gnu dot org
> 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.