Another porting question... (SPARC-Linux this time)

Simon Marlow simonmar@microsoft.com
Tue, 22 May 2001 09:48:18 +0100


> [sorry to bring this subject up every now and then, but I can work on
>  it only occasionally...]
>=20
> Hi!
>=20
> Since the PPC machine I was working on is currently unavailable, I
> gave GHC for SPARC-Linux a try.
>=20
> Here's the current state:
>=20
> 1) I generated unregisterized .hc files for ghc-4.08.1 (gen'd on i386)
>    (following SimonM's instructions, using 2 source trees, taking the
>    .hc files from the second one)
>=20
> 2) Using just these .hc files, I was able to bootstrap a working
>    unregisterized GHC for i386 again.  I did this more or less
>    following the procedures from Manuel's hc-build script, but with
>    again with the same build.mk that I used for generating the .hc
>    files.
>    (I did this as a test whether they worked at all).
>=20
> 3) I tried the same on a Sparc64 (with exactly the same procedure).
>    The stage1 compilation succeeded without error, i.e. I have a hsc
>    binary, but when trying to compile even simple programs, it yields
>    a segfault.

First thing to do is run gdb on the hsc binary (ok, you have to jump
through a couple of hoops to do this with 4.08: run ghc -v and ^Z when
hsc starts running, then cut-n-paste the command line into gdb).  If
this gives you enough information to track down the problem, then all
well and good.  Otherwise we'll have to dig deeper...  compile the RTS
with debugging turned on (see config.mk for the options to turn on), and
we'll take it from there.

Cheers,
	Simon

> p.s.:
> Additional information (please ask, if more is needed):
>   * configure recognizes the machine as:=20
>     sparc64-unknown-linux-gnu=20
>     (I canonicalized that to 'sparc-unknown-linux')
>=20
>   * sizeof(int) =3D=3D 4 (despite Sparc_64_)

sizeof(void *) better be 4 too, otherwise we're into untested territory
(the 64-bit support hasn't been used for a while).

Cheers,
	Simon