MSYS2-packages/python/28881-backport.patch
2021-12-28 11:30:36 +01:00

56 lines
2.0 KiB
Diff

From 2e386cc70a7a719bbf664a9712e3c86ffbe63900 Mon Sep 17 00:00:00 2001
From: Mike Gilbert <floppym@gentoo.org>
Date: Mon, 11 Oct 2021 13:50:03 -0400
Subject: [PATCH] bpo-45433: Do not link libpython against libcrypt
Save/restore LIBS when calling AC_SEARCH_LIBS(..., crypt). This avoid
linking libpython with libcrypt.
---
Doc/whatsnew/3.11.rst | 2 ++
.../NEWS.d/next/Build/2021-10-11-16-08-37.bpo-45433.pVDkMV.rst | 1 +
configure | 3 +++
configure.ac | 3 +++
4 files changed, 9 insertions(+)
create mode 100644 Misc/NEWS.d/next/Build/2021-10-11-16-08-37.bpo-45433.pVDkMV.rst
--- a/configure
+++ b/configure
@@ -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 :
@@ -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 :
diff --git a/configure.ac b/configure.ac
index 6c65b2914bf66..afdc68363ceaf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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)
@@ -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, [