Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 839592b

Browse files
floppymcolesbury
authored andcommitted
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 4b66352 commit 839592b

3 files changed

Lines changed: 7 additions & 0 deletions

File tree

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
@@ -13049,6 +13049,8 @@ done
1304913049

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

1319113193
fi
1319213194

13195+
LIBS=$LIBS_SAVE
1319313196

1319413197
for ac_func in clock_gettime
1319513198
do :

‎configure.ac‎

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

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

@@ -4061,6 +4063,7 @@ char *r = crypt_r("", "", &d);
40614063
[AC_DEFINE(HAVE_CRYPT_R, 1, [Define if you have the crypt_r() function.])],
40624064
[])
40634065
)
4066+
LIBS=$LIBS_SAVE
40644067

40654068
AC_CHECK_FUNCS(clock_gettime, [], [
40664069
AC_CHECK_LIB(rt, clock_gettime, [

0 commit comments

Comments
 (0)