Skip to content

Commit

Permalink
pythongh-99942: correct the pkg-config/python-config flags for cygwin…
Browse files Browse the repository at this point in the history
…/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
  • Loading branch information
eli-schwartz committed Dec 29, 2022
1 parent 9824b73 commit 6c694b4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -5827,7 +5827,7 @@ AC_MSG_RESULT($LDVERSION)

# On Android and Cygwin the shared libraries must be linked with libpython.
AC_SUBST(LIBPYTHON)
if test -n "$ANDROID_API_LEVEL" -o "$MACHDEP" = "cygwin"; then
if test "$PY_ENABLE_SHARED" = "1" && ( test -n "$ANDROID_API_LEVEL" || test "$MACHDEP" = "cygwin"); then
LIBPYTHON="-lpython${VERSION}${ABIFLAGS}"
else
LIBPYTHON=''
Expand Down

0 comments on commit 6c694b4

Please sign in to comment.