[Zope-Perl] Loading perl modules from python

David Ascher DavidA@ActiveState.com
Tue, 23 May 2000 17:09:18 -0700


> -		       RTLD_LAZY);
> -	handle = dlopen(pathname, RTLD_LAZY);
> +		       RTLD_LAZY | RTLD_GLOBAL);
> +	handle = dlopen(pathname, RTLD_LAZY | RTLD_GLOBAL);

This is an issue which comes up periodically, and my birds-eye view is that
the switch gets toggled back and forth every six months or so...

> The bad thing with this approach is that we get the flag set for all
> modules loaded by python, which probably imply that more name
> conflicts occur.

Likely...

> It also seems like an unlikely patch to get adopted
> for the official python.

... for the reason in the preceding line...

I know that the current state of that line is not accidental, and that
RTLD_GLOBAL _has_ been discussed in the past.  Probably worth scanning the
archives, although it's probably pre-python-dev (in other words, deja.com is
your friend).

> Can anybody see a nice way to get selective
> RTLD_GLOBAL for different 'imports' in python?  Or is there another
> way to make this work?

I can't think of one, outside of setting a new flag in the sys module which
would be looked up in the function you patched and decided at runtime
whether to go RTLD_GLOBAL or not.

Ugh.

--david