Status of nhc98 on 64bit platforms

Just out of curiosity, I've just tried to build and install nhc98 from the darcs repo on an x86_64 Linux platform (vanilla "./configure && make", a rather recent GHC from darcs is in the PATH). This resulted in thousands of warnings and errors from GCC like: warning: cast from pointer to integer of different size error: initializer element is not constant The resulting nhc98 is unusable, yielding dozens of errors from the linker for a "Hello, world!" program. So what is the current status on 64bit platforms? Are the problems fixable within a reasonable timeframe? If yes, some hints where to look for bugs would be appreciated, perhaps I can have a try... Cheers, S.

Sven Panne
Just out of curiosity, I've just tried to build and install nhc98 from the darcs repo on an x86_64 Linux platform
So what is the current status on 64bit platforms?
nhc98 does not support 64-bit platforms, it is 32-bit only. However, judging from the fact that I am able to build nhc98 just fine on a 64-bit PowerPC G5, the story is a little more nuanced than that. Apple's gcc is configured to use the 32-bit ABI by default (the -m32 flag). I am guessing that your Linux box has gcc configured with -m64 as the default. So perhaps if you can work out how to pass -m32 to all the C compiler invocations (including those that compile the bytecode output of the nhc98 compiler proper into C arrays)? Unfortunately, ./configure --buildopts="-m32" is not the right thing - it only applies to the bootstrapping Haskell compiler.
Are the problems fixable within a reasonable timeframe?
Of course, using the 32-bit ABI is only a workaround I suppose. Ultimately it should work in native 64-bit mode as well. nhc13 did once support the alpha processor, but that was in the days when it generated assembly code containing the bytecodes, rather than C arrays. Yhc fixes this properly by storing the bytecode in an independent format, and loading it explicitly into memory at runtime. Regards, Malcolm

Sven Panne
writes: Just out of curiosity, I've just tried to build and install nhc98 from the darcs repo on an x86_64 Linux platform
To which I replied:
So perhaps if you can work out how to pass -m32 to all the C compiler invocations (including those that compile the bytecode output of the nhc98 compiler proper into C arrays)?
I have pushed a patch today that aims to do exactly as I suggested. Can you attempt to configure-and-build with this in place, and report any failures? Regards, Malcolm

On Tuesday 27 February 2007 16:45, Malcolm Wallace wrote:
I have pushed a patch today that aims to do exactly as I suggested. Can you attempt to configure-and-build with this in place, and report any failures?
Things look a bit better now (only a few warnings), but still not OK: /home/panne/local/nhc98/script/nhc98 -c +CTS -part -redefine -CTS -P../LowB/ -P../Ratio -P../PreludeList -P../PreludeText -P../PreludeIO -prelude -o /home/panne/local/nhc98/targets/x86_64-Linux/obj/prelude/Prelude/Enum_Double.o Enum_Double.hs /home/panne/local/nhc98/script/nhc98: line 417: 26896 Segmentation fault $COMP $RUNFLAGS $COMPFLAGS $HINCDIRS -I. $UNLIT -P${NHC98INCDIR} $HSFILE $POSTGRFILE $TMPHIFILE $TMPCPPASFILE I'll take a look at this in the next few days... Cheers, S.
participants (2)
-
Malcolm Wallace
-
Sven Panne