bpo-44133: Export Py_FrozenMain() symbol by vstinner · Pull Request #26130 · python/cpython
Conversation
The Python binary now builds the libpython static library using
"-Wl,--whole-archive" linker option to export all symbols exported by
object files. Previously, the "Py_FrozenMain" symbol was not
exported.
The Python binary now builds the libpython static library using "-Wl,--whole-archive" linker option to export all symbols exported by object files. Previously, the "Py_FrozenMain" symbol was not exported.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs backport to 3.10 at the very least, no?
I'm not sure that it makes sense to treat a python executable binary as a library, and so expect that all symbols are exported.
I'm not sure that it makes sense to treat a python executable binary as a library
It absolutely does, if not, how can C extensions get access to the C-API?
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang does not support --whole-archive can we use -all_load on macOS for that purpose?
-Wl,--whole-archive is not as portable as as expected. IMO another approach should be taken. Don't use the static library to link the "python" binary, "simply" pass the whole list of all object files.
-Wl,--whole-archiveis not as portable as as expected. IMO another approach should be taken. Don't use the static library to link the "python" binary, "simply" pass the whole list of all object files.
I use --whole-archive or all_load in configure.ac. It works in my local centos vm. #29876
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