x86_64: total success

John Meacham john at repetae.net
Thu Oct 14 05:12:48 EDT 2004


On Thu, Oct 14, 2004 at 09:52:49AM +0100, Simon Marlow wrote:
> 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.

The problem is that the way the multi-arch system works, I have 3
packages installed

gmp.x86_64
gmp.i386 
gmp-devel

and the gmp-devel is shared between the other two and already came with
the system so I couldn't install it again to create the links.  

> 
> > 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
> system.


;diff package.conf.backup package.conf                                                                                             # /usr/lib/ghc-6.2.1  2:06AM john at momenergy 1
12c12
<      extra_ghc_opts = [],
---
>      extra_ghc_opts = ["-optc-m32", "-opta-m32", "-optl-m32"],

well, it did turn out to be a one-line fix :) but perhaps this isn't the
proper way to do it, it does seem to have solved the problem for me
though.


> 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.

Yes, I am looking at that code now.

Would it even be possible to have the same ghc binary have multiple
target architectures? it seems that some stuff ends up hardcoded in
various places after the ./configure of ghc. 
        John

-- 
John Meacham - ⑆repetae.net⑆john⑈ 


More information about the Glasgow-haskell-users mailing list