On Mon, Aug 9, 2010 at 9:49 AM, Roland Puntaier <[email protected]> wrote: > On Mon, 09 Aug 2010 13:49:43 > Andy Kittner <[email protected]> wrote: >> > > I made the test in Vim 7.3: After removing RTLD_GLOBAL there wasno >> > > crash >> > > any more. >> > >> > If I'm not mistaken this flag was added to make "import termios" work. >> > Or something like that. >> >> The issue was that at least on some systems pythons C-Extensions seemingly >> aren't linked against the python shared library, therefore they can't be >> imported unless the host application provides the required symbols. >> >> See this thread: "Linking errors when compiled with both python and >> python3" >> > http://groups.google.com/group/vim_dev/browse_frm/thread/10be77eb81ad1c2d/fed7c6d9e3932ef5?tvc=1 > > Hi Bram, > > I missed that thread. > > I had the same problem with PyQt 4.7, first, but at a later try it worked, > probably because that linked against libpython 3.1.2. > Andy reported termios to work as well on his system. > Maybe the problematic termios was older or not linked against libpython, > because it was not there at the time termios was configured.
termios is a standard module in the Python distribution, so it seems to be up to the build process that's used. I've checked my Fedora system and the lib-dynload modules there aren't linked against libpython either. So, it looks like at least Debian and Red Hat based distros don't link the lib-dynload modules against libpython. > Maybe we can optimistically assume that for most python libraries / systems > it works. > > I would opt for the following: > > If only one, Python 2.x xor Python 3.x, is configured (and if > DYNAMIC_PYTHON), then use RTLD_GLOBAL: > #define load_dll(n) dlopen((n), RTLD_LAZY|RTLD_GLOBAL) > > If both are configured use without RTLD_GLOBAL: > #define load_dll(n) dlopen((n),RTLD_LAZY) I would instead suggest a configure-time check to determine whether it's possible to load one of the lib-dynload modules without RTLD_GLOBAL set. Simply deciding not to use RTLD_GLOBAL because both Python versions have been chosen means that neither will work on systems where the lib-dynload modules aren't linked against libpython since some of the lib-dynload modules are always used by Python. -- James GPG Key: 1024D/61326D40 2003-09-02 James Vega <[email protected]> -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php
