From 62fe4ffb9837e0b2024cdc1a904a099ea321949e Mon Sep 17 00:00:00 2001 From: Anderson Toshiyuki Sasaki Date: Jun 10 2020 08:27:57 +0000 Subject: Fix automatic libraries soname detection Previously, the automatic soname detection were failing when the -Wl,--as-needed option was provided in LDFLAGS, which lead the FIPS self-tests to fail. --- diff --git a/gnutls-3.6.14-configure-fix-soname-detection.patch b/gnutls-3.6.14-configure-fix-soname-detection.patch new file mode 100644 index 0000000..28b33ad --- /dev/null +++ b/gnutls-3.6.14-configure-fix-soname-detection.patch @@ -0,0 +1,60 @@ +From b57b820a3f0464e3151dd675af4f28ad109d683c Mon Sep 17 00:00:00 2001 +From: Vitezslav Cizek +Date: Tue, 9 Jun 2020 13:54:04 +0200 +Subject: [PATCH] configure: improve nettle, gmp, and hogweed soname detection + +Some linkers might optimize away the libraries passed on the +command line if they aren't actually needed, such as gnu ld with +--as-needed. +The ldd output then won't list the shared libraries and the +detection will fail. +Make sure nettle and others are really used. + +Signed-off-by: Vitezslav Cizek +--- + configure.ac | 15 ++++++++++++--- + 1 file changed, 12 insertions(+), 3 deletions(-) + +diff --git a/configure.ac b/configure.ac +index e4ca66aec..ccbe4e563 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -741,7 +741,10 @@ LIBS=$save_LIBS + save_LIBS=$LIBS + LIBS="$LIBS $GMP_LIBS" + AC_MSG_CHECKING([gmp soname]) +-AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], ++AC_LINK_IFELSE([AC_LANG_PROGRAM([ ++ #include ],[ ++ mpz_t n; ++ mpz_init(n);])], + [gmp_so=`(eval "$LDDPROG conftest$EXEEXT $LDDPOSTPROC") | grep '^libgmp\.so'`], + [gmp_so=none]) + if test -z "$gmp_so"; then +@@ -754,7 +757,10 @@ LIBS=$save_LIBS + save_LIBS=$LIBS + LIBS="$LIBS $NETTLE_LIBS" + AC_MSG_CHECKING([nettle soname]) +-AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], ++AC_LINK_IFELSE([AC_LANG_PROGRAM([ ++ #include ],[ ++ struct sha256_ctx ctx; ++ sha256_init(&ctx);])], + [nettle_so=`(eval "$LDDPROG conftest$EXEEXT $LDDPOSTPROC") | grep '^libnettle\.so'`], + [nettle_so=none]) + if test -z "$nettle_so"; then +@@ -767,7 +773,10 @@ LIBS=$save_LIBS + save_LIBS=$LIBS + LIBS="$LIBS $HOGWEED_LIBS" + AC_MSG_CHECKING([hogweed soname]) +-AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], ++AC_LINK_IFELSE([AC_LANG_PROGRAM([ ++ #include ],[ ++ struct rsa_private_key priv; ++ nettle_rsa_private_key_init(&priv);])], + [hogweed_so=`(eval "$LDDPROG conftest$EXEEXT $LDDPOSTPROC") | grep '^libhogweed\.so'`], + [hogweed_so=none]) + if test -z "$hogweed_so"; then +-- +2.25.4 + diff --git a/gnutls.spec b/gnutls.spec index 16c40c4..1973b8f 100644 --- a/gnutls.spec +++ b/gnutls.spec @@ -4,6 +4,7 @@ Release: 2%{?dist} Patch1: gnutls-3.6.7-no-now-guile.patch Patch2: gnutls-3.2.7-rpath.patch Patch3: gnutls-3.6.14-fix-iovec-memory-leak.patch +Patch4: gnutls-3.6.14-configure-fix-soname-detection.patch %bcond_without dane %if 0%{?rhel} %bcond_with guile @@ -281,6 +282,7 @@ make check %{?_smp_mflags} GNUTLS_SYSTEM_PRIORITY_FILE=/dev/null %changelog * Tue Jun 09 2020 Anderson Sasaki - 3.6.14-2 - Fix memory leak when serializing iovec_t (#1845083) +- Fix automatic libraries sonames detection (#1845806) * Thu Jun 4 2020 Daiki Ueno - 3.6.14-1 - Update to upstream 3.6.14 release