ghc 6.8.1 windows link issue ?

Fernand quarantedeux42 at yahoo.fr
Tue Nov 20 09:51:57 EST 2007


Dear all,

Giving a try to GHC 6.8.1 under Windows, I stumble upon the following 
issue (yes, I'm struggling with HDirect), which did not occur with the 
6.6 version : the linking phase of my project fails with

$ C:/ghc/ghc-6.8.1/bin/ghc -o ihc.exe -fglasgow-exts -static -fvia-C 
-Rghc-timing -Wall -recomp       AbsHUtils.o AbstractH.o Attribute.o 
Bag.o [... lots of files, among which we have CoreUtils.o ...]

CoreUtils.o(.text+0x15066):ghc2436_0.hc: undefined reference to 
`containerszm0zi1zi0zi0_DataziGraph_stronglyConnComp_closure'
CoreUtils.o(.text+0x150b0):ghc2436_0.hc: undefined reference to 
`containerszm0zi1zi0zi0_DataziGraph_stronglyConnComp_closure'
CoreUtils.o(.text+0x1ac23):ghc2436_0.hc: undefined reference to 
`__stginit_containerszm0zi1zi0zi0_DataziGraph_'
IDLUtils.o(.text+0x6026):ghc768_0.hc: undefined reference to 
`containerszm0zi1zi0zi0_DataziGraph_stronglyConnComp_closure'
IDLUtils.o(.text+0x6070):ghc768_0.hc: undefined reference to 
`containerszm0zi1zi0zi0_DataziGraph_stronglyConnComp_closure'
IDLUtils.o(.text+0xc607):ghc768_0.hc: undefined reference to 
`__stginit_containerszm0zi1zi0zi0_DataziGraph_'
collect2: ld returned 1 exit status

Indeed, that symbol is undefined in the CoreUtils file :
$ nm CoreUtils.o | grep strongl
         U _containerszm0zi1zi0zi0_DataziGraph_stronglyConnComp_closure

As far as I understand, this is a reference to the Data.Graph function 
stronglyConnComp
(which can be seen in the « containers-0.1.0.0/Data/Graph.hi » interface 
file ; according to the haddock documentation of GHC, that function is 
indeed in the Data.Graph module, which is imported by the CoreUtils.lhs 
file). What is strange to me  is that

$ nm libHSghc.a | grep strongl

gives : 00000598 D _ghczm6zi8zi1_Digraph_stronglyConnComp_closure

which could explain why that function is not found.

May be I'm looking at the wrong file, I don't know much of the linking 
and name-mangling process at hand here (Digraph vs. DataziGraph ?). What 
I do not understand is what causes that issue, which seems to only 
concern the Data.Graph module so far.

Hopes this makes sense to you,

Sincerely yours,

Samuel


More information about the Glasgow-haskell-users mailing list