GHC Alpha port?

Simon Marlow simonmar@microsoft.com
Mon, 16 Jul 2001 10:50:10 +0100


> On 2001-07-11T10:28:33+0100, Simon Marlow wrote:
> > > I wonder if it matters whether PLATFORM_CC_OPTS is set to=20
> -static in
> > > mk/bootstrap.mk?  The comments there say that the flags=20
> "should match
> > > the list in machdepCCOpts in ghc/compiler/DriverFlags.hs", and
> > > DriverFlags.hs does set -static for alpha.
> >
> > I'm not sure whether -static is needed; try it without and see what
> > happens.
>=20
> I have no idea why, but...
>=20
>     puffin:~/u/ghc-port/alpha/ghc/compiler$ ./ghc-inplace
>         Alloc    Collect    Live    GC    GC     TOT     TOT =20
> Page Flts
>         bytes     bytes     bytes  user  elap    user    elap
>     ASSERTION FAILED: file GC.c, line 1347
>     IOT/Abort trap (core dumped)
>=20
> The assertion in question is:
>=20
>       /* make sure the info pointer is into text space */
>       ASSERT(q && (LOOKS_LIKE_GHC_INFO(GET_INFO(q))
>                    || IS_HUGS_CONSTR_INFO(GET_INFO(q))));
>=20
> It seems that the GC code is sensitive to the layout of the virtual
> memory address space.  In particular, I had to change HEAP_BASE from
> 0x50000000 to 0x200000000L in MBlock.h to get GC to work even with
> -static.

So it doesn't work without -static?  A HEAP_BASE change is not
unexpected, it all depends where the system puts its shared libraries.

> I assume it is supposed to be able to find these .hi files?  The
> hc-build script calls for
>=20
>     ./configure
>     $MAKE -C ghc/utils clean boot
>     # ...
>=20
> (the "./configure" in which I interpret as um, shorthand for
>=20
>     GHC=3D<the ghc-inplace I just built from the .hc files> \
>     HappyCmd=3D<a fake happy that simulates happy -v output> \
>     ./configure
>=20
> ), but making boot in ghc/utils involves "ghc-inplace -M", which
> fails:
>=20
>     $ .../ghc-inplace -M -optdep-f -optdep.depend  -osuf o   =20
> -cpp -DPKG_TOOL -DWANT_PRETTY -package lang -package util=20
> -package text    Main.hs Package.hs
>     Main.hs: can't find one of the following: `IO.hi' `IO.hs' `IO.lhs'
>=20
> So... perhaps it would be obvious to you what I am missing?

The hc-build script is a little broken.  What you actually need to do
is:

  - Take the .hs files generated from the .hsc files from the host
    to the target (these should be part of the .hc file bundle).
  - Build in ghc/lib/std and hslibs before ghc/utils,
  - Then build in ghc/utils using the newly built libraries.

Cheers,
	Simon