Stop! Tickets are now managed at GitHub.

Please enter new tickets, and find and edit existing tickets there:


Ticket #73 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

Linking error

Reported by: cristiano.paris@… Owned by: BjornBringert
Priority: major Milestone: 2009.2.0.2
Component: cgi Keywords:
Cc:

Description

I was build a CGI app but got the following error:

cristiano-pariss-macbook-pro:src paris$ ghc --make -o ../blog Main.hs
[6 of 6] Compiling Main             ( Main.hs, Main.o )
Linking ../blog ...
Undefined symbols:
  "_xhtmlzm3000zi2zi0zi1_TextziXHtmlziInternals_a50_info", referenced from:
      _sqkv_info in libHScgi-3001.1.7.1.a(CGI.o)
      _sqrl_info in libHScgi-3001.1.7.1.a(CGI.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status

I'm using version 2009.2.0.1-beta1-i386 on Mac OSX Leopard 10.5.7.

Attachments

package.conf.diff (3.4 kB) - added by cristiano.paris@… 5 years ago.
diff of the two package.conf

Change History

Changed 5 years ago by cristiano.paris@…

In order to make easier the debugging process, here's a simple snippet producing the error above (taken by the Hackage's page of CGI):

mport Network.CGI

cgiMain :: CGI CGIResult
cgiMain = output "Hello World!"

main :: IO ()
main = runCGI (handleErrors cgiMain)

Changed 5 years ago by cristiano.paris@…

It seems that the symbol is defined in the library "/Library/Frameworks/GHC.framework/Versions/610/usr/lib/ghc-6.10.3/xhtml-3000.2.0.1/libHSxhtml-3000.2.0.1.a":

$ nm libHSxhtml-3000.2.0.1.a | grep _xhtmlzm3000zi2zi0zi1_TextziXHtmlziInternals_a50_info
         U _xhtmlzm3000zi2zi0zi1_TextziXHtmlziInternals_a50_info
         U _xhtmlzm3000zi2zi0zi1_TextziXHtmlziInternals_a50_info
         U _xhtmlzm3000zi2zi0zi1_TextziXHtmlziInternals_a50_info
         U _xhtmlzm3000zi2zi0zi1_TextziXHtmlziInternals_a50_info
0000000c T _xhtmlzm3000zi2zi0zi1_TextziXHtmlziInternals_a50_info
00000000 t _xhtmlzm3000zi2zi0zi1_TextziXHtmlziInternals_a50_info_dsp

and also it seems that ghc references it correctly in the command line:

gcc version 4.0.1 (Apple Inc. build 5490)
 /usr/libexec/gcc/i686-apple-darwin9/4.0.1/collect2 -dynamic -arch i386 -macosx_version_min 10.5.7 -read_only_relocs warning -weak_reference_mismatches non-weak -u _ghczmprim_GHCziTypes_Izh_static_info -u _ghczmprim_GHCziTypes_Czh_static_info -u _ghczmprim_GHCziTypes_Fzh_static_info -u _ghczmprim_GHCziTypes_Dzh_static_info -u _base_GHCziPtr_Ptr_static_info -u _base_GHCziWord_Wzh_static_info -u _base_GHCziInt_I8zh_static_info -u _base_GHCziInt_I16zh_static_info -u _base_GHCziInt_I32zh_static_info -u _base_GHCziInt_I64zh_static_info -u _base_GHCziWord_W8zh_static_info -u _base_GHCziWord_W16zh_static_info -u _base_GHCziWord_W32zh_static_info -u _base_GHCziWord_W64zh_static_info -u _base_GHCziStable_StablePtr_static_info -u _ghczmprim_GHCziTypes_Izh_con_info -u _ghczmprim_GHCziTypes_Czh_con_info -u _ghczmprim_GHCziTypes_Fzh_con_info -u _ghczmprim_GHCziTypes_Dzh_con_info -u _base_GHCziPtr_Ptr_con_info -u _base_GHCziPtr_FunPtr_con_info -u _base_GHCziStable_StablePtr_con_info -u _ghczmprim_GHCziBool_False_closure -u _ghczmprim_GHCziBool_True_closure -u _base_GHCziPack_unpackCString_closure -u _base_GHCziIOBase_stackOverflow_closure -u _base_GHCziIOBase_heapOverflow_closure -u _base_ControlziExceptionziBase_nonTermination_closure -u _base_GHCziIOBase_blockedOnDeadMVar_closure -u _base_GHCziIOBase_blockedIndefinitely_closure -u _base_ControlziExceptionziBase_nestedAtomically_closure -u _base_GHCziWeak_runFinalizzerBatch_closure -u _base_GHCziTopHandler_runIO_closure -u _base_GHCziTopHandler_runNonIO_closure -u _base_GHCziConc_runHandlers_closure -u _base_GHCziConc_ensureIOManagerIsRunning_closure -o cgisimple -lcrt1.10.5.o -L/Library/Frameworks/HaskellPlatform.framework/lib/cgi-3001.1.7.1/ghc-6.10.3 -L/Library/Frameworks/HaskellPlatform.framework/lib/xhtml-3000.2.0.1/ghc-6.10.3 -L/Library/Frameworks/HaskellPlatform.framework/lib/mtl-1.1.0.2/ghc-6.10.3 -L/Library/Frameworks/HaskellPlatform.framework/lib/network-2.2.1.1/ghc-6.10.3 -L/Library/Frameworks/HaskellPlatform.framework/lib/parsec-2.1.0.1/ghc-6.10.3 -L/Library/Frameworks/GHC.framework/Versions/610/usr/lib/ghc-6.10.3/old-time-1.0.0.2 -L/Library/Frameworks/GHC.framework/Versions/610/usr/lib/ghc-6.10.3/old-locale-1.0.0.1 -L/Library/Frameworks/GHC.framework/Versions/610/usr/lib/ghc-6.10.3/bytestring-0.9.1.4 -L/Library/Frameworks/GHC.framework/Versions/610/usr/lib/ghc-6.10.3/containers-0.2.0.1 -L/Library/Frameworks/GHC.framework/Versions/610/usr/lib/ghc-6.10.3/array-0.2.0.0 -L/Library/Frameworks/GHC.framework/Versions/610/usr/lib/ghc-6.10.3/base-3.0.3.1 -L/Library/Frameworks/GHC.framework/Versions/610/usr/lib/ghc-6.10.3/syb-0.1.0.1 -L/Library/Frameworks/GHC.framework/Versions/610/usr/lib/ghc-6.10.3/base-4.1.0.0 -L/Library/Frameworks/GHC.framework/Versions/610/usr/lib/ghc-6.10.3/integer-0.1.0.1 -L/Library/Frameworks/GHC.framework/Versions/610/usr/lib/ghc-6.10.3/ghc-prim-0.1.0.0 -L/Library/Frameworks/GHC.framework/Versions/610/usr/lib/ghc-6.10.3 -L/usr/lib/i686-apple-darwin9/4.0.1 -L/usr/lib/gcc/i686-apple-darwin9/4.0.1 -L/usr/lib/gcc/i686-apple-darwin9/4.0.1 -L/usr/lib/gcc/i686-apple-darwin9/4.0.1/../../../i686-apple-darwin9/4.0.1 -L/usr/lib/gcc/i686-apple-darwin9/4.0.1/../../.. cgisimple.o -lHScgi-3001.1.7.1 -lHSxhtml-3000.2.0.1 -lHSmtl-1.1.0.2 -lHSnetwork-2.2.1.1 -lHSparsec-2.1.0.1 -lHSold-time-1.0.0.2 -lHSold-locale-1.0.0.1 -lHSbytestring-0.9.1.4 -lHScontainers-0.2.0.1 -lHSarray-0.2.0.0 -lHSbase-3.0.3.1 -lHSsyb-0.1.0.1 -lHSbase-4.1.0.0 -lHSinteger-0.1.0.1 -lHSghc-prim-0.1.0.0 -lHSrts -lm -lffi -lgmp -ldl -search_paths_first -lgcc_s.10.5 -lgcc -lSystem
Undefined symbols:
  "_xhtmlzm3000zi2zi0zi1_TextziXHtmlziInternals_a50_info", referenced from:
      _sqkv_info in libHScgi-3001.1.7.1.a(CGI.o)
      _sqrl_info in libHScgi-3001.1.7.1.a(CGI.o)

Possibly, the linked library is the wrong one, maybe it gets it from another directory in which there's a library with the same name but without that symbol defined.

Changed 5 years ago by cristiano.paris@…

Hi!

I've found what the problem was. Basically, for a reason unknown to me, there are two installations of the package "xhtml": one the GHC.framework and one in the HaskellPlatform?.framework. Of the two, only the first one works.

Then, I modified the file:

/Library/Frameworks/GHC.framework/Versions/610/usr/lib/ghc-6.10.3/package.conf

changing the path of the xhtml package to point to GHC.platform (I'm attaching a diff of the two files).

Of course this is a workaround. Points need clarification are:

1 - Why there're two versions of xhtml. 2 - Why one of those is broken.

Changed 5 years ago by cristiano.paris@…

diff of the two package.conf

Changed 5 years ago by dons

  • milestone set to 2009.2.0.2

So this is an artifact of the Installer installing over the top of an existing GHC install.

Is this resolved now?

Changed 5 years ago by gregorycollins

  • status changed from new to closed
  • resolution set to fixed

Yes, this isHH should be fixed in the new Mac installer.

Changed 5 years ago by cristiano.paris@…

Yes, it works. Thanks.

Note: See TracTickets for help on using tickets.