Unnecessary linking against Python's config.c

54 views
Skip to first unread message

James McCoy

unread,
Jul 18, 2012, 7:09:27 AM7/18/12
to vim...@googlegroups.com, Bram Moolenaar
Hi Bram,

It recently came up[0] that the way Vim builds its Python support makes
it fragile to changes in which modules are builtin to the Python
library.

When the set of modules that are builtin/extensions differs from what
Vim knew when it was built, it will at best complain that it can't load
the library. At worst, it will crash due to undefined symbols.

This is due to Vim compiling in the config.c from the Python install
that existed when it was built. Removing that, as the attached patch
does, resolves the issue.

I've tested this with both --enable-pythoninterp and
--enable-pythoninterp=dynamic.

[0]: http://bugs.debian.org/681599
--
James
GPG Key: 4096R/331BA3DB 2011-12-05 James McCoy <jame...@jamessan.com>
pyconfig.diff
signature.asc

Bram Moolenaar

unread,
Jul 19, 2012, 8:42:26 AM7/19/12
to James McCoy, vim...@googlegroups.com

James McCoy wrote:

> Hi Bram,
>
> It recently came up[0] that the way Vim builds its Python support makes
> it fragile to changes in which modules are builtin to the Python
> library.
>
> When the set of modules that are builtin/extensions differs from what
> Vim knew when it was built, it will at best complain that it can't load
> the library. At worst, it will crash due to undefined symbols.
>
> This is due to Vim compiling in the config.c from the Python install
> that existed when it was built. Removing that, as the attached patch
> does, resolves the issue.
>
> I've tested this with both --enable-pythoninterp and
> --enable-pythoninterp=dynamic.

It appears that when building with both Python and Python3 the config.c
was already omitted. So why was it ever included? Was this needed for
an older Python versino?

--
We are the Borg of GNU GPL. We will assimilate your source code.
Resistance is futile.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages