GNOME Bugzilla – Bug 50707
shared library dependencies
Last modified: 2011-02-04 16:09:32 UTC
In programs where libgtk.so is dynamically loaded but none of its symbols are put in the global symbol table (ie. dlopening it without RTLD_GLOBAL), we get unfound symbol errors. These are caused by various shared libraries that gtk dlopens that expect gtk's symbols to be in the global symbol table because they don't contain a complete list of dependencies. Currently, this includes pango modules, gtk input method modules and gdk-pixbuf loader modules. With the current 1.3.x releases of libtool, we can't really fix this because it doesn't support linking one libtool library to another libtool library that hasn't been installed yet. This is supported by CVS libtool and the libtool 1.3b release that was made a while back. Theme engines for gtk 1.2 suffered from a similar problem until they were linked correctly. This problem can affect language bindings which do not end up loading libgtk with RTLD_GLOBAL such as python (this problem doesn't show up on the Red Hat builds of python because it is patched to use RTLD_GLOBAL) and others.
Created attachment 468 [details] [review] add library dependencies to glib build
Created attachment 469 [details] [review] add library dependencies to pango build
Created attachment 470 [details] [review] add library dependencies to gtk+ build
Above I have attached patches that add shared library dependencies to glib, pango and gtk+ builds. They all require a libtool version from the 1.4 branch (1.3d will work, and 1.4 should when it is released). The Pango patch is a little broken when you try to compile some modules into libpango (I needed to build libpango before the modules in order to link them against libpango). I have tested these patches for building from a cleaned source tree with no installed versions of the libraries present, and it worked fine. With this patch, the python bindings don't get any unresolved symbol errors. The patches could do with some testing on other architectures though (with libtool 1.3d).
Created attachment 502 [details] [review] updated patch for building pango with shlib dependencies
Created attachment 503 [details] [review] updated patch to build gtk+ with shlib dependencies
I have just attached updated versions of the patches to add shlib dependencies to pango and gtk+. The pango one still has the issues with compiling modules into libpango, which need to be resolved some how. All the patches work well with the newly released libtool-1.4, which is available at: ftp://ftp.gnu.org/gnu/libtool/libtool-1.4.tar.gz
Created attachment 512 [details] [review] Patch to fix Pango building properly with included modules and shlib deps
I got the buildig for Pango working correctly, but because libtool-1.4 interacts badly with released automake, I think we may need to hold off on this fix until that is resolved.