On 12.08.2010 06:33:07
James Vega <james...@jamessan.com> wrote:

> On Tue, Aug 10, 2010 at 11:15:41PM +0200, Bram Moolenaar wrote:
> > A configure check would help to decide whether everything works 
without
> > RTLD_GLOBAL global.  If it does, then the current solution is best. If
> > it doesn't it might be better to switch to the other solution: do use
> > RTLD_GLOBAL but disallow using both python commands.
> 
> Attached is a configure check that determines if RTLD_GLOBAL is needed,
> when building with dynamic python.  If so, it enables the "only one
> Python interface can be used per session" code.

Hi James,

I agree with you, that it makes sense, to have such a test at 
configuration time.
It makes a good guess for the system.

Since we are at the configuration step, one could turn off Python2 or 
Python3 altogether,
but I agree that it's not so bad to keep them enabled, so, 
when starting vim, the first Python version used will be switched on,
i.e. the user can have both in a binary distribution, just not both at the 
same time.
The user is unlikely to need both python versions at the same time, I 
would say.

My other arguments are for those who do their own configuration and would 
like to have both enabled 
even if one will not work for some extension libraries.
But probably one can also expect from them that they manually define 
PY_NO_RTLD_GLOBAL.

The C code checks for Python 3 only.
Whether Python 2 needs RTLD_GLOBAL is independent of whether Python3 needs 
RTLD_GLOBAL.
The crash happens if any one or both use RTLD_GLOBAL.
I changed it. Here is the new diff.




The define should be PY_NO_RTLD_GLOBAL, so if not defined, as is the case 
for a configuration of only one dynamically linked Python version, it 
defaults to using RTLD_GLOBAL.
But I've seen that unlike for e.g. PERL or LUA 
--enable-pythoninterp=dynamic does not work. I have changed that, too.

Roland

-- 
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

Attachment: if_py23_rtld_global.diff
Description: Binary data

Raspunde prin e-mail lui