
I'm having dificulties installing nhc-1.08 under IRIX 6.5 using gcc-3.0.1 to bootstrap the compiler. I followed the standard install directions and ran: $ ./configure --prefix=/local $ make The first problem I encountered was an incompatability between the prototype of the "system" call on my machine and the one used by nhc.
From /usr/include/stdlib.h:
extern int system(const char *); In the file: nhc98-1.08/src/prelude/System/SystemFun.hc I had to change the following lines (starting at 189) from: C_HEADER(FR_System_46primSystem_35) { NodePtr nodeptr; HsInt result; char* arg1; nodeptr = C_GETARG1(1); IND_REMOVE(nodeptr); arg1 = (char*)getPackedString(nodeptr); result = system(arg1); nodeptr = mkInt(result); INIT_PROFINFO(nodeptr,&pf_system); C_RETURN(nodeptr); } To the following: C_HEADER(FR_System_46primSystem_35) { NodePtr nodeptr; HsInt result; const char* arg1; nodeptr = C_GETARG1(1); IND_REMOVE(nodeptr); arg1 = (const char*)getPackedString(nodeptr); result = system(arg1); nodeptr = mkInt(result); INIT_PROFINFO(nodeptr,&pf_system); C_RETURN(nodeptr); } That seemed like a pretty innocuous change... I then resumed compiling and managed to buid the "nhc98comp" executable with no problems. But the first time the build process tried to use this executable it aborted with the following message: make[1]: Entering directory `/local/archive/internet/lang/haskell/nhc98/nhc98-1.08/src/prelude/mips-IRIX6' rm -f *.hi rm -f DErrNo.hc rm -f /local/archive/internet/lang/haskell/nhc98/nhc98-1.08/targets/mips-IRIX6/obj/prelude/DErrNo/*.o *.o rm -f rm -f /local/archive/internet/lang/haskell/nhc98/nhc98-1.08/script/nhc98 -cpp -c +CTS -lib -redefine -CTS +RTS -H32M -RTS -o /local/archive/internet/lang/haskell/nhc98/nhc98-1.08/targets/mips-IRIX6/obj/prelude/DErrNo/DErrNo.o DErrNo.hs What, run() returned! What, run() returned! What, run() returned! make[1]: *** [/local/archive/internet/lang/haskell/nhc98/nhc98-1.08/targets/mips-IRIX6/obj/prelude/DErrNo/DErrNo.o] Error 1 make[1]: Leaving directory `/local/archive/internet/lang/haskell/nhc98/nhc98-1.08/src/prelude/mips-IRIX6' make: *** [targets/mips-IRIX6/compiler-gcc] Error 2 Any ideas what is causing this or how to get around it would be most appreciated. I can send the full output of configure/make if it would be helpful... Thanks! ------------------------------------------------------------------------------- Jim Callahan jim@polaris.net, jimcal@xtra.co.nz -------------------------------------------------------------------------------

Jim,
I'm having dificulties installing nhc-1.08 under IRIX 6.5 using gcc-3.0.1 to bootstrap the compiler.
I think this might be the first problem - gcc-3 has reputedly made some significant changes over gcc-2, and I'm not sure of the effect such changes might have underneath nhc98.
The first problem I encountered was an incompatability between the prototype of the "system" call on my machine and the one used by nhc.
I would have thought this was pretty harmless - on my Linux box, the standard prototype is extern int system __P ((__const char *__command)); which has never given a conflict with the nhc98-generated prototype extern HsInt system(char*); for me. It could be that gcc-3 is being more strict.
I then resumed compiling and managed to buid the "nhc98comp" executable with no problems. But the first time the build process tried to use this executable it aborted with the following message:
What, run() returned!
Ok, that definitely looks like a bad executable, but I suspect the cause is unrelated to the system() call. Do you have any possibility of using gcc-2.9x instead of gcc-3? If so, I would suggest a second test build would at least cut down the search space, by telling us whether the problem lies with the choice of C compiler or our assumptions about IRIX-6.5. To use a different C compiler from the first one on your PATH, you can use the CC variable at configure-time, e.g. CC=/usr/lib/gcc-2.95.6/bin/gcc ./configure It might also be helpful if you can keep the tree you built with gcc-3 separately. Should gcc-2 work ok, then it could be useful to do some small comparisions between the trees. Regards, Malcolm

Malcolm-
I think this might be the first problem - gcc-3 has reputedly made some significant changes over gcc-2, and I'm not sure of the effect such changes might have underneath nhc98. ... Do you have any possibility of using gcc-2.9x instead of gcc-3?
I tried again using gcc-2.95 and got exactly the same results. The system() prototype had to be modified (as before) and the build failed at first use of "nhc98" with the "What, run() returned!" messages. I have sucessfully used both versions of gcc to build other execuatebles on this machine under IRIX6.5 so I don't think I have an underlying compiler problem. If there anything I can do on my end to provide some better information about the cause of the problem, I'd be glad to help tinker around with the sources. Thanks for the help! Jim ------------------------------------------------------------------------------- Jim Callahan jim@polaris.net, jimcal@xtra.co.nz -------------------------------------------------------------------------------

Do you have any possibility of using gcc-2.9x instead of gcc-3?
I tried again using gcc-2.95 and got exactly the same results. The system() prototype had to be modified (as before) and the build failed at first use of "nhc98" with the "What, run() returned!" messages.
Ok, I have discovered an IRIX-6.5 machine locally, with gcc-2.8.1 installed, and it reproduces the same problem. I'll tinker with it some more to see if I can find the underlying cause. Regards, Malcolm

Jim, After playing around for a bit on IRIX 6.5, I still haven't managed any significant progress on making nhc98 compile correctly there. However, I did get it to bootstrap correctly on an IRIX 5.3 machine. I recall in the past being able to use an executable on 6.x that had been compiled on 5.x, so I tried that here, and it kind of works. That is to say, the bootstrapped compiler runs and produces correct code, but the 6.x linker refuses to link the 6.x object file with the 5.x libraries we built earlier. The error message is: ld32: FATAL 12 : Expecting n32 objects: /grp/haskell/lib/nhc98/mips-IRIX6/main.o is o32. Can you shed any light what this might mean? Am I inadvertently using an SGI-linker rather than the Gnu one? In any case, I suspect that the linker is the underlying cause of our failure to produce a working nhc98 on 6.x in the first place. Regards, Malcolm
participants (2)
-
Jim Callahan
-
Malcolm Wallace