Skip to content

Commit be21706

Browse files
authored
bpo-45433: Do not link libpython against libcrypt (GH-28881)
Save/restore LIBS when calling AC_SEARCH_LIBS(..., crypt). This avoid linking libpython with libcrypt.
1 parent ce3489c commit be21706

File tree

4 files changed

+9
-0
lines changed

4 files changed

+9
-0
lines changed

Doc/whatsnew/3.11.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,8 @@ Build Changes
457457
* CPython can now be built with the ThinLTO option via ``--with-lto=thin``.
458458
(Contributed by Dong-hee Na and Brett Holman in :issue:`44340`.)
459459

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

461463
C API Changes
462464
=============
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Avoid linking libpython with libcrypt.

configure

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13227,6 +13227,8 @@ done
1322713227

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

1336913371
fi
1337013372

13373+
LIBS=$LIBS_SAVE
1337113374

1337213375
for ac_func in clock_gettime
1337313376
do :

configure.ac

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4085,6 +4085,8 @@ AC_CHECK_FUNCS(setpgrp,
40854085

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

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

41034106
AC_CHECK_FUNCS(clock_gettime, [], [
41044107
AC_CHECK_LIB(rt, clock_gettime, [

0 commit comments

Comments
 (0)