On Tue, 17 Apr 2001, Skip Montanaro wrote:
>
> James> This is a known problem.... or modify python to pass the
> James> RTLD_GLOBAL flag when dlopen'ing extensions.
>
> James> The second option is easier (Red Hat has a patch to do it in
> James> their python rpms), ....
>
> Any pointers to RedHat's RTLD_GLOBAL patch would be appreciated. I couldn't
> find it via their search mechanisms.
Don't have an exact reference (the patch is probably in their source
rpms). The change is very simple. Just edit Python/dynload_shlib.c, and
find the call to dlopen close to the bottom of the file. The second
argument to dlopen() is a set of flags. You can just or RTLD_GLOBAL
against the flags. That is, changing the line:
handle = dlopen(pathname, RTLD_NOW);
to:
handle = dlopen(pathname, RTLD_NOW | RTLD_GLOBAL);
(there is no reason to change the second dlopen call, as Linux systems
have the RTLD_NOW flag).
The effect of this is that loaded extension modules can see each other's
symbols (plus the symbols of any other libraries pulled in by shared
library dependencies). This could potentially cause symbol conflicts, but
in practice doesn't cause problems very often (most extensions only export
a single function -- the initmodulename() function.
I have some patches that fix the dynamic dependencies in glib, pango and
gtk+ (the gtk+ patch still isn't perfect -- the depdendencies for the
gdk-pixbuf modules are not quite right yet). They make use of
features in libtool-1.3d (a beta release of 1.4). You can find the
current set of patches attached to this bugzilla bug:
http://bugzilla.gnome.org/show_bug.cgi?id=50707
At the moment, it is probably easier to patch python rather than
gtk. Owen says he doesn't want to switch the official gtk packages to the
newer libtool until libtool-1.4 is released.
James.
--
Email: [EMAIL PROTECTED]
WWW: http://www.daa.com.au/~james/
_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk