update: gnutls

This commit is contained in:
Mark Brand 2019-08-07 22:28:31 +02:00
parent 0826722f9c
commit 15e11514b0
2 changed files with 84 additions and 7 deletions

View File

@ -5,7 +5,7 @@ Contains ad hoc patches for cross building.
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Mark Brand <mabrand@mabrand.nl>
Date: Mon, 4 Feb 2013 16:11:12 +0100
Subject: [PATCH 1/4] add missing private lib to pc file
Subject: [PATCH 1/5] add missing private lib to pc file
diff --git a/lib/gnutls.pc.in b/lib/gnutls.pc.in
@ -24,7 +24,7 @@ index 1111111..2222222 100644
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Mark Brand <mabrand@mabrand.nl>
Date: Mon, 24 Nov 2014 08:56:48 +0100
Subject: [PATCH 2/4] windows build fix: ws2tcpip.h supplies inet_ntop
Subject: [PATCH 2/5] windows build fix: ws2tcpip.h supplies inet_ntop
Follow-up to 492c2b937ab66134d0b37499a6f3a747e19bc31a
@ -53,7 +53,7 @@ index 1111111..2222222 100644
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Mark Brand <mabrand@mabrand.nl>
Date: Sun, 7 May 2017 20:17:13 +0200
Subject: [PATCH 3/4] let gnutls configure detect libidn2
Subject: [PATCH 3/5] let gnutls configure detect libidn2
diff --git a/configure.ac b/configure.ac
@ -116,14 +116,14 @@ index 1111111..2222222 100644
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Mark Brand <mabrand@mabrand.nl>
Date: Thu, 6 Dec 2018 10:36:30 +0100
Subject: [PATCH 4/4] remove docs from configure.ac: avoid GTK_DOC dependencies
Subject: [PATCH 4/5] remove docs from configure.ac: avoid GTK_DOC dependencies
diff --git a/configure.ac b/configure.ac
index 1111111..2222222 100644
--- a/configure.ac
+++ b/configure.ac
@@ -946,17 +946,6 @@ AC_SUBST([YEAR], $YEAR)
@@ -976,17 +976,6 @@ AC_DEFINE_UNQUOTED([INI_START_COMMENT_PREFIXES], [";#"], [The comment prefixes])
AC_CONFIG_FILES([guile/pre-inst-guile], [chmod +x guile/pre-inst-guile])
AC_CONFIG_FILES([
Makefile
@ -141,3 +141,80 @@ index 1111111..2222222 100644
extra/Makefile
extra/includes/Makefile
libdane/Makefile
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Date: Fri, 2 Aug 2019 21:57:40 +0200
Subject: [PATCH 5/5] read_cpuid_vals: use __get_cpuid_count() only when
available
This makes the functionality available on gcc 4.8.
Resolves: #812
Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
diff --git a/configure.ac b/configure.ac
index 1111111..2222222 100644
--- a/configure.ac
+++ b/configure.ac
@@ -182,6 +182,17 @@ case $host_cpu in
;;
esac
+# check for gcc's __get_cpuid_count functionality
+AC_MSG_CHECKING([for __get_cpuid_count])
+AC_LINK_IFELSE(
+ [AC_LANG_SOURCE([
+ #include <cpuid.h>
+ int main(void) { unsigned t1; return __get_cpuid_count(7, 0, &t1, &t1, &t1, &t1); }
+ ])],
+ [AC_DEFINE([HAVE_GET_CPUID_COUNT], [1], [use __get_cpuid_count]) AC_MSG_RESULT([yes])],
+ [AC_MSG_RESULT([no])]
+)
+
fi
AC_ARG_ENABLE(tls13-interop,
diff --git a/lib/accelerated/x86/x86-common.c b/lib/accelerated/x86/x86-common.c
index 1111111..2222222 100644
--- a/lib/accelerated/x86/x86-common.c
+++ b/lib/accelerated/x86/x86-common.c
@@ -106,17 +106,33 @@ unsigned int _gnutls_x86_cpuid_s[4];
#define VIA_PADLOCK_PHE (1<<21)
#define VIA_PADLOCK_PHE_SHA512 (1<<22)
+#ifndef HAVE_GET_CPUID_COUNT
+static inline void
+get_cpuid_level7(unsigned int *eax, unsigned int *ebx,
+ unsigned int *ecx, unsigned int *edx)
+{
+ /* we avoid using __get_cpuid_count, because it is not available with gcc 4.8 */
+ if (__get_cpuid_max(7, 0) < 7)
+ return;
+
+ __cpuid_count(7, 0, *eax, *ebx, *ecx, *edx);
+ return;
+}
+#else
+# define get_cpuid_level7(a,b,c,d) __get_cpuid_count(7, 0, a, b, c, d)
+#endif
+
static unsigned read_cpuid_vals(unsigned int vals[4])
{
unsigned t1, t2, t3;
- if (!__get_cpuid(1, &t1, &vals[0],
- &vals[1], &t2))
+ vals[0] = vals[1] = vals[2] = vals[3] = 0;
+
+ if (!__get_cpuid(1, &t1, &vals[0], &vals[1], &t2))
return 0;
/* suppress AVX512; it works conditionally on certain CPUs on the original code */
vals[1] &= 0xfffff7ff;
- if (!__get_cpuid_count(7, 0, &t1, &vals[2], &t2, &t3))
- return 0;
+ get_cpuid_level7(&t1, &vals[2], &t2, &t3);
return 1;
}

View File

@ -3,8 +3,8 @@
PKG := gnutls
$(PKG)_WEBSITE := https://www.gnu.org/software/gnutls/
$(PKG)_DESCR := GnuTLS
$(PKG)_VERSION := 3.6.8
$(PKG)_CHECKSUM := aa81944e5635de981171772857e72be231a7e0f559ae0292d2737de475383e83
$(PKG)_VERSION := 3.6.9
$(PKG)_CHECKSUM := 4331fca55817ecdd74450b908a6c29b4f05bb24dd13144c6284aa34d872e1fcb
$(PKG)_SUBDIR := gnutls-$($(PKG)_VERSION)
$(PKG)_FILE := gnutls-$($(PKG)_VERSION).tar.xz
$(PKG)_URL := https://gnupg.org/ftp/gcrypt/gnutls/v3.6/$($(PKG)_FILE)