GHC Alpha port?

Ken Shan
Mon, 9 Jul 2001 20:47:00 -0400

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, 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=
    In file included from /a/lair62/vol/vol0/home/ccshan/u/ghc-port/alpha/g=
                     from PackedString.hc:1:
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=
    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

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

            .align 3
            .quad -9187201950435737471
            .align 5
            .ent s7sY_fast4
            .frame $30,0,$26,0

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

            .align 3
            .quad -9187201950435737471
            .ent 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?

Edit this signature at
"There isn't anyone out there who isn't Seymour's fat lady."

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

Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see