Porting GHC to powerpc-unknown-linux

Ian Lynagh igloo@earth.li
Thu, 4 Sep 2003 11:26:03 +0100


On Thu, Sep 04, 2003 at 10:41:49AM +0100, Simon Marlow wrote:
>  
> > |                 | alpha-dec-osf3     | dies on host with:         |
> > |                 |                    | cc1: Invalid option `ieee' |
> > 
> > So all 32-bit platforms have worked or are looking good, but 
> > the 64 bit couldn't get of the host machine.    
> 
> The problem you experienced on the Alpha has a perfectly rational
> explanation.  The .hc files we generate on the host machine are designed
> to be compiled on the target machine only; it's entirely possible that
> the configuration of the compiler on the host machine may not be able to
> compile these .hc files to .o.
> 
> Ideally, the build system should know when it is cross-compiling .hc
> files and just generate .hc files (passing -C to GHC instead of -c
> -keep-hc-files).  I thought about doing this, but quickly realised it
> would be a lot of work to get right.  You might be able to hack around
> it with lots of 'make -k' on the host machine.

I have altered {libraries,hslibs}/mk/boilerplate.mk for b1 and
ghc/mk/boilerplate.mk for b2 to include

AR = /bin/true
LD = /bin/true 
SRC_HC_OPTS += -pgmc /bin/true -pgma /bin/true -pgml /bin/true

so it doesn't waste time building object files that are no use anyway as
well as avoiding some issues like the above and, IIRC, inline assembly
being used on some arches.

Of course, alpha didn't build anyway due to the lack of memory
allocation (I think) code for generic 64-bit platforms that I think was
mentioned on one of the lists recently.


Thanks
Ian