This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Designing a new cross compiler?
- From: Michael Meissner <gcc-help at the-meissners dot org>
- To: spr03 at uow dot edu dot au
- Cc: gcc-help at gcc dot gnu dot org
- Date: Tue, 6 May 2003 12:29:40 -0400
- Subject: Re: Designing a new cross compiler?
- References: <6088a967.7fba61b4.8180000@mirapoint.uow.edu.au>
On Tue, May 06, 2003 at 09:41:07PM +1000, spr03@uow.edu.au wrote:
> Hi,
>
> I'm trying to design a new cross compiler for the Intel
> 80196KC microprocessor. I have decided to port gcc and
> binutils. Through discussions with other people who have
> ported other architectures and just searching through pages
> about ports (especially "Using and Porting GCC" and "Porting
> GCC for Dummies") I have come to the stage where I actually
> need to start editing some files and I was wondering if I
> could run the basic steps in porting by to see if I have the
> right idea about the porting process.
>
> Firstly I would start by porting binutils so that I can have
> an assembler and a linker that will be able to produce valid
> object and binary code for the architecture from assembler
> code. Is this correct?
Often times in ports, an instruction set simulator is also needed. Tools like
cgen can help with building both the simulator and the instruction
encode/decode steps. Even if you have real hardware, a simulator is useful
because often times it is more convenient to run the simulator rather than
going through all of the steps to download the object file, etc. A simulator
also helps in the initial debug stage before you have the debugger because you
can use the instruction trace facility to step through each instruction at a
time.
> Secondly once I have the above tools working I can start
> porting gcc since all gcc does is convert HLL code (like c)
> to assembler code, and then it calls the binutils to
> complete the compilation fo the program. Is this correct?
Once you have the basic compiler stuff going, porting GDB is probably needed so
you can use it to debug the program. Once again, having an instruction set
simulator that is built into GDB helps avoid all of the usual problems in
writing debug stubs. You will eventually need to write these stubs (unless you
are using prebuilt stubs), but you don't want to be debugging the stubs at the
same time you are debugging the object file support and compiler support.
> If anyone is slightly interested in this project of porting
> gcc and binutils for the 80196KC could they let me know as I
> would appreciate any help, even just with any experience
> with the basics of the porting process.
>
> Thankyou very much for any feedback.
>
> Simon Reynolds. <spr03@ozemail.com.au>
--
Michael Meissner
email: gnu@the-meissners.org
http://www.the-meissners.org