RE: dynamically loading the dynamic loader

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@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

On 15/06/2004, at 8:09 PM, Simon Marlow wrote:
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'
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?
Hi Simon, Looks like a user error -- I just added the extra symbols to Linker.c's SymX table again, and this time it worked fine. Now we've got additional problems about re-loading packages which are already loaded by GHCi, but that's another problem. I suspect Don will be committing some changes to GHC to help with that. -- % Andre Pang : trust.in.love.to.save
participants (2)
-
André Pang
-
Simon Marlow