[issue23685] Fix usage of PyMODINIT_FUNC

STINNER Victor report at bugs.python.org
Tue Mar 17 17:44:02 CET 2015


STINNER Victor added the comment:

builtin_modules.patch: add _PyBUILTIN_MODINIT_FUNC macro and use it on modules which are builtins on POSIX.

I checked: it's not necessary to modify Modules/config.c to make the symbol hidden: only the C code in Modules/ need to set the attribute on the function.

So Modules/config.c, Modules/config.c.in, Modules/makesetup, PC/config.c, Tools/freeze/makeconfig.py, ... are unchanged by the patch.

--

On Linux with GCC >= 4.0, you can test manually to hide PyInit_xxx symbols using:

#define _PyBUILTIN_MODINIT_FUNC __attribute__((visibility("hidden"))) PyObject*

----------
Added file: http://bugs.python.org/file38527/builtin_modules.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23685>
_______________________________________


More information about the Python-bugs-list mailing list