[Python-Dev] Problems with Python's default dlopen flags

Jack Jansen Jack.Jansen@oratrix.com
Sun, 5 May 2002 22:20:21 +0200


On zondag, mei 5, 2002, at 09:26 , Martin v. Loewis wrote:
>> And in fact, I expect to ask users to do something special, like
>> explicitly linking between extension modules
>
> Indeed, that should also work fine - if users explicitly link
> extension modules against each other, they should be able to share
> symbols.

 From experience I can say this is not a good idea. MacOS 
extension modules used to do this until Python 1.5.2, and it can 
have undesired side effects (similar to the C++ initializer 
problems you noted). If you need to communicate symbols between 
module A and B it's better to make a normal shared library 
ABglue.so which contains the glue code, and link both A and B 
against it. The only question is where to put the ABglue.so 
file, on Mac and some (most?) unixen it's probably okay to drop 
it in lib-dynload, but it could be you need some fiddling of the 
flags that control the shared library search path for A and B. I 
think on Windows you're stuck with putting it in the system 
directory (at least, I assume that that's why PyWinTypes is 
there).
--
- Jack Jansen        <Jack.Jansen@oratrix.com>        
http://www.cwi.nl/~jack -
- If I can't dance I don't want to be part of your revolution -- 
Emma Goldman -