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 vstinner
Recipients barry, doko, eric.smith, koobs, martin.panter, mdk, nascheme, pitrou, twouters, vstinner, xdegaye, yan12125
Date 2018-09-27.10:49:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <[email protected]>
In-reply-to
Content
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.
History
Date User Action Args
2018-09-27 10:49:02vstinnersetrecipients: + vstinner, twouters, barry, nascheme, doko, pitrou, eric.smith, xdegaye, martin.panter, koobs, yan12125, mdk
2018-09-27 10:49:02vstinnersetmessageid: <[email protected]>
2018-09-27 10:49:02vstinnerlinkissue34814 messages
2018-09-27 10:49:02vstinnercreate