
I have been trying to get ghc working on the NetBSD AMD64 platform, and there seems to be a little problem with the integer size. With minInt and maxInt defined as they are in GHC/Base.lhs, ghc can't compile this file - it cranks away and just gets bigger until all the memory is gone. Base.lhs compiles right away if I reduce the size of minInt and maxInt by several bits - minInt = I# (-0x2000000000000000#) maxInt = I# 0x1FFFFFFFFFFFFFFF# -- minInt = I# (-0x8000000000000000#) -- maxInt = I# 0x7FFFFFFFFFFFFFFF# (... and it goes on to crash in GHC/Num.lhs.) So ... maybe somewhere in there, something isn't configured right for 64 bit integer arithmetic, even though the word size parameters in ghcautoconf.h look right? Anyone have an idea what to look for? The GHC version is 6.6.1. The .hc donor host is OpenBSD, gcc3 (NetBSD has gcc4.) The include files from NetBSD (DerivedConstants.h, GHCConstants.h, ghcautoconf.h) look fine, I just went back to the OpenBSD build to verify that they weren't changed during the build. The procedure I'm following is `Cross-compiling to produce an unregisterised GHC' http://hackage.haskell.org/trac/ghc/wiki/Building/Porting thanks! Donn Cave, donn@avvanta.com

Hi Donn, On Thu, May 22, 2008 at 09:09:51AM -0700, Donn Cave wrote:
Anyone have an idea what to look for?
This doesn't ring any bells for me. If I were you I'd start by trying to work out what it's doing, by running in gdb and hitting ^C after a while to see where it is. Then find the function in the .hc files; you might need to recompile the module with -ddump-simpl to see what Haskell function that C function is part of. I suspect it'll be in something like the show integer code, in which case adding some debugging prints might help - but you'll need to use C's printf "%zd" or something to show any Int's, of course! You might also want to change GHC's main to do something that you think will tickle the bug first, e.g. print (I# (-0x8000000000000000#)). Thanks Ian
participants (2)
-
Donn Cave
-
Ian Lynagh