Unregisterised build
Simon Marlow
simonmar@microsoft.com
Wed, 17 Jul 2002 09:59:04 +0100
> > The cross-port script also tries to do too much. You won't=20
> be able to
> > actually run the b2 compiler on your bootstrap box, because=20
> 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=20
> from stage 2,
> > to your Alpha/Linux box.
>=20
> 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 <rts.conf.inplace
> /bin/sh: ../utils/ghc-pkg/ghc-pkg-inplace: No such file or directory
> make[1]: *** [boot] Error 127
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=20
> the presence
> of a large amount of libraries (I have all its object files,=20
> 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:
>=20
> gcc -x c absCSyn/AbsCSyn.hc -o absCSyn/AbsCSyn.raw_s -S -O -mieee
> -static -w -D__GLASGOW_HASKELL__=3D505 -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=20
> -Iparser -I.
> -I../includes -O -D__GLASGOW_HASKELL__=3D505 -I. `echo | sed
> 's/^$/-DSTOLEN_X86_REGS=3D4/'`
> 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
> [...]
>=20
> 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=20
> afraid that's
> > the way it is at the moment :-(
>=20
> 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