dynamically loading the dynamic loader

Simon Marlow simonmar at microsoft.com
Tue Jun 15 06:09:58 EDT 2004


On 15 June 2004 03:55, Donald Bruce Stewart wrote:

> At the moment I am unable to load the hs-plugins package into GHCi (or
> via the hs-plugins load() either). It seems the linker is always
> unable to find the symbols we bind to in Linker.c, i.e. addDLL,
> loadObj, and friends. How can I get the linker to see the
> HSrts/libHSrts symbols exported by Linker.c, or is something more
> nefarious at work? 
> 
> Here is a transcript:
> 
>   paprika$ ghci -package plugins
>      ___         ___ _
>     / _ \ /\  /\/ __(_)
>    / /_\// /_/ / /  | |      GHC Interactive, version 6.3, for
>   Haskell 98. / /_\\/ __  / /___| |      http://www.haskell.org/ghc/
>   \____/\/ /_/\____/|_|      Type :? for help.
> 
>   Loading package base ... linking ... done.
>   Loading package altdata ... linking ... done.
>   Loading package unix ... linking ... done.
>   Loading package mtl ... linking ... done.
>   Loading package lang ... linking ... done.
>   Loading package posix ... linking ... done.
>   Loading package haskell98 ... linking ... done.
>   Loading package haskell-src ... linking ... done.
>   Loading package plugins ... linking ...
>         /home/dons/lib/hs-plugins/HSplugins.o: unknown symbol `addDLL'
> 
>   ghc-6.3: panic! (the `impossible' happened, GHC version 6.3):
>           can't load package `plugins'
> 
>   Please report it as a compiler bug to
>   glasgow-haskell-bugs at haskell.org, or
> http://sourceforge.net/projects/ghc/. 
> 
> 
> On MacOS it can't find loadObj.
> 
> Now, obviously the rts is actually loaded and running, but we can't
> see addDLL. I've tried making the package depend on the rts, which
> doesn't 
> do much. I've also added the Linker.c symbols into the linker symbol
> table explicitly using SymX() and Sym(), with no success. Linking
> against hs-plugins statically works fine, of course.

Adding these symbols to the Linker's symbol table should be enough.  I'm
puzzled why that didn't work.  Are you sure you were linking the
modified version of the RTS with the GHCi binary?

Cheers,
	Simon


More information about the Glasgow-haskell-users mailing list