STINNER Victor <vstin...@redhat.com> added the comment:

I search if C extensions of the Python standard libraries are always linked or 
not to libpython... it's complicated. I tested _ctypes, _hashlib and _struct 
modules:

* Debian and Ubuntu: NOT linked to libpython
* Conda: LINKED to libpython
* Mageia 7: LINKED to libpython
* Fedora 28, RHEL 7: LINKED to libpython on Python 2.7 and 3.6, except _struct 
which is NOT linked to libpython on Python 2.7

It means that using dlopen("libpython2.7.so.1.0", RTLD_LOCAL | RTLD_NOW) may or 
may not work depending on the Linux distribution and depending on the imported 
C extensions...

If we use the example of Fedora: some C extensions are compiled using Makefile 
(the Fedora package modifies Modules/Setup, as I showed previously), but others 
are compiled by setup.py. For example, _ctypes and _hashlib are compiled by 
setup.py.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue34814>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to