
The cross-port script also tries to do too much. You won't be able to actually run the b2 compiler on your bootstrap box, because it will be built against the Alpha/Linux-specific libraries, so just stop after you've got a set of .hc files for ghc/compiler in stage 2. Take the library .hc files from stage 1, and the compiler .hc files from stage 2, to your Alpha/Linux box.
That's where I am now. Running the distrib/hc-build script dies pretty early on in the ghc subdir: ... copying ./mpn/generic/sb_divrem_mn.c to mpn/sb_divrem_mn.c copying ./mpn/generic/jacbase.c to mpn/jacbase.c copying ./mpn/alpha/gmp-mparam.h to gmp-mparam.h ../utils/ghc-pkg/ghc-pkg-inplace --update-package
Ok, we'll probably have to hand-hold the build a little. Automatic bootstrapping has rotted slightly, but it should still be possible to get a working compiler.
I tried building that manually, but it seems to be relying on the presence of a large amount of libraries (I have all its object files, but they're worthless without the libs).
Yes, don't worry about ghc-pkg for the moment. The first step is to build the libraries (libraries/base, libraries/haskell98, and most of hslibs). Then build the compiler; at that stage you should have a working compiler binary and it's all downhill from there...
'make' in ghc/compiler dies with:
gcc -x c absCSyn/AbsCSyn.hc -o absCSyn/AbsCSyn.raw_s -S -O -mieee -static -w -D__GLASGOW_HASKELL__=505 -O -I/home/jameson/work/port/haskell/build/ghc/includes -I/home/jameson/work/port/haskell/build/libraries/base/include -I/home/jameson/work/port/haskell/build/hslibs/lang/cbits -I/home/jameson/work/port/haskell/build/hslibs/posix/cbits -I/home/jameson/work/port/haskell/build/hslibs/util/cbits -I/home/jameson/work/port/haskell/build/hslibs/text/cbits -I/home/jameson/work/port/haskell/build/hslibs/hssource/cbits -Iparser -I. -I../includes -O -D__GLASGOW_HASKELL__=505 -I. `echo | sed 's/^$/-DSTOLEN_X86_REGS=4/'` absCSyn/AbsCSyn.hc:2: HsStd.h: No such file or directory absCSyn/AbsCSyn.hc:46: macro `SET_HDR_' used with only 3 args absCSyn/AbsCSyn.hc:174: macro `SET_HDR_' used with only 3 args [...]
followed by more of the same. The only fitting SET_HDR_ seems to be in common-rts/includes/StgMacros.h.
This is very strange - just to be clear, what version of the GHC sources did you start with? There seems to be a version mismatch somewhere - HsStd.h doesn't exist now (last seen in 5.02.X), and SET_HDR_ has an extra argument in 5.04. It looks like you generated your .hc files from the 5.02.x sources, and are building them in a 5.04 or later source tree - that's *not* a good idea, trust me :-)
At some point we'll try to make all this easier, but I'm afraid that's the way it is at the moment :-(
NP, it's quite interesting (in a masochistic kind of way ;) Thanks for your help so far,
Your experiences will be useful to us too, when we get around to cleaning up the bootstrapping process. Cheers, Simon
participants (1)
-
Simon Marlow