Hi,

> I am trying to build GHC on a Apple Power Macintosh running
> Linux. I guess I should build from the .hc fiiles. The .hc files
> for newer versions of GHC are for x86 only. On the other hand,
> the process of building GHC 0.29 seems to be quite different
> from newer versions.
> 
> Is there a "portable" hc source for newer versions of GHC?
> 
> If not, I should start from 0.29. Actually I have been trying and
> I started to (as expected) encounter some problems. Is it still
> maintained and supported?

There will almost certainly be some porting effort involved to get GHC 4.04
up on a powerPC.  Getting the .hc files is just the start: you also need to
add some code to fptools/ghc/rts/StgCRun.c (the magic sequence to get
into/out of Haskell-land) and fptools/ghc/includes/TailCall.h (the magic
tail-call sequences).  The code for these two bits can usually be pilfered
from the 3.02 versions (fptools/ghc/includes/COptJumps.lh in a 3.02 source
tree).  

Also, you'll most likely need some changes to the assembly mangler
(fptools/ghc/driver/ghc-asm.lprl) as the powerpc support has probably rotted
a bit.

You *might* be able to get away with using the x86 .hc files to bootstrap
from.  The issue here is that the calling convention used by the compiler
differs depending on the target architecture, eg. it'll use more registers
for arguments on sparc than x86.  To use this compiler though, you'll need
to match up the MAX_REAL_<blah>_REG constants in
fptools/ghc/includes/MachRegs.h with the x86 values.

We'll be happy to help out - please keep us up to date on how you get on!

Cheers,
        Simon

Reply via email to