[Gtk2hs-users] ghci-5.04.3 and ghc-6.0

Duncan Coutts duncan@coutts.uklinux.net
Mon, 16 Jun 2003 21:35:00 +0100


On 16 Jun 2003 16:59:07 +0900
Jens Petersen <petersen@redhat.com> wrote:

> Did anyone ever manage to get gtk2hs working with ghci-5.04.3?
> When I try to load it I get:
> 
> % ghci-5.04.3 -package gtk2
> :
> Loading package data ... linking ... done.
> Loading package gtk2 ...
>  
> GHCi runtime linker: fatal error: I found a duplicate definition for
> symbol
>    __stginit_Arrow
> whilst processing object file
>    /usr/lib/ghc-5.04.3/gtk2hs/gtk2hs.o

My brief investigation into this revealed that
__stginit_Arrow is defined in HSlang.o (ghci's object file for package lang)
and this is the only standard package in which it is defined.

__stginit_Arrow is indeed also defined in gtk2hs.o

It is defined there because it is defined in gtk/misc/Arrow.o (in the
buid tree). Itis defined there because Arrow is the name of the module
and that symbol refers to the module initialisation function (or
something like that, perhaps it's a module dependancy marker symbol).

What seems to be happening is that the Arrow module in gtk2hs is
clashing with the Arrow module in the lang package. As far as I can tell
this all looks perfectly normal, so why don't we this kind of problem
all the time? What's special about Arrow?

How does it get resolved in the libHS*.a case? How does the system linker
resolve the ambiguity when ghci's linker cannot?

Duncan