
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@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@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⑈

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! 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. 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. John -- John Meacham - ⑆repetae.net⑆john⑈
participants (1)
-
John Meacham