[Haskell-cafe] Haskell plugin dynamic linking issue
harendra.kumar at gmail.com
Mon Apr 10 18:41:10 UTC 2017
You can try using ghc directly (instead of cabal) so that you have full
control over what flags are passed, like this:
ghc -fPIC -dynamic -package xx -c plugin.hs
ld -shared -Bsymbolic -L<path to rts lib> -lHSrts-ghc8.0.2 -o plugin.so
If this works then you can find what is wrong/different with your cabal
setup by using verbose flags and looking at what is being passed to ghc.
On 10 April 2017 at 18:14, Lana Black <lanablack at amok.cc> wrote:
> I'm working on a Haskell plugin (a shared library) for a C program. When
> I load the plugin, I get the following error:
> > ./open
> dlopen() failed:
> undefined symbol: stg_thawArrayzh
> open is just a testing wrapper around dlopen(). I found out that
> stg_thawArrayzh symbol is exported by the rts, and my library isn't
> linked to it, and neither is ghc-prim. How do I fix that? Adding
> -lHSrts-ghc8.0.2 to ld-options doesn't seem to have any effect.
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> Only members subscribed via the mailman list are allowed to post.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe