From f6e9158b8b4ac2d8545950e00e51645fe7e8e481 Mon Sep 17 00:00:00 2001 From: yixiangzhike Date: Tue, 10 Aug 2021 10:36:40 +0800 Subject: [PATCH] Fix the compilation failure with new version glibc --- adcli.spec | 7 +++- ...ck-for-ns_get16-and-ns_get32-as-well.patch | 38 +++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 backport-configure-check-for-ns_get16-and-ns_get32-as-well.patch diff --git a/adcli.spec b/adcli.spec index 9a7758f..0c3ba93 100644 --- a/adcli.spec +++ b/adcli.spec @@ -1,12 +1,14 @@ Name: adcli Version: 0.9.1 -Release: 1 +Release: 2 Summary: A helper library and tools for Active Directory client operations Group: Development/Libraries License: LGPLv2+ URL: https://gitlab.freedesktop.org/realmd/adcli Source0: https://gitlab.freedesktop.org/sbose/adcli/uploads/30880d967e79cee789194435e70fbf30/adcli-%{version}.tar.gz +Patch0: backport-configure-check-for-ns_get16-and-ns_get32-as-well.patch + BuildRequires: gcc intltool pkgconfig libtool gettext-devel krb5-devel BuildRequires: openldap-devel libxslt xmlto git @@ -67,6 +69,9 @@ rm -rf %{buildroot} %doc %{_mandir}/man8/* %changelog +* Tue Aug 10 2021 yixiangzhike - 0.9.1-2 +- fix the compilation failure with new version glibc + * Tue Jul 27 2021 fuanan - 0.9.1-1 - update to 0.9.1 diff --git a/backport-configure-check-for-ns_get16-and-ns_get32-as-well.patch b/backport-configure-check-for-ns_get16-and-ns_get32-as-well.patch new file mode 100644 index 0000000..22f8a6a --- /dev/null +++ b/backport-configure-check-for-ns_get16-and-ns_get32-as-well.patch @@ -0,0 +1,38 @@ +From e841ba7513f3f8b6393183d2dea9adcbf7ba2e44 Mon Sep 17 00:00:00 2001 +From: Sumit Bose +Date: Wed, 28 Jul 2021 12:55:16 +0200 +Subject: [PATCH] configure: check for ns_get16 and ns_get32 as well + +With newer versions of glibc res_query() might ba already available in +glibc with ns_get16() and ns_get32() still requires libresolv. + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1984891 +--- + configure.ac | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/configure.ac b/configure.ac +index c6ff31d..fc6e790 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -98,13 +98,15 @@ AC_SUBST(LDAP_CFLAGS) + # ------------------------------------------------------------------- + # resolv + +-AC_MSG_CHECKING(for which library has res_query) ++AC_MSG_CHECKING([for which library has res_query, ns_get16 and ns_get32]) + for lib in "" "-lresolv"; do + saved_LIBS="$LIBS" + LIBS="$LIBS $lib" + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([#include ], +- [res_query (0, 0, 0, 0, 0)]) ++ [res_query (0, 0, 0, 0, 0); ++ ns_get32 (NULL); ++ ns_get16 (NULL);]) + ], + [ AC_MSG_RESULT(${lib:-libc}); have_res_query="yes"; break; ], + [ LIBS="$saved_LIBS" ]) +-- +2.31.1 + -- Gitee