--- Python-2.7.2-orig/Include/pyport.h 2011-06-11 17:46:23.000000000 +0200 +++ Python-2.7.2/Include/pyport.h 2012-01-12 18:38:06.540453128 +0100 @@ -748,8 +748,22 @@ extern int fdatasync(int); # define PyMODINIT_FUNC __declspec(dllexport) void # endif /* __cplusplus */ # endif /* Py_BUILD_CORE */ -# endif /* HAVE_DECLSPEC */ -#endif /* Py_ENABLE_SHARED */ +# else /* !HAVE_DECLSPEC_DLL */ +# ifdef Py_BUILD_CORE +# define PyAPI_FUNC(RTYPE) __attribute__ ((visibility ("default"))) RTYPE +# define PyAPI_DATA(RTYPE) extern __attribute__ ((visibility ("default"))) RTYPE + /* module init functions inside the core need no external linkage */ +# define PyMODINIT_FUNC void +# else /* Py_BUILD_CORE */ + /* module init functions outside the core must be exported */ +# if defined(__cplusplus) +# define PyMODINIT_FUNC extern "C" __attribute__ ((visibility ("default"))) void +# else /* __cplusplus */ +# define PyMODINIT_FUNC __attribute__ ((visibility ("default"))) void +# endif /* __cplusplus */ +# endif /* Py_BUILD_CORE */ +# endif /* !HAVE_DECLSPEC_DLL */ +#endif /* Py_ENABLE_SHARED || __CYGWIN__ */ /* If no external linkage macros defined by now, create defaults */ #ifndef PyAPI_FUNC --- Python-2.7.2-orig/configure 2012-01-12 18:29:50.049411739 +0100 +++ Python-2.7.2/configure 2012-01-12 18:44:06.979209525 +0100 @@ -7774,7 +7774,7 @@ then then CCSHARED="-fPIC"; else CCSHARED="+z"; fi;; - Linux*|GNU*) CCSHARED="-fPIC";; + Linux*|GNU*) CCSHARED="-fPIC -fvisibility=hidden";; BSD/OS*/4*) CCSHARED="-fpic";; FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) CCSHARED="-fPIC";; OpenUNIX*|UnixWare*) @@ -7808,7 +7808,6 @@ then LINKFORSHARED="-Wl,-E -Wl,+s";; # LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";; BSD/OS/4*) LINKFORSHARED="-Xlinker -export-dynamic";; - Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";; # -u libsys_s pulls in all symbols in libsys Darwin/*) # -u _PyMac_Error is needed to pull in the mac toolbox glue, --- Python-2.7.2-orig/configure.in 2012-01-12 18:29:50.020411841 +0100 +++ Python-2.7.2/configure.in 2012-01-12 18:43:41.026299045 +0100 @@ -1939,7 +1939,7 @@ then then CCSHARED="-fPIC"; else CCSHARED="+z"; fi;; - Linux*|GNU*) CCSHARED="-fPIC";; + Linux*|GNU*) CCSHARED="-fPIC -fvisibility=hidden";; BSD/OS*/4*) CCSHARED="-fpic";; FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) CCSHARED="-fPIC";; OpenUNIX*|UnixWare*) @@ -1971,7 +1971,6 @@ then LINKFORSHARED="-Wl,-E -Wl,+s";; # LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";; BSD/OS/4*) LINKFORSHARED="-Xlinker -export-dynamic";; - Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";; # -u libsys_s pulls in all symbols in libsys Darwin/*) # -u _PyMac_Error is needed to pull in the mac toolbox glue, --- Python-2.7.2-orig/Python/getargs.c 2011-06-11 17:46:27.000000000 +0200 +++ Python-2.7.2/Python/getargs.c 2012-01-12 18:54:56.352239609 +0100 @@ -18,7 +18,6 @@ int PyArg_ParseTupleAndKeywords(PyObject int PyArg_VaParseTupleAndKeywords(PyObject *, PyObject *, const char *, char **, va_list); -#ifdef HAVE_DECLSPEC_DLL /* Export functions */ PyAPI_FUNC(int) _PyArg_Parse_SizeT(PyObject *, char *, ...); PyAPI_FUNC(int) _PyArg_ParseTuple_SizeT(PyObject *, char *, ...); @@ -28,7 +27,6 @@ PyAPI_FUNC(PyObject *) _Py_BuildValue_Si PyAPI_FUNC(int) _PyArg_VaParse_SizeT(PyObject *, char *, va_list); PyAPI_FUNC(int) _PyArg_VaParseTupleAndKeywords_SizeT(PyObject *, PyObject *, const char *, char **, va_list); -#endif #define FLAG_COMPAT 1 #define FLAG_SIZE_T 2 --- Python-2.7.2-x/Modules/_ctypes/_ctypes_test.c 2011-06-11 17:46:26.000000000 +0200 +++ Python-2.7.2/Modules/_ctypes/_ctypes_test.c 2012-01-12 19:00:17.559257656 +0100 @@ -609,7 +609,7 @@ EXPORT (HRESULT) KeepObject(IUnknown *pu #endif -DL_EXPORT(void) +PyMODINIT_FUNC init_ctypes_test(void) { Py_InitModule("_ctypes_test", module_methods); --- Python-2.7.2-x/Modules/_elementtree.c 2011-06-11 17:46:26.000000000 +0200 +++ Python-2.7.2/Modules/_elementtree.c 2012-01-12 19:00:30.271218795 +0100 @@ -2860,7 +2860,7 @@ static PyMethodDef _functions[] = { {NULL, NULL} }; -DL_EXPORT(void) +PyMODINIT_FUNC init_elementtree(void) { PyObject* m; --- Python-2.7.2-x/Modules/_hotshot.c 2011-06-11 17:46:26.000000000 +0200 +++ Python-2.7.2/Modules/_hotshot.c 2012-01-12 19:00:51.999152370 +0100 @@ -1604,7 +1604,7 @@ static PyMethodDef functions[] = { }; -void +PyMODINIT_FUNC init_hotshot(void) { PyObject *module; --- Python-2.7.2-x/Modules/_json.c 2011-06-11 17:46:27.000000000 +0200 +++ Python-2.7.2/Modules/_json.c 2012-01-12 19:01:05.268111822 +0100 @@ -2403,7 +2403,7 @@ static PyMethodDef speedups_methods[] = PyDoc_STRVAR(module_doc, "json speedups\n"); -void +PyMODINIT_FUNC init_json(void) { PyObject *m; --- Python-2.7.2-x/Modules/ossaudiodev.c 2011-06-11 17:46:27.000000000 +0200 +++ Python-2.7.2/Modules/ossaudiodev.c 2012-01-12 19:01:23.311056643 +0100 @@ -939,7 +939,7 @@ error1: } -void +PyMODINIT_FUNC initossaudiodev(void) { PyObject *m;