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

gh-99942: correct the pkg-config/python-config flags for cygwin/android #100967

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

eli-schwartz
Copy link
Contributor

@eli-schwartz eli-schwartz commented Jan 12, 2023

On shared build configurations, Cygwin and Android need to link to libpython. See bpo-21536.

This was corrected in distutils with an explicit check to only link when libpython is built shared, but implemented in configure.ac unconditionally. The correct approach is to follow distutils, which includes a comment regarding why:

  • on Android, a shared libpython is RTLD_LOCAL, and thus available only to the main executable, not exported to loaded modules, but a static libpython is the main executable and thus exported

  • on Cygwin, symbols in shared libraries must be resolved at link time

It's actually not clear to me what to do for Cygwin. Cygwin doesn't actually build static libpython successfully. If it did, then extensions probably need to be linked to the import library for the executable, rather than the full static library. So omitting this here is probably correct, but incomplete. Either way, it won't matter until other fixes are made.

…/android

On shared build configurations, Cygwin and Android need to link to
libpython. See bpo-21536.

This was corrected in distutils with an explicit check to only link when
libpython is built shared, but implemented in configure.ac
unconditionally. The correct approach is to follow distutils, which
includes a comment regarding why:

- on Android, a shared libpython is RTLD_LOCAL, and thus available only
  to the main executable, not exported to loaded modules, but a static
  libpython *is* the main executable and thus exported

- on Cygwin, symbols in shared libraries must be resolved at link time

It's actually not clear to me what to do for Cygwin. Cygwin doesn't
actually build static libpython successfully. If it did, then extensions
probably need to be linked to the import library for the executable,
rather than the full static library. So omitting this here is probably
correct, but incomplete. Either way, it won't matter until other fixes
are made.
@CAM-Gerlach CAM-Gerlach added the build The build process and cross-build label Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review build The build process and cross-build
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants