This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jamesh
Recipients
Date 2005-04-29.23:46:58
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
GCC4 includes some new features that make it easier to
control what symbols are exported from a library for
linking.

The attached patch makes Python use these features,
limiting the exported symbols to the public Python C
API (i.e. the same symbols as are exported under Windows).

The patch sets the ELF visibility of the public Python
APIs to "protected", which means that the symbol is
exported but internal calls to those symbols are done
as direct function calls. 

In my local tests on i386 Linux, pystone and
parrotbench run about 5% faster on a "--enable-shared"
build of Python with the patch applied.

For a non shared library build of Python, performance
is pretty much identical (I'll probably need to do some
more tests).  However it still has the benefit of not
exporting private Python API.

The patch also touches the init routines of a number of
extension modules, since they weren't marked with
PyMODINIT_FUNC, which caused them to build incorrectly
with the patch (the init function ended up being
private, so Python couldn't load the module).

I've only tested this patch against 2.4.1, but it
probably applies without too much trouble to the 2.5
development line.
History
Date User Action Args
2007-08-23 15:42:51adminlinkissue1192789 messages
2007-08-23 15:42:51admincreate