Shared GHC libraries and the runtime system

Tyson Whitehead twhitehead at
Mon Feb 22 16:34:20 EST 2010

I was working on a shared library that loads up the GHC runtime (via hs_init) 
and have been running into a bunch of undefined stg symbols.

A bit of digging and it seems that GHC doesn't embed

 - the dependency, and
 - the associated rpath /usr/lib/ghc-6.12.1

into shared libraries that it builds.  Thus, if your main executable isn't GHC 
generated (and hence has these), you run into unresolved symbols.

I can work around this by manually adding them myself.  Is there any reason 
GHC can't put this information by default into shared libraries though?

Thanks!  -Tyson

PS:  Further digging into the various shared libraries packaged with GHC 
(Debian GHC package 6.12.1-2) reveal that they are actually missing

 - the dependency, and
 - all rpaths (i.e., there are absolutely no rpaths in any of them)

$ objdump -p /usr/lib/ghc-6.12.1/base-
Dynamic Section:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url :

More information about the Glasgow-haskell-users mailing list