
Hi, Even trivial programs don't link for me if I use the -t flag: $ echo 'main = putStrLn "Foo"' > q.hs $ nhc98 q.hs -o q -t /usr/lib/nhc98/ix86-Linux/PreludeAll.z.a(Monad_IO.z.o)(.data+0x228): undefined reference to `FN_NHC_46Internal_46_95apply1' /usr/lib/nhc98/ix86-Linux/PreludeAll.z.a(PutStrLn.z.o)(.data+0x3c): undefined reference to `FN_NHC_46Internal_46_95apply1' /usr/lib/nhc98/ix86-Linux/PreludeAll.z.a(Show_IOError.z.o)(.data+0x1e8): undefined reference to `FN_NHC_46Internal_46_95apply1' [...] /usr/lib/nhc98/ix86-Linux/PreludeAll.z.a(COrd.z.o)(.data+0x1c0): undefined reference to `FN_NHC_46Internal_46_95apply2' /usr/lib/nhc98/ix86-Linux/PreludeAll.z.a(ShowParen.z.o)(.data+0x50): undefined reference to `FN_NHC_46Internal_46_95apply1' collect2: ld returned 1 exit status $ This happens with both the 1.16-11 deb and CVS checked out earlier today. Both used ghc to compile nhc. Additionally, just an aesthetic issue, with dash as sh I also get: sh: Illegal option -- $ sh --version sh: Illegal option -- "if sh --version | grep -i gnu >/dev/null" in tprofprel should probably be "if sh --version 2> /dev/null | grep -i gnu >/dev/null" or somesuch. Thanks Ian

Ian Lynagh
Even trivial programs don't link for me if I use the -t flag:
undefined reference to `FN_NHC_46Internal_46_95apply1'
Sadly, the time profiling features of nhc98 have not been maintained properly since the student who wrote them moved on. It looks like a change in the internal library structure in 1.16 has broken something. It may be possible to rectify if you study src/prelude/Makefile carefully and check that all the current libraries are mentioned in the section beginning: ifeq "${TPROF}" "z" I suspect that "NHC.Internal" is missing - there may be others too. If you find a fix, send in the patch.
"if sh --version | grep -i gnu >/dev/null" in tprofprel should probably be "if sh --version 2> /dev/null | grep -i gnu >/dev/null" or somesuch.
Yup, good point. Regards, Malcolm
participants (2)
-
Ian Lynagh
-
Malcolm Wallace