x86_64: total success

Simon Marlow simonmar at microsoft.com
Thu Oct 14 04:52:49 EDT 2004

On 14 October 2004 07:06, John Meacham wrote:

> Aha! a partial fix! now everything works as expected.
> I just needed to create a link from
> libgmp.so.3 -> libgmp.so
> and now it all works!

The right way to get this link (at least on old RedHat systems) is to
install the gmp-devel RPM.

> So the complete instructions for getting ghc working on a fedora 2
> x86_64 system are
> ; yum install gmp.i386 readline.i386
> ; ln -s /usr/lib/libgmp.so.3 /usr/lib/libgmp.so
> ; ln -s /usr/lib/sse2/libgmp.so.3 /usr/lib/sse2/libgmp.so
> ; rpm -U ghc-*.i386*.rpm  -- downloaded from ghc web site
> and just always pass
> -optc-m32 -opta-m32 -optl-m32
> to ghc and everything just works.
> If we can get ghc to pass those options automatically by 6.2.2  that
> would be cool and a very easy fix.

It's too late for 6.2.2, unless it's a 1-line fix.  I don't think it is,
because it won't be self-hosting without some more work in the build

However, someone could create a 6.2.2 distribution for x86_64 with the
small local patch which adds -m32 to gcc's command line.

> Now I can get started on a native port. Hopefully, the much reduced
> register pressure on x86_64 and ability to take advantage of sse for
> floating point will speed things up for the RTS.

There's already some work on this in the tree - I've picked a register
mapping (see ghc/includes/MachRegs.h) and done much of the work to get
registerised going on x86_64.  I got stalled before because of a bug in
gcc, but that's now fixed (in gcc 3.4), so you should be ok.

The interesting bit will be doing the native code generator, but you
should start from the new NCG in 6.4 if you're interested in working on
that.  Adding SSE support would be great.


More information about the Glasgow-haskell-users mailing list