
[ Moved from nhc-users to nhc-bugs ] Wojciech Moczydlowski, Jr writes:
I've just installed nhc 1.04, and tried to execute: hmake 1 -T in a directory containing file 1.hs: and I've got the following error message:
[khaliff@90-mia-3 khaliff]$ hmake 1 -T nhc98 -T -c -o 1.T.o 1.hs nhc98 -T -o 1 1.T.o 1.T.o(.data+0x1a8): undefined reference to N_Prelude_46mkNTId' 1.T.o(.data+0x1b0): undefined reference to N_Prelude_46mkSR' 1.T.o(.data+0x1b8): undefined reference to N_Prelude_46mkTNm' 1.T.o(.data+0x1bc): undefined reference to F_Prelude_46mkTRoot' 1.T.o(.data+0x1e8): undefined reference to N_Prelude_46lazySat' 1.T.o(.data+0x310): undefined reference to N_Prelude_46mkNTId' 1.T.o(.data+0x318): undefined reference to N_Prelude_46mkSR' 1.T.o(.data+0x320): undefined reference to N_Prelude_46mkTNm' 1.T.o(.data+0x324): undefined reference to F_Prelude_46mkTRoot' 1.T.o(.data+0x364): undefined reference to N_Prelude_46lazySat'
We have not been able to reproduce this problem. Can you identify which processor/OS you are using? The missing symbol names look suspicious; . they should not have a quote ' character at the end . the N_ prefix should be FN_ . the F_ prefix should be CF_ It is possible that the problem is due to using a strange linker - can you tell whether it is Gnu ld (via gcc) or some other linker? One experiment that might fix the problem is to edit the script/nhc98.inst shell script. Line 530 is: LDLIBS=$MAINROUTINE" "$NHC98LIBDIR/$MACHINE/mutlib$CFG.o" "$NHC98LIBDIR/$MACHINE/mutator$CFG.o" "$NHC98LIBDIR/$MACHINE/Prelude$CFG.a" "$NHC98LIBDIR/$MACHINE/Runtime$CFG.a" "$NHC98LIBDIR/$MACHINE/Prelude$CFG.a" "$NHC98LIBDIR/$MACHINE/libdebug$CFG.a" "$NHC98LIBDIR/$MACHINE/Runtime$CFG.a" "$NHC98LIBDIR/$MACHINE/Prelude$CFG.a" "$NHC98LIBDIR/$MACHINE/Runtime$CFG.a Try adding another " "$NHC98LIBDIR/$MACHINE/Prelude$CFG.a to the end of this line, and maybe another " "$NHC98LIBDIR/$MACHINE/Runtime$CFG.a also. Afterwards, you must run ./configure again to re-generate the actual runnable script/nhc98. Regards, Malcolm

On Wed, 23 May 2001, Malcolm Wallace wrote:
Can you identify which processor/OS you are using?
Celeron 333/Linux
The missing symbol names look suspicious; . they should not have a quote ' character at the end . the N_ prefix should be FN_ . the F_ prefix should be CF_
It is FN/CF - it's just that joe interprets ` as an invitation to a special character.
It is possible that the problem is due to using a strange linker - can you tell whether it is Gnu ld (via gcc) or some other linker?
I don't know - I just run hmake -T. Though I suppose it's ld for my configuration is rather standard.
Try adding another " "$NHC98LIBDIR/$MACHINE/Prelude$CFG.a to the end of this line, and maybe another " "$NHC98LIBDIR/$MACHINE/Runtime$CFG.a also. Afterwards, you must run ./configure again to re-generate the
Malcolm
But I've already got those libraries included. I've looked inside Prelude.a and PreludeT.a and I haven't found FN_Prelude_46mkSR there. So maybe the trouble is in the generated code? Wojciech Moczydlowski, Jr

It is possible that the problem is due to using a strange linker - can you tell whether it is Gnu ld (via gcc) or some other linker?
I don't know - I just run hmake -T.
Try gcc -v and ld -v for the version numbers.
Try adding another " "$NHC98LIBDIR/$MACHINE/Prelude$CFG.a
But I've already got those libraries included.
The linker determines dependencies by processing the link archives sequentially, but there are many long-chain cross-dependencies between Prelude.T.a and Runtime.T.a. Thus we need to add numerous copies of both archives to the sequence, to ensure the dependencies can be followed right to the end of the chain.
I've looked inside Prelude.a and PreludeT.a and I haven't found FN_Prelude_46mkSR there. So maybe the trouble is in the generated code?
Using 'nm PreludeT.a', you should find that FN_Prelude_46mkSR is defined in HatArchive.T.o. If it is not, can you check whether HatArchive.T.o is included in the archive at all? Regards, Malcolm

I've looked inside Prelude.a and PreludeT.a and I haven't found FN_Prelude_46mkSR there. So maybe the trouble is in the generated code?
Using 'nm PreludeT.a', you should find that FN_Prelude_46mkSR is defined in HatArchive.T.o. If it is not, can you check whether HatArchive.T.o is included in the archive at all?
It's not. And I've just discovered that PreludeT.a hasn't been built at all - this was PreludeT.a from my previous installation. Looks like it was all my fault - I followed the configure/make/make install pattern instead of configure/make all/make install. Sorry for wasting your time. Though the existence of the difference between make and make all surprised me. Maybe the 'all' option should be default instead of 'basic'?
Malcolm
Wojciech Moczydlowski, Jr

On Wed, May 23, 2001 at 02:43:20PM +0100, Malcolm Wallace wrote:
The missing symbol names look suspicious; . they should not have a quote ' character at the end . the N_ prefix should be FN_ . the F_ prefix should be CF_
They should have ` at the beginning instead of control characters. Pasting into joe kills ` characters because by default `F in joe means to insert literal Ctrl-F into the text. It's not the first time I see Wojciech doing harm to ` characters :-) -- __("< Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/ \__/ ^^ SYGNATURA ZASTĘPCZA QRCZAK
participants (3)
-
Malcolm Wallace
-
Marcin 'Qrczak' Kowalczyk
-
Wojciech Moczydlowski, Jr