
hi, i am stuck with a linker error in greencard, and haven't found anything online, so i am addressing you for fresh ideas. as soon as i get this sorted out, i will try to turn the answer into a patch that you can consider for the next release. SYMPTOMS: greencard 3.0.3 and 3.01 do not compile with ghc-6.8 (debian lenny package) and 6.10 (darcs copy, checked out yesterday). here is what happens: 4 (0) 19:27:19 mf@yoyo:/tmp2 $ tar xvpzf greencard-3.0.3.tar.gz greencard-3.0.3/ greencard-3.0.3/ANNOUNCE greencard-3.0.3/dist/ greencard-3.0.3/dist/build/ greencard-3.0.3/dist/build/greencard/ greencard-3.0.3/dist/build/greencard/greencard-tmp/ greencard-3.0.3/dist/build/greencard/greencard-tmp/Parse.hs greencard-3.0.3/examples/ greencard-3.0.3/examples/Gdbm/ greencard-3.0.3/examples/Gdbm/diffs greencard-3.0.3/examples/Gdbm/Gdbm.gc greencard-3.0.3/examples/Gdbm/gdbmplus.h greencard-3.0.3/examples/Gdbm/Main.hs greencard-3.0.3/examples/Gdbm/Makefile greencard-3.0.3/examples/Gdbm/README greencard-3.0.3/examples/Makefile greencard-3.0.3/examples/world/ greencard-3.0.3/examples/world/Main.hs greencard-3.0.3/examples/world/Makedefs.ghc greencard-3.0.3/examples/world/Makedeps greencard-3.0.3/examples/world/Makefile.ghc-linux greencard-3.0.3/examples/world/Makefile.ghc-win32 greencard-3.0.3/examples/world/Makefile.hugs-linux greencard-3.0.3/examples/world/Makefile.hugs-win32 greencard-3.0.3/examples/world/README.txt greencard-3.0.3/examples/world/World.gc greencard-3.0.3/greencard.cabal greencard-3.0.3/INSTALL greencard-3.0.3/lib/ greencard-3.0.3/lib/Foreign/ greencard-3.0.3/lib/Foreign/GreenCard.hs greencard-3.0.3/lib/GreenCard.gc greencard-3.0.3/lib/Makefile greencard-3.0.3/lib/package.conf.in greencard-3.0.3/LICENSE greencard-3.0.3/Makefile greencard-3.0.3/README greencard-3.0.3/Setup.hs greencard-3.0.3/src/ greencard-3.0.3/src/Casm.lhs greencard-3.0.3/src/Decl.lhs greencard-3.0.3/src/DIS.lhs greencard-3.0.3/src/ErrMonad.lhs greencard-3.0.3/src/ErrorHook.c greencard-3.0.3/src/FillIn.lhs greencard-3.0.3/src/FillInMonad.lhs greencard-3.0.3/src/GCToken.lhs greencard-3.0.3/src/greencard.ghc.in greencard-3.0.3/src/greencard.hugs.in greencard-3.0.3/src/GreenCard.lhs greencard-3.0.3/src/Lex.lhs greencard-3.0.3/src/LexM.lhs greencard-3.0.3/src/ListUtils.lhs greencard-3.0.3/src/Makefile greencard-3.0.3/src/MarshallMonad.lhs greencard-3.0.3/src/Name.lhs greencard-3.0.3/src/NameSupply.lhs greencard-3.0.3/src/Package.lhs greencard-3.0.3/src/Package.lhs.in greencard-3.0.3/src/Parse.ly greencard-3.0.3/src/PrettyUtils.lhs greencard-3.0.3/src/Proc.lhs greencard-3.0.3/src/Process.lhs greencard-3.0.3/src/Target.lhs greencard-3.0.3/src/Type.lhs 5 (0) 19:27:22 mf@yoyo:/tmp2 $ cd greencard-3.0.3 6 (0) 19:27:24 mf@yoyo:/tmp2/greencard-3.0.3 $ make prefix=/tmp2/ make[1]: Entering directory `/hime/tmp2/greencard-3.0.3/src' happy Parse.ly unused terminals: 1 rm -f .depend touch .depend ghc -M -optdep-f -optdep.depend -optdep-xFiniteMap -optdep-xPretty -recomp -O -fglasgow-exts Casm.lhs DIS.lhs Decl.lhs ErrMonad.lhs FillIn.lhs FillInMonad.lhs GCToken.lhs GreenCard.lhs Lex.lhs LexM.lhs ListUtils.lhs MarshallMonad.lhs Name.lhs NameSupply.lhs Package.lhs PrettyUtils.lhs Proc.lhs Process.lhs Target.lhs Type.lhs Parse.hs make[1]: Leaving directory `/hime/tmp2/greencard-3.0.3/src' make[1]: Entering directory `/hime/tmp2/greencard-3.0.3/src' ghc -recomp -O -fglasgow-exts -c Target.lhs -o Target.o ghc -recomp -O -fglasgow-exts -c PrettyUtils.lhs -o PrettyUtils.o ghc -recomp -O -fglasgow-exts -c Casm.lhs -o Casm.o Casm.lhs:544:1: Warning: Pattern match(es) are overlapped In a case alternative: _ -> ... Casm.lhs:577:1: Warning: Pattern match(es) are overlapped In a case alternative: _ -> ... Casm.lhs:616:4: Warning: Pattern match(es) are overlapped In a case alternative: _ -> ... Casm.lhs:631:5: Warning: Pattern match(es) are overlapped In a case alternative: _ -> ... ghc -recomp -O -fglasgow-exts -c ListUtils.lhs -o ListUtils.o ghc -recomp -O -fglasgow-exts -c ErrMonad.lhs -o ErrMonad.o ghc -recomp -O -fglasgow-exts -c Name.lhs -o Name.o ghc -recomp -O -fglasgow-exts -c DIS.lhs -o DIS.o ghc -recomp -O -fglasgow-exts -c Type.lhs -o Type.o ghc -recomp -O -fglasgow-exts -c Decl.lhs -o Decl.o ghc -recomp -O -fglasgow-exts -c FillInMonad.lhs -o FillInMonad.o ghc -recomp -O -fglasgow-exts -c NameSupply.lhs -o NameSupply.o ghc -recomp -O -fglasgow-exts -c FillIn.lhs -o FillIn.o ghc -recomp -O -fglasgow-exts -c GCToken.lhs -o GCToken.o ghc -recomp -O -fglasgow-exts -c MarshallMonad.lhs -o MarshallMonad.o ghc -recomp -O -fglasgow-exts -c Proc.lhs -o Proc.o ghc -recomp -O -fglasgow-exts -c LexM.lhs -o LexM.o ghc -recomp -O -fglasgow-exts -c Lex.lhs -o Lex.o ghc -recomp -O -fglasgow-exts -Onot -c Parse.hs -o Parse.o Parse.hs:1733:1: Warning: Pattern match(es) are overlapped In a case alternative: _ -> ... ghc -recomp -O -fglasgow-exts -c Process.lhs -o Process.o ghc -recomp -O -fglasgow-exts -c Package.lhs -o Package.o ghc -recomp -O -fglasgow-exts -cpp -DBEGIN_GHC_ONLY='-}' -DEND_GHC_ONLY='{-' -DBEGIN_NOT_FOR_GHC='{-' -DEND_NOT_FOR_GHC='-}' -DPURE_WIN32=0 -c GreenCard.lhs -o GreenCard.o ghc -c ErrorHook.c -o ErrorHook.o ghc -recomp -O -fglasgow-exts -o greencard-bin Casm.o DIS.o Decl.o ErrMonad.o FillIn.o FillInMonad.o GCToken.o GreenCard.o Lex.o LexM.o ListUtils.o MarshallMonad.o Name.o NameSupply.o Package.o PrettyUtils.o Proc.o Process.o Target.o Type.o Parse.o ErrorHook.o Casm.o: In function `s201_info': (.text+0x168): undefined reference to `prettyzm1zi0zi0zi0_TextziPrettyPrintziHughesPJ_Str_con_info' Casm.o: In function `s201_info': (.text+0x17b): undefined reference to `prettyzm1zi0zi0zi0_TextziPrettyPrintziHughesPJ_TextBeside_con_info' Casm.o: In function `s201_info': (.text+0x19d): undefined reference to `prettyzm1zi0zi0zi0_TextziPrettyPrintziHughesPJ_Empty_closure' Casm.o: In function `s201_info': (.text+0x1b7): undefined reference to `prettyzm1zi0zi0zi0_TextziPrettyPrintziHughesPJ_Str_con_info' Casm.o: In function `s201_info': (.text+0x1ca): undefined reference to `prettyzm1zi0zi0zi0_TextziPrettyPrintziHughesPJ_TextBeside_con_info' Casm.o: In function `s201_info': (.text+0x1e9): undefined reference to `prettyzm1zi0zi0zi0_TextziPrettyPrintziHughesPJ_Empty_closure' Casm.o: In function `s201_info': (.text+0x1f0): undefined reference to `prettyzm1zi0zi0zi0_TextziPrettyPrintziHughesPJ_Beside_con_info' [... these continue for every object file on the command line; a bit over 2000 message of the same type in total...] Type.o: In function `sBv_info': (.text+0x1b2b): undefined reference to `prettyzm1zi0zi0zi0_TextziPrettyPrintziHughesPJ_Beside_con_info' Type.o: In function `sZT_info': (.text+0x1ed3): undefined reference to `__stginit_prettyzm1zi0zi0zi0_TextziPrettyPrint_' Type.o: In function `sBb_info': (.text+0x1988): undefined reference to `prettyzm1zi0zi0zi0_TextziPrettyPrintziHughesPJ_go6_info' Type.o: In function `sBf_info': (.text+0x1a12): undefined reference to `prettyzm1zi0zi0zi0_TextziPrettyPrintziHughesPJ_go6_info' Type.o: In function `sZU_info': (.text+0x1b96): undefined reference to `prettyzm1zi0zi0zi0_TextziPrettyPrintziHughesPJ_text_info' Type.o: In function `rvv_closure': (.data+0x8): undefined reference to `prettyzm1zi0zi0zi0_TextziPrettyPrintziHughesPJ_Chr_static_info' Type.o: In function `rvH_closure': (.data+0x64): undefined reference to `prettyzm1zi0zi0zi0_TextziPrettyPrintziHughesPJ_TextBeside_static_info' Type.o: In function `rvH_closure': (.data+0x6c): undefined reference to `prettyzm1zi0zi0zi0_TextziPrettyPrintziHughesPJ_lvl3_closure' Type.o: In function `rvH_closure': (.data+0x70): undefined reference to `prettyzm1zi0zi0zi0_TextziPrettyPrintziHughesPJ_Empty_closure' Type.o: In function `rvN_closure': (.data+0xb0): undefined reference to `prettyzm1zi0zi0zi0_TextziPrettyPrintziHughesPJ_Str_static_info' collect2: ld returned 1 exit status make[1]: *** [greencard-bin] Error 1 make[1]: Leaving directory `/hime/tmp2/greencard-3.0.3/src' make[1]: Entering directory `/hime/tmp2/greencard-3.0.3/lib' ghc -package-name greencard -cpp -fglasgow-exts -fno-prune-tydecls -c Foreign/GreenCard.hs -o Foreign/GreenCard.o -hisuf hi ghc-6.8.2: unrecognised flags: -fno-prune-tydecls Usage: For basic information, try the `--help' option. make[1]: *** [Foreign/GreenCard.o] Error 1 make[1]: Leaving directory `/hime/tmp2/greencard-3.0.3/lib' make[1]: Entering directory `/hime/tmp2/greencard-3.0.3/src' make[1]: Nothing to be done for `all'. make[1]: Leaving directory `/hime/tmp2/greencard-3.0.3/src' make[1]: Entering directory `/hime/tmp2/greencard-3.0.3/lib' ghc -package-name greencard -cpp -fglasgow-exts -fno-prune-tydecls -prof -c Foreign/GreenCard.hs -o Foreign/GreenCard.p_o -hisuf p_hi ghc-6.8.2: unrecognised flags: -fno-prune-tydecls Usage: For basic information, try the `--help' option. make[1]: *** [Foreign/GreenCard.p_o] Error 1 make[1]: Leaving directory `/hime/tmp2/greencard-3.0.3/lib' make: *** [all] Error 2 the errors about no-prune-tydecls are easy enough to fix: $ diff -r greencard-3.0.3{,-patched} diff -r greencard-3.0.3/examples/Gdbm/Makefile greencard-3.0.3-patched/examples/Gdbm/Makefile 28d27 < HC_OPTS += -fno-prune-tydecls diff -r greencard-3.0.3/lib/Makefile greencard-3.0.3-patched/lib/Makefile 6c6 < GHC_OPTS = -cpp -fglasgow-exts -fno-prune-tydecls ---
GHC_OPTS = -cpp -fglasgow-exts $
this helps, but the linker errors are unrealted, and i don't know what to make of them. (I guess I should study how ghc generates C code at this point? it does feel like something obvious...) thanks, cheers, matthias