Repository navigation
embed: link libpython3.<minor>, not the stable ABI stub - #16
Merged
Merged
Conversation
py_libname cut LDLIBRARY at its first dot: libpython3.13.so gave -lpython3, the stable ABI stub, whose symbols the linker does not resolve through it (undefined Py_Initialize etc. with MKN_PYTHON_LIB_EMBED). Strip only the lib prefix and the library suffix.
…thon<major><minor> without it (Windows)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With
MKN_PYTHON_LIB_EMBED=1,py_libnamecutLDLIBRARYat its first dot (since #11), solibpython3.13.sogave-lpython3: the stable ABI stub, which defines none of the API (0 symbols here vs 1677 inlibpython3.13.so), so embedding executables fail with undefinedPy_Initialize, ...The name now comes from python's sysconfig:
python+LDVERSION(3.13,3.13t,3.13d), the librarypython3-config --embedwould link (only sysconfig is used, python3-config is not always installed); withoutLDVERSION(Windows)python+ major and minor (python313).Tested: an executable embedding python 3.13 links (
-lpython3.13) and runs on Linux.