powerpc-unknown-linux port

Michael Weber michael.weber@post.rwth-aachen.de
Fri, 31 Aug 2001 14:58:58 +0200

On Fri, Aug 31, 2001 at 14:43:49 +0200, Lars Brinkhoff wrote:
> I'd like to try to port GHC to powerpc-unknown-linux.  There seems to
> be only x86 HC files available for GHC 5.00.2.  Would those be of any
> help to me?

No, you need unregisterised HC files, which involved a 2-stage build.

I already build them for 5.00.2 and i can upload them somewhere, if
you want me to.

I also tried to port GHC to powerpc-linux... currently it barfs here:
===fptools== Finished making `all' in cbits ...
PWD = /home/michaelw/debian/porting/ghc5-5.00.2/hslibs/lang
gcc -x c Addr.hc -o Addr.raw_s -S -O  -finhibit-size-directive
-static -D__GLASGOW_HASKELL__=500  -O
-I.  `echo  -DSTOLEN_X86_REGS=3 | sed 's/^$/-DSTOLEN_X86_REGS=4/'`
../../ghc/driver/mangler/ghc-asm Addr.raw_s Addr.s  3
gcc -c -o Addr.o Addr.s
Addr.s: Assembler messages:
Addr.s:1: Error: Unknown pseudo-op:  `.toc'
Addr.s:3: Error: Unknown pseudo-op:  `.csect'
Addr.s:9: Error: Unknown pseudo-op:  `.csect'
Addr.s:18: Error: Unknown pseudo-op:  `.csect'
Addr.s:76: Error: Unknown pseudo-op:  `.csect'
Addr.s:86: Error: Unknown pseudo-op:  `.csect'
Addr.s:96: Error: Unknown pseudo-op:  `.csect'
Addr.s:107: Error: Unknown pseudo-op:  `.csect'
Addr.s:117: Error: Unknown pseudo-op:  `.csect'
Addr.s:128: Error: Unknown pseudo-op:  `.csect'
Addr.s:144: Error: Unknown pseudo-op:  `.csect'
Addr.s:193: Error: Unrecognized opcode: `toc[tc0],'
[lots more of this]
make[2]: *** [Addr.o] Error 1
rm Addr.s Addr.raw_s
make[1]: *** [all] Error 1
make[1]: Leaving directory
make: *** [all] Error 1
zsh: exit 2     make all

This is with the unregisterized .hc files copied to a build tree on a
powerpc and then invoking 'hc-build'.  I didn't had the time so far to
investigate further on this issue...

One of the MacOS X porters (IIRC) mentioned to me, that eventually the
.hc files are not REALLY unregisterized, but i can't see any problems
with them...

Here's mk/build.mk, which I used to produce the .hc files:
GhcLibWays =

port_opts       = -O -keep-hc-files-too -optc-DNO_REGS -optc-DUSE_MINIINTERPRETER -fno-asm-mangling -funregisterised -fvia-C
GhcLibHcOpts    = $(port_opts)
# GhcHcOpts     = $(port_opts)
GhcRtsHcOpts    = $(port_opts)


GhcUnregisterised = YES
GhcWithNativeCodeGen = NO
StripLibraries = NO
SplitObjs = NO

I used the same for the second stage, but added:
WithGhcHc = $(FPTOOLS_TOP_ABS)/../stage1/obj/bin/ghc

and also added the according `--with-hc' option to configure

Those I took to the powerpc, unpacked them onto a fresh source tree,
and started building... with the above results...

() ASCII ribbon campaign |  Chair for Computer Science  II  | GPG: F65C68CD
/\ against HTML mail     |       RWTH Aachen, Germany       | PGP: 1D0DD0B9

                Don't worry, honey, just two more lemmas ...