Unregisterised build
Simon Marlow
simonmar@microsoft.com
Mon, 15 Jul 2002 11:50:18 +0100
> I'm trying to do an unregistered build of ghc, using the cross-port
> script. However, compilation aborts at the following point:
>=20
> haskell/b1/libraries/base > ../../ghc/compiler/ghc-inplace -ldl
> -fglasgow-exts -cpp -Iinclude -funbox-strict-fields=20
> -package-name base -O
> -H24m -keep-hc-files-too -optc-DNO_REGS -optc-DUSE_MINIINTERPRETER
> -fno-asm-mangling -funregisterised -fvia-C -split-objs -c=20
> GHC/Base.lhs
> -o GHC/Base.o
>=20
> The problem appears to be a conflict between '-split-objs' and
> '-fno-asm-mangling' (which, together with '-funregisterised',=20
> is supposed
> to have been replaced by '-unreg' now, if I'm not mistaken).
>=20
> However, -split-objs seems to be required for building=20
> libraries, whereas
> -fno-asm-mangling is probably needed for an unregisterised=20
> build (I'm just
> guessing here...).
Turn off splitting by adding the line 'SplitOjbs=3DNO' to your =
mk/build.mk
file (create one if you don't have it). Splitting is entirely optional.
BTW the cross-port script is a little old, so you might find other
problems. As far as I know, unregisterised compilation *does* work
though.
You might run into problems with the libraries, for two reasons: some of
them are built via hsc2hs which encodes some platform-specific
information into the Haskell source, and some of them rely on
configure-generated information, again in the Haskell source. Both of
these problems lead to non-portable Haskell and hence non-portable
unregisterised .hc files.
Your best bet for the .hsc files is to generate the .hs on your
Alpha/Linux box by taking the intermediate _hsc.c files over and
compiling/running them on the target machine to get the .hs files. Then
take the .hs back to the bootstrapping machine and carry on. These are
the libraries in stage 1, BTW.
For the configure-generated options (eg. GHC/Posix.hs uses a bunch of
types from config.h), you might have to temporarily substitute a
config.h built on the target box when compiling this file to .hc.
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.
At some point we'll try to make all this easier, but I'm afraid that's
the way it is at the moment :-(
Cheers,
Simon