Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-44133: Export Py_FrozenMain() symbol #26130

Closed
wants to merge 1 commit into from
Closed

bpo-44133: Export Py_FrozenMain() symbol #26130

wants to merge 1 commit into from

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented May 14, 2021

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.

https://bugs.python.org/issue44133

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.
Copy link
Member

@pablogsal pablogsal left a comment

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?

@vstinner
Copy link
Member Author

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.

@pablogsal
Copy link
Member

pablogsal commented May 14, 2021

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?

Copy link
Member

@corona10 corona10 left a comment

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?

@github-actions
Copy link

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale Stale PR or inactive for long period of time. label Jun 15, 2021
@vstinner
Copy link
Member Author

-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.

@vstinner vstinner closed this Sep 21, 2021
@vstinner vstinner deleted the export_frozenmain branch September 21, 2021 22:10
@shihai1991
Copy link
Member

-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.

I use --whole-archive or all_load in configure.ac. It works in my local centos vm. #29876

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting merge stale Stale PR or inactive for long period of time.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants