GHC Alpha port?

Ken Shan ken@digitas.harvard.edu
Mon, 9 Jul 2001 20:47:00 -0400


--Dxnq1zWXvFF0Q93v
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On 2001-07-05T10:34:27+0100, Simon Marlow wrote:
> This isn't right: you shouldn't set GhcHcOpts in the first build.  In
> the URL you gave, this line was commented out.  That's certainly the
> reason for the core dumps.

Ah!  Careless me.  Thank you.

> In GHC 5.00.2, there's an easier way.  For the c1 & c2 builds, you can
> just set
> 	GhcUnregisterised =3D YES
> in build.mk, and you can set $long to empty.

This seems to have worked.  By the way, the "old way" (as specified in
the MacOS port readme) does not work with ghc 5 -- I got a seg fault
when running ghc-inplace during the second stage.

> When you get around to bootstrapping on the Alpha, I'll probably need to
> help you some more, because bootstrapping from .hc files is quite tricky
> on 5.00.

I'm there!

The first obstacle I encountered is that PackedString.raw_s seems to
be mangled incorrectly.

    PWD =3D /a/lair62/vol/vol0/home/ccshan/u/ghc-port/alpha/hslibs/lang
    ------------------------------------------------------------------------
    gcc -x c PackedString.hc -o PackedString.raw_s -S -O   -D__GLASGOW_HASK=
ELL__=3D500  -O -I/a/lair62/vol/vol0/home/ccshan/u/ghc-port/alpha/ghc/inclu=
des -I/a/lair62/vol/vol0/home/ccshan/u/ghc-port/alpha/ghc/lib/std/cbits -I/=
a/lair62/vol/vol0/home/ccshan/u/ghc-port/alpha/hslibs/lang/cbits -I/a/lair6=
2/vol/vol0/home/ccshan/u/ghc-port/alpha/hslibs/posix/cbits -I/a/lair62/vol/=
vol0/home/ccshan/u/ghc-port/alpha/hslibs/util/cbits -I/a/lair62/vol/vol0/ho=
me/ccshan/u/ghc-port/alpha/hslibs/text/cbits -I/a/lair62/vol/vol0/home/ccsh=
an/u/ghc-port/alpha/hslibs/hssource/cbits    -DNO_REGS -I.  `echo  | sed 's=
/^$/-DSTOLEN_X86_REGS=3D4/'`
    In file included from /a/lair62/vol/vol0/home/ccshan/u/ghc-port/alpha/g=
hc/includes/Stg.h:168,
                     from PackedString.hc:1:
    /a/lair62/vol/vol0/home/ccshan/u/ghc-port/alpha/ghc/includes/TailCalls.=
h:86: warning: call-clobbered register used for global register variable
    ../../ghc/driver/mangler/ghc-asm PackedString.raw_s PackedString.s=20
    gcc -c -o PackedString.o PackedString.s
    as0: Error: PackedString.hc, line 6: Conflicting definition of symbol s=
7sY_fast4
    as0: Warning: PackedString.hc, line 6: .ent/.end block never defined th=
e procedure name
          .end s7sY_fast4
    gmake[1]: *** [PackedString.o] Error 1
    rm PackedString.s PackedString.raw_s
    gmake: *** [all] Error 1

The intermediate files in question are at

    http://www.eecs.harvard.edu/~ccshan/ghc-port/

If I assemble PackedString.raw_s directly, the assmbler is happy.  If
I comment out the ".file" directive in PackedString.s and assemble it,
I get the more informative line numbers in

    as0: Error: PackedString.s, line 12108: Conflicting definition of symbo=
l s7sY_fast4
    as0: Warning: PackedString.s, line 12211: .ent/.end block never defined=
 the procedure name

The culprit appears to be that lines 11396-11404 in
PackedString.raw_s:

    .rdata
            .align 3
    $LC8:
            .quad -9187201950435737471
    .text
            .align 5
            .ent s7sY_fast4
    s7sY_fast4:
            .frame $30,0,$26,0

got mangled into lines 12103-12109 in PackedString.s:

    .rdata
            .align 3
    $LC8:
            .quad -9187201950435737471
            .ent s7sY_fast4
    s7sY_fast4:
            .frame $30,0,$26,0

When I added ".text" manually between the ".quad" and the ".ent", the
assembler became happy.

=2E.. But is this the right fix?  (Do I need to ".align" anything?)  If
it is the right fix, perhaps someone more familiar with the mangler
can point me to the right fix in ghc-asm.lprl?

--=20
Edit this signature at http://www.digitas.harvard.edu/cgi-bin/ken/sig
"There isn't anyone out there who isn't Seymour's fat lady."

--Dxnq1zWXvFF0Q93v
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE7SlCDzjAc4f+uuBURAmpxAJ9snppYiS1Ce7/EaPlBY1U58KAJ/QCfSoCb
WT/VBhSSTidvtOJQTQcj/ls=
=rbjG
-----END PGP SIGNATURE-----

--Dxnq1zWXvFF0Q93v--