Re: dynamic loading with ghc api?

2011-04-07 Thread Don Stewart
Using plugins with dynamic Haskell objects hasn't been tested in quite a while. -- Don On Thu, Apr 7, 2011 at 5:14 PM, Rob Nikander wrote: > Is the 'plugins' package compatible with dynamic linking of the main > program?   I ask because I wrote a test program using > System.Plugins.load and it w

Re: dynamic loading with ghc api?

2011-04-07 Thread Rob Nikander
Is the 'plugins' package compatible with dynamic linking of the main program? I ask because I wrote a test program using System.Plugins.load and it works fine, but when I link it to the GHC api using `ghc -dynamic ...' (which is nice cause it avoids the 50 MB executable), it seg faults when it t

Re: dynamic loading with ghc api?

2011-04-07 Thread Don Stewart
Perhaps look at the plugins package source? -- Don On Thu, Apr 7, 2011 at 12:20 PM, Rob Nikander wrote: > Hi all, > > I'd like to load a value from a .o file.  I've got... > > import ObjLink > main = do >  initObjLinker >  loadObj "Thing.o" >  resolveObjs >  Just ptr <- lookupSymbol "Thing_value

dynamic loading with ghc api?

2011-04-07 Thread Rob Nikander
Hi all, I'd like to load a value from a .o file. I've got... import ObjLink main = do initObjLinker loadObj "Thing.o" resolveObjs Just ptr <- lookupSymbol "Thing_value_closure" Is that the correct symbol to load for the name "value" in module "Thing"? And if so, how to I get the haskel