> At 06.17 -0700 0-09-08, Julian Seward (Intl Vendor) wrote:
> >GHC has always been written in a mixture of (more-or-less) standard C,
> >along with a small amount of "Haskellised C" (.hc files). Both are
> >compiled with the normal GNU tools (GCC etc), and the assembly code
> >created by compiling a .hc file needs further architecture-dependent
> >processing by a Perl script before it is usable.
> >
> >So, really, for a new platform, we need the GNU tools and perl to
> >work.
>
> Exactly what is the output after the .hs has been treated by the Perl
> script, what you call "the assembly code created by compiling a .hc"? Does
> it go via native (CPU-dependent) assembly code, or what?
Your .hs file is (optionally) preprocessed using the C preprocessor. This is then
compiled using hsc (the GHC compiler proper) to generate a .hc file. This (with some
slight preprocessing) is compiled using gcc -S to generate a .S (native assembly)
file. A Perl script then hacks away at this, removing procedure entry and exit code
and doing other munging the details of which Julian knows and I don't. The GNU
assumbler is then run on the resulting assembly file, generating the .o file.
Or you can use the native code generator, so hsc generates a .S file directly - but of
course this doesn't work for a new platform.
HTH.
--KW 8-)
--
Keith Wansbrough <[EMAIL PROTECTED]>
http://www.cl.cam.ac.uk/users/kw217/
Cambridge University Computer Laboratory.