GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||
GeezerVison is showing github.com — bpo-21536: C extensions are no longer linked to libpython by vstinner · Pull Request #12946 · python/cpython Conversation
|
|
This PR allows to load a C extension built by a shared libpython with a statically linked Python: https://bugs.python.org/issue21536#msg340819 It also allows to load C extension built in release mode with a Python built in debug mode: https://bugs.python.org/issue21536#msg340821 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
One potential issue: linking an application to libpython to embed Python, see discussion at https://bugs.python.org/issue21536#msg340837 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thank you!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
On Unix, C extensions are no longer linked to libpython. It is now possible to load a C extension built using a shared library Python with a statically linked Python. When Python is embedded, libpython must not be loaded with RTLD_LOCAL, but RTLD_GLOBAL instead. Previously, using RTLD_LOCAL, it was already not possible to load C extensions which were not linked to libpython, like C extensions of the standard library built by the "*shared*" section of Modules/Setup. distutils, python-config and python-config.py have been modified.
As of Python 3.8, python C extensions modules should not link to libpython, unless they embed the interpreter in their code. Relevant upstream PR: python/cpython#12946 Signed-off-by: Gabriel Féron <[email protected]>
As of Python 3.8, python C extensions modules should not link to libpython, unless they embed the interpreter in their code. Relevant upstream PR: python/cpython#12946 Signed-off-by: Gabriel Féron <[email protected]>
There was an error while loading. Please reload this page.
|
This change causes strange bugs on Mac OS X due to the two-level namespace symbol resolution for dynamic libraries. A C extension that links against libpython will resolve symbols from libpython instead of the python executable (for example, PDAL/python#75 ). I believe linking C extensions on Mac OS X with "-flat_namespace" would be a reliable fix, as it would allow the python executable symbols to take precedence over those from libpython. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Please don't comment closed PRs, but open a new issue at https://bugs.python.org/ Otherwise, your comment will simply be ignored. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.