Skip to content

bpo-45433: Do not link libpython against libcrypt #28881

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

Merged
merged 1 commit into from
Oct 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Doc/whatsnew/3.11.rst
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,8 @@ Build Changes
* CPython can now be built with the ThinLTO option via ``--with-lto=thin``.
(Contributed by Dong-hee Na and Brett Holman in :issue:`44340`.)

* libpython is no longer linked against libcrypt.
(Contributed by Mike Gilbert in :issue:`45433`.)

C API Changes
=============
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Avoid linking libpython with libcrypt.
3 changes: 3 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -13227,6 +13227,8 @@ done

# We search for both crypt and crypt_r as one or the other may be defined
# This gets us our -lcrypt in LIBS when required on the target platform.
# Save/restore LIBS to avoid linking libpython with libcrypt.
LIBS_SAVE=$LIBS
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing crypt" >&5
$as_echo_n "checking for library containing crypt... " >&6; }
if ${ac_cv_search_crypt+:} false; then :
Expand Down Expand Up @@ -13368,6 +13370,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

fi

LIBS=$LIBS_SAVE

for ac_func in clock_gettime
do :
Expand Down
3 changes: 3 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -4085,6 +4085,8 @@ AC_CHECK_FUNCS(setpgrp,

# We search for both crypt and crypt_r as one or the other may be defined
# This gets us our -lcrypt in LIBS when required on the target platform.
# Save/restore LIBS to avoid linking libpython with libcrypt.
LIBS_SAVE=$LIBS
AC_SEARCH_LIBS(crypt, crypt)
AC_SEARCH_LIBS(crypt_r, crypt)

Expand All @@ -4099,6 +4101,7 @@ char *r = crypt_r("", "", &d);
[AC_DEFINE(HAVE_CRYPT_R, 1, [Define if you have the crypt_r() function.])],
[])
)
LIBS=$LIBS_SAVE

AC_CHECK_FUNCS(clock_gettime, [], [
AC_CHECK_LIB(rt, clock_gettime, [
Expand Down