x86_64: odd success

John Meacham john at repetae.net
Thu Oct 14 01:45:04 EDT 2004


So my AMD64 books have been burning a hole in my bookshelf for so long,
I finally went out and got a athlon 64 and installed fedora core 2. much
to my dismay, ghc does not seem to work out of the box.

I took the following steps.
; yum install gmp.i386 readline.i386

now a 
rpm -U 
of the ghc rpms works great. 
ghci works properly, and ghc seems to almost  work when compiling.


the expected happens when I try to compile directly.
;ghc Main.hs -o main                                                                                                                         # ~/tmp/x-03 10:26PM john at momenergy
/usr/bin/ld: skipping incompatible /usr/lib/ghc-6.2.1/libHShaskell98.a when searching for -lHShaskell98
/usr/bin/ld: cannot find -lHShaskell98
collect2: ld returned 1 exit status


however, what I expected to work, doesn't.

;ghc -optl-m32 -opta-m32 -optc-m32 Main.hs -o main                                                                                         # ~/tmp/x-03 10:36PM john at momenergy 1
compilation IS NOT required
/usr/bin/ld: skipping incompatible /usr/lib64/libgmp.so when searching for -lgmp
/usr/bin/ld: skipping incompatible /usr/lib64/libgmp.a when searching for -lgmp
/usr/bin/ld: cannot find -lgmp
collect2: ld returned 1 exit status


everything seems to work perfectly however, if I take the gcc command
that ghc would have run (gotten via ghc -v) and simply replace 
-lgmp with /usr/lib/libgmp.so.3

so, any idea what the problem is? in -m32 mode linux seems to get
everything else right, but it can't seem to find that gmp without help.


Also, it would be nice if ghc automatically passed -m32 when it was in
x86_64 mode and wanted to create i386 code, once this happens, (and the
gmp thing is worked out) then x86_64 should work perfectly when creating
i386 binaries and I can get started on what I really want to do, which
is create a native x86_64 ghc :)

It would also be quite important for ghc to support a -m32 flag itself,
so I can continue to create i386 and x86_64 builds from the same ghc
binary. but one problem at a time.. 

        John

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


More information about the Glasgow-haskell-users mailing list