[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] tcc on non-i386 hardware?
From: |
Dave Dodge |
Subject: |
Re: [Tinycc-devel] tcc on non-i386 hardware? |
Date: |
Fri, 19 Nov 2004 17:27:12 -0500 |
User-agent: |
Mutt/1.4.2i |
On Fri, Nov 19, 2004 at 09:02:57AM +0100, Maikel Verheijen wrote:
> Being a complete compiler newby, I was wondering what is needed to get
> a working tcc on my mac running OS/X.
tcc might compile and run, but...
> Especially "tcc -run" is one of my favorites, because of it's ease of
> use to "script" in C.
...since it produces x86 object files, you aren't going to be able to
run them (or even link them, unless you've got a cross-linker handy).
> Is there anyone here that has already done this, or can point me to a
> place to start?
I think you'd have to look at the tcc sourcecode, understand how it
goes about generating x86 object files, and then write a new backend.
The "i386-gen.c" file might be a good starting point, and you can
compare it to the "arm-gen.c" file to see what sorts of things have to
be changed to get machine code for a different CPU.
You've also got the issue that the object file format on MacOS X is
probably different from what Linux uses (MacOS itself identifies such
files as "Mach-O" objects instead of ELF). The ELF output appears to
be in tcc.c itself, which implies that it might be pretty deeply
ingrained in the code/design.
-Dave Dodge