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-08-15.11:07:43
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=146903

The PyMODINIT_FUNC() problem could be fixed by filtering out
the -fvisibility=hidden flag from Makefile.pre.in (this
would require some more extensive build changes).

You are right about the patch relying on -fvisibility only
being implemented by compilers that implement the visibility
attribute.  I think this is currently true, but it would be
better not to rely on it.

In the time since I made the patch though, I have been told
about a problem with the "protected" visibility modifier: on
Linux systems at least, it slows down the symbol lookup process.

Since code inside the same library as the protected symbol
will be using a direct reference and code outside will be
going through the PLT, the dynamic linker needs special code
to return different addresses for the symbol depending on
what code is calling it (this is slower than the code path
for "default" visibility symbols).  This is required in
order to satisfy the C standard's requirements that
comparisons of pointers to functions be simple and fast.

The way around this is to use two functions: one is a
"hidden" visibility function that is used by the code inside
libpython, and the other is an alias of the hidden function
with normal visibility and the function's advertised name. 
Unfortunately, this is more invasive to implement (but not
overly so -- libxml2 and GTK contain such code).
History
Date User Action Args
2007-08-23 15:42:51adminlinkissue1192789 messages
2007-08-23 15:42:51admincreate