[vlc-commits] [Git][videolan/vlc][3.0.x] 5 commits: contrib: gcrypt: update to 1.10.1

Steve Lhomme (@robUx4) gitlab at videolan.org
Tue May 6 06:23:34 UTC 2025



Steve Lhomme pushed to branch 3.0.x at VideoLAN / VLC


Commits:
850dd594 by Steve Lhomme at 2025-05-06T05:36:28+00:00
contrib: gcrypt: update to 1.10.1

Enabled blake2 and chacha20 because there are some missing ifdef throughout the
code to enable/disable some code if they are not set. The easiest fix is to
just enable them, rather than patching the code.

(cherry picked from commit 8883fd6feadb537cc5b62f41a3c7404c10cb604b) (edited)
edited:
- the 3.0 branch didn't have the .S patch
- the 3.0 branch was already using $(GNUGPG)
- the 3.0 branch doesn't use MAKEBUILDDIR

- - - - -
a5913162 by Steve Lhomme at 2025-05-06T05:36:28+00:00
contrib: gcrypt: fix UWP build

(cherry picked from commit e428cc3d7f5b476b3fbe38b31c382a0e58917878)

- - - - -
29dcf801 by Steve Lhomme at 2025-05-06T05:36:28+00:00
contrib: gcrypt: avoid getpid calls on Windows

It's not available in UWP.

(cherry picked from commit cfd40b3f4df13a3c740ff64d3ab35074f462261e) (rebased)
rebased:
- 3.0 doesn't depend on $(DEPS_gpg-error)

- - - - -
19f0bba6 by Steve Lhomme at 2025-05-06T05:36:28+00:00
contrib: gcrypt: don't build command-line tools when cross-compiling

It builds faster and makes prebuilt tarballs smaller.

(cherry picked from commit afff6353250803a37bf58657cc0020c0a9db1d25)

- - - - -
504ffcaa by Steve Lhomme at 2025-05-06T05:36:28+00:00
contrib: gcrypt: use the path to the gpg-error we install

So we don't have to hardcode the PATH.

(cherry picked from commit 2c5e7d3c7738bcc72222b60e41064dea008a26e1) (rebased)
rebased
- 3.0 calls disable-docs instead of disable-doc

- - - - -


11 changed files:

- − contrib/src/gcrypt/0001-random-Don-t-assume-that-_WIN64-implies-x86_64.patch
- − contrib/src/gcrypt/0002-aarch64-mpi-Fix-building-the-mpi-aarch64-assembly-fo.patch
- contrib/src/gcrypt/0007-random-don-t-use-API-s-that-are-forbidden-in-UWP-app.patch
- contrib/src/gcrypt/0008-random-only-use-wincrypt-in-UWP-builds-if-WINSTORECO.patch
- − contrib/src/gcrypt/64bits-relocation.patch
- contrib/src/gcrypt/SHA512SUMS
- − contrib/src/gcrypt/clang-mips64.patch
- contrib/src/gcrypt/disable-tests-compilation.patch
- contrib/src/gcrypt/fix-pthread-detection.patch
- + contrib/src/gcrypt/gcrypt-uwp-getpid.patch
- contrib/src/gcrypt/rules.mak


Changes:

=====================================
contrib/src/gcrypt/0001-random-Don-t-assume-that-_WIN64-implies-x86_64.patch deleted
=====================================
@@ -1,43 +0,0 @@
-From ed41d6d6fb4551342b22ef763de1bd60e964e186 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin at martin.st>
-Date: Thu, 22 Mar 2018 23:32:36 +0200
-Subject: [PATCH 1/2] random: Don't assume that _WIN64 implies x86_64
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-* random/rndw32.c: Change _WIN64 ifdef into __x86_64__.
---
-
-This fixes building this file for windows on aarch64.
-
-Signed-off-by: Martin Storsjö <martin at martin.st>
----
- random/rndw32.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/random/rndw32.c b/random/rndw32.c
-index 7e9ac50..08a8867 100644
---- a/random/rndw32.c
-+++ b/random/rndw32.c
-@@ -986,7 +986,7 @@ _gcry_rndw32_gather_random_fast (void (*add)(const void*, size_t,
- 
-      On AMD64, TSC is always available and intrinsic is provided for accessing
-      it.  */
--#ifdef __WIN64__
-+#ifdef __x86_64__
-     {
-       unsigned __int64 aint64;
- 
-@@ -1024,7 +1024,7 @@ _gcry_rndw32_gather_random_fast (void (*add)(const void*, size_t,
-           (*add) (&aword, sizeof (aword), origin );
-         }
-     }
--#endif /*__WIN64__*/
-+#endif /*__x86_64__*/
- 
- 
- }
--- 
-2.7.4
-


=====================================
contrib/src/gcrypt/0002-aarch64-mpi-Fix-building-the-mpi-aarch64-assembly-fo.patch deleted
=====================================
@@ -1,207 +0,0 @@
-From ec0a2f25c0f64a7b65b373508ce9081e10461965 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin at martin.st>
-Date: Thu, 22 Mar 2018 23:32:37 +0200
-Subject: [PATCH 2/2] aarch64: mpi: Fix building the mpi aarch64 assembly for
- windows
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-* mpi/aarch64/mpih-add1.S: Use ELF macro.
-* mpi/aarch64/mpih-mul1.S: Use ELF macro.
-* mpi/aarch64/mpih-mul2.S: Use ELF macro.
-* mpi/aarch64/mpih-mul3.S: Use ELF macro.
-* mpi/aarch64/mpih-sub1.S: Use ELF macro.
-* mpi/asm-common-aarch64.h: New.
---
-
-The mpi aarch64 assembly is enabled as soon as the compiler supports
-inline assembly, without checking for .type and .size, as is done
-for the rest of the assembly in cipher/*.S. (The .type and .size
-directives are only supported on ELF.)
-
-Signed-off-by: Martin Storsjö <martin at martin.st>
----
- mpi/aarch64/mpih-add1.S  |  5 +++--
- mpi/aarch64/mpih-mul1.S  |  5 +++--
- mpi/aarch64/mpih-mul2.S  |  5 +++--
- mpi/aarch64/mpih-mul3.S  |  5 +++--
- mpi/aarch64/mpih-sub1.S  |  5 +++--
- mpi/asm-common-aarch64.h | 30 ++++++++++++++++++++++++++++++
- 6 files changed, 45 insertions(+), 10 deletions(-)
- create mode 100644 mpi/asm-common-aarch64.h
-
-diff --git a/mpi/aarch64/mpih-add1.S b/mpi/aarch64/mpih-add1.S
-index fa8cd01..4ead1c2 100644
---- a/mpi/aarch64/mpih-add1.S
-+++ b/mpi/aarch64/mpih-add1.S
-@@ -22,6 +22,7 @@
- 
- #include "sysdep.h"
- #include "asm-syntax.h"
-+#include "asm-common-aarch64.h"
- 
- /*******************
-  *  mpi_limb_t
-@@ -34,7 +35,7 @@
- .text
- 
- .globl _gcry_mpih_add_n
--.type  _gcry_mpih_add_n,%function
-+ELF(.type  _gcry_mpih_add_n,%function)
- _gcry_mpih_add_n:
- 	and	x5, x3, #3;
- 	adds	xzr, xzr, xzr; /* clear carry flag */
-@@ -68,4 +69,4 @@ _gcry_mpih_add_n:
- .Lend:
- 	adc	x0, xzr, xzr;
- 	ret;
--.size _gcry_mpih_add_n,.-_gcry_mpih_add_n;
-+ELF(.size _gcry_mpih_add_n,.-_gcry_mpih_add_n;)
-diff --git a/mpi/aarch64/mpih-mul1.S b/mpi/aarch64/mpih-mul1.S
-index 65e98fe..8a86269 100644
---- a/mpi/aarch64/mpih-mul1.S
-+++ b/mpi/aarch64/mpih-mul1.S
-@@ -22,6 +22,7 @@
- 
- #include "sysdep.h"
- #include "asm-syntax.h"
-+#include "asm-common-aarch64.h"
- 
- /*******************
-  * mpi_limb_t
-@@ -34,7 +35,7 @@
- .text
- 
- .globl _gcry_mpih_mul_1
--.type  _gcry_mpih_mul_1,%function
-+ELF(.type  _gcry_mpih_mul_1,%function)
- _gcry_mpih_mul_1:
- 	and	x5, x2, #3;
- 	mov	x4, xzr;
-@@ -93,4 +94,4 @@ _gcry_mpih_mul_1:
- .Lend:
- 	mov	x0, x4;
- 	ret;
--.size _gcry_mpih_mul_1,.-_gcry_mpih_mul_1;
-+ELF(.size _gcry_mpih_mul_1,.-_gcry_mpih_mul_1;)
-diff --git a/mpi/aarch64/mpih-mul2.S b/mpi/aarch64/mpih-mul2.S
-index bd3b2c9..c7c08e5 100644
---- a/mpi/aarch64/mpih-mul2.S
-+++ b/mpi/aarch64/mpih-mul2.S
-@@ -22,6 +22,7 @@
- 
- #include "sysdep.h"
- #include "asm-syntax.h"
-+#include "asm-common-aarch64.h"
- 
- /*******************
-  * mpi_limb_t
-@@ -34,7 +35,7 @@
- .text
- 
- .globl _gcry_mpih_addmul_1
--.type  _gcry_mpih_addmul_1,%function
-+ELF(.type  _gcry_mpih_addmul_1,%function)
- _gcry_mpih_addmul_1:
- 	and	x5, x2, #3;
- 	mov	x6, xzr;
-@@ -105,4 +106,4 @@ _gcry_mpih_addmul_1:
- .Lend:
- 	mov	x0, x6;
- 	ret;
--.size _gcry_mpih_addmul_1,.-_gcry_mpih_addmul_1;
-+ELF(.size _gcry_mpih_addmul_1,.-_gcry_mpih_addmul_1;)
-diff --git a/mpi/aarch64/mpih-mul3.S b/mpi/aarch64/mpih-mul3.S
-index a58bc53..ccc961e 100644
---- a/mpi/aarch64/mpih-mul3.S
-+++ b/mpi/aarch64/mpih-mul3.S
-@@ -22,6 +22,7 @@
- 
- #include "sysdep.h"
- #include "asm-syntax.h"
-+#include "asm-common-aarch64.h"
- 
- /*******************
-  * mpi_limb_t
-@@ -34,7 +35,7 @@
- .text
- 
- .globl _gcry_mpih_submul_1
--.type  _gcry_mpih_submul_1,%function
-+ELF(.type  _gcry_mpih_submul_1,%function)
- _gcry_mpih_submul_1:
- 	and	x5, x2, #3;
- 	mov	x7, xzr;
-@@ -118,4 +119,4 @@ _gcry_mpih_submul_1:
- .Loop_end:
- 	cinc	x0, x7, cc;
- 	ret;
--.size _gcry_mpih_submul_1,.-_gcry_mpih_submul_1;
-+ELF(.size _gcry_mpih_submul_1,.-_gcry_mpih_submul_1;)
-diff --git a/mpi/aarch64/mpih-sub1.S b/mpi/aarch64/mpih-sub1.S
-index cbf2f08..4a66373 100644
---- a/mpi/aarch64/mpih-sub1.S
-+++ b/mpi/aarch64/mpih-sub1.S
-@@ -22,6 +22,7 @@
- 
- #include "sysdep.h"
- #include "asm-syntax.h"
-+#include "asm-common-aarch64.h"
- 
- /*******************
-  *  mpi_limb_t
-@@ -34,7 +35,7 @@
- .text
- 
- .globl _gcry_mpih_sub_n
--.type  _gcry_mpih_sub_n,%function
-+ELF(.type  _gcry_mpih_sub_n,%function)
- _gcry_mpih_sub_n:
- 	and	x5, x3, #3;
- 	subs	xzr, xzr, xzr; /* prepare carry flag for sub */
-@@ -68,4 +69,4 @@ _gcry_mpih_sub_n:
- .Lend:
- 	cset	x0, cc;
- 	ret;
--.size _gcry_mpih_sub_n,.-_gcry_mpih_sub_n;
-+ELF(.size _gcry_mpih_sub_n,.-_gcry_mpih_sub_n;)
-diff --git a/mpi/asm-common-aarch64.h b/mpi/asm-common-aarch64.h
-new file mode 100644
-index 0000000..1269413
---- /dev/null
-+++ b/mpi/asm-common-aarch64.h
-@@ -0,0 +1,30 @@
-+/* asm-common-aarch64.h  -  Common macros for AArch64 assembly
-+ *
-+ * Copyright (C) 2018 Martin Storsjö <martin at martin.st>
-+ *
-+ * This file is part of Libgcrypt.
-+ *
-+ * Libgcrypt is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as
-+ * published by the Free Software Foundation; either version 2.1 of
-+ * the License, or (at your option) any later version.
-+ *
-+ * Libgcrypt is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public
-+ * License along with this program; if not, see <http://www.gnu.org/licenses/>.
-+ */
-+
-+#ifndef MPI_ASM_COMMON_AARCH64_H
-+#define MPI_ASM_COMMON_AARCH64_H
-+
-+#ifdef __ELF__
-+# define ELF(...) __VA_ARGS__
-+#else
-+# define ELF(...) /*_*/
-+#endif
-+
-+#endif /* MPI_ASM_COMMON_AARCH64_H */
--- 
-2.7.4
-


=====================================
contrib/src/gcrypt/0007-random-don-t-use-API-s-that-are-forbidden-in-UWP-app.patch
=====================================
@@ -1,18 +1,18 @@
-From 95cc768cce8de579d0414830fe1d93c15f9594a7 Mon Sep 17 00:00:00 2001
+From 9e794b8b2065d233e21f378217705df6985f6a18 Mon Sep 17 00:00:00 2001
 From: Steve Lhomme <robux4 at ycbcr.xyz>
 Date: Fri, 19 Jun 2020 10:40:06 +0200
-Subject: [PATCH 7/9] random: don't use API's that are forbidden in UWP apps to
+Subject: [PATCH 7/8] random: don't use API's that are forbidden in UWP apps to
  init the random generator
 
 ---
- random/rndw32.c | 29 +++++++++++++++++++++++++----
- 1 file changed, 25 insertions(+), 4 deletions(-)
+ random/rndw32.c | 30 +++++++++++++++++++++++++-----
+ 1 file changed, 25 insertions(+), 5 deletions(-)
 
 diff --git a/random/rndw32.c b/random/rndw32.c
-index aefc7275..45d1e7e7 100644
+index b3f63d20..02d20cc3 100644
 --- a/random/rndw32.c
 +++ b/random/rndw32.c
-@@ -337,6 +337,7 @@ read_mbm_data (void (*add)(const void*, size_t, enum random_origins),
+@@ -338,6 +338,7 @@ read_mbm_data (void (*add)(const void*, size_t, enum random_origins),
    HANDLE hMBMData;
    SharedData *mbmDataPtr;
  
@@ -20,7 +20,7 @@ index aefc7275..45d1e7e7 100644
    hMBMData = OpenFileMapping (FILE_MAP_READ, FALSE, "$M$B$M$5$S$D$" );
    if (hMBMData)
      {
-@@ -351,6 +352,7 @@ read_mbm_data (void (*add)(const void*, size_t, enum random_origins),
+@@ -352,6 +353,7 @@ read_mbm_data (void (*add)(const void*, size_t, enum random_origins),
          }
        CloseHandle (hMBMData);
      }
@@ -28,7 +28,7 @@ index aefc7275..45d1e7e7 100644
  }
  
  
-@@ -359,6 +361,7 @@ static void
+@@ -360,6 +362,7 @@ static void
  registry_poll (void (*add)(const void*, size_t, enum random_origins),
                 enum random_origins requester)
  {
@@ -36,7 +36,7 @@ index aefc7275..45d1e7e7 100644
    static int cbPerfData = PERFORMANCE_BUFFER_SIZE;
    int iterations;
    DWORD dwSize, status;
-@@ -478,6 +481,7 @@ registry_poll (void (*add)(const void*, size_t, enum random_origins),
+@@ -479,6 +482,7 @@ registry_poll (void (*add)(const void*, size_t, enum random_origins),
       isn't done then any system components which provide performance data
       can't be removed or changed while the handle remains active.  */
    RegCloseKey (HKEY_PERFORMANCE_DATA);
@@ -44,7 +44,7 @@ index aefc7275..45d1e7e7 100644
  }
  
  
-@@ -496,6 +500,7 @@ slow_gatherer ( void (*add)(const void*, size_t, enum random_origins),
+@@ -497,6 +501,7 @@ slow_gatherer ( void (*add)(const void*, size_t, enum random_origins),
  
    if ( !is_initialized )
      {
@@ -52,7 +52,7 @@ index aefc7275..45d1e7e7 100644
        HKEY hKey;
  
        if ( debug_me )
-@@ -565,6 +570,10 @@ slow_gatherer ( void (*add)(const void*, size_t, enum random_origins),
+@@ -566,6 +571,10 @@ slow_gatherer ( void (*add)(const void*, size_t, enum random_origins),
            if (!pNtQuerySystemInformation || !pNtQueryInformationProcess)
              hNTAPI = NULL;
          }
@@ -63,7 +63,7 @@ index aefc7275..45d1e7e7 100644
  
  
        is_initialized = 1;
-@@ -594,6 +603,7 @@ slow_gatherer ( void (*add)(const void*, size_t, enum random_origins),
+@@ -595,6 +604,7 @@ slow_gatherer ( void (*add)(const void*, size_t, enum random_origins),
        }
    }
  
@@ -71,7 +71,7 @@ index aefc7275..45d1e7e7 100644
    /* Get disk I/O statistics for all the hard drives.  100 is an
       arbitrary failsafe limit.  */
    for (drive_no = 0; drive_no < 100 ; drive_no++)
-@@ -628,6 +638,7 @@ slow_gatherer ( void (*add)(const void*, size_t, enum random_origins),
+@@ -629,6 +639,7 @@ slow_gatherer ( void (*add)(const void*, size_t, enum random_origins),
          }
        CloseHandle (hDevice);
      }
@@ -79,24 +79,26 @@ index aefc7275..45d1e7e7 100644
  
    /* In theory we should be using the Win32 performance query API to obtain
       unpredictable data from the system, however this is so unreliable (see
-@@ -786,12 +797,16 @@ _gcry_rndw32_gather_random (void (*add)(const void*, size_t,
+@@ -788,6 +799,7 @@ _gcry_rndw32_gather_random (void (*add)(const void*, size_t,
  
    if (!is_initialized)
      {
 +#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
        OSVERSIONINFO osvi = { sizeof( osvi ) };
+       const char *s;
  
-       GetVersionEx( &osvi );
+@@ -798,7 +810,9 @@ _gcry_rndw32_gather_random (void (*add)(const void*, size_t,
        if (osvi.dwPlatformId != VER_PLATFORM_WIN32_NT)
          log_fatal ("can only run on a Windows NT platform\n" );
        system_is_w2000 = (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 0);
+-
 +#else /* !WINAPI_PARTITION_DESKTOP */
 +      system_is_w2000 = 0;
 +#endif /* !WINAPI_PARTITION_DESKTOP */
        init_system_rng ();
        is_initialized = 1;
      }
-@@ -842,14 +857,11 @@ _gcry_rndw32_gather_random_fast (void (*add)(const void*, size_t,
+@@ -856,14 +870,11 @@ _gcry_rndw32_gather_random_fast (void (*add)(const void*, size_t,
                          ADDINT((SIZE_T)aptr);                      \
                        } while (0)
  
@@ -112,7 +114,7 @@ index aefc7275..45d1e7e7 100644
      ADDPTR ( GetDesktopWindow ());
      ADDPTR ( GetFocus ());
      ADDINT ( GetInputState ());
-@@ -858,6 +870,11 @@ _gcry_rndw32_gather_random_fast (void (*add)(const void*, size_t,
+@@ -872,6 +883,11 @@ _gcry_rndw32_gather_random_fast (void (*add)(const void*, size_t,
      ADDPTR ( GetOpenClipboardWindow ());
      ADDPTR ( GetProcessHeap ());
      ADDPTR ( GetProcessWindowStation ());
@@ -124,7 +126,7 @@ index aefc7275..45d1e7e7 100644
      /* Following function in some cases stops returning events, and cannot
         be used as an entropy source.  */
      /*ADDINT ( GetQueueStatus (QS_ALLEVENTS));*/
-@@ -871,6 +888,7 @@ _gcry_rndw32_gather_random_fast (void (*add)(const void*, size_t,
+@@ -885,6 +901,7 @@ _gcry_rndw32_gather_random_fast (void (*add)(const void*, size_t,
  
    /* Get multiword system information: Current caret position, current
       mouse cursor position.  */
@@ -132,7 +134,7 @@ index aefc7275..45d1e7e7 100644
    {
      POINT point;
  
-@@ -922,10 +940,12 @@ _gcry_rndw32_gather_random_fast (void (*add)(const void*, size_t,
+@@ -936,10 +953,12 @@ _gcry_rndw32_gather_random_fast (void (*add)(const void*, size_t,
      (*add) ( &minimumWorkingSetSize, sizeof (int), origin );
      (*add) ( &maximumWorkingSetSize, sizeof (int), origin );
    }
@@ -145,7 +147,7 @@ index aefc7275..45d1e7e7 100644
    if (!addedFixedItems)
      {
        STARTUPINFO startupInfo;
-@@ -938,6 +958,7 @@ _gcry_rndw32_gather_random_fast (void (*add)(const void*, size_t,
+@@ -952,6 +971,7 @@ _gcry_rndw32_gather_random_fast (void (*add)(const void*, size_t,
        (*add) ( &startupInfo, sizeof (STARTUPINFO), origin );
        addedFixedItems = 1;
      }
@@ -154,5 +156,5 @@ index aefc7275..45d1e7e7 100644
    /* The performance of QPC varies depending on the architecture it's
       running on and on the OS, the MS documentation is vague about the
 -- 
-2.26.0.windows.1
+2.37.3.windows.1
 


=====================================
contrib/src/gcrypt/0008-random-only-use-wincrypt-in-UWP-builds-if-WINSTORECO.patch
=====================================
@@ -1,7 +1,7 @@
-From 1b09aa078628e93c0f95f0d5e20e708f81068bf5 Mon Sep 17 00:00:00 2001
+From 0673f231f333179d4698877ec40cdf43bf5b77c1 Mon Sep 17 00:00:00 2001
 From: Steve Lhomme <robux4 at ycbcr.xyz>
 Date: Fri, 19 Jun 2020 10:37:50 +0200
-Subject: [PATCH 8/9] random: only use wincrypt in UWP builds if WINSTORECOMPAT
+Subject: [PATCH 5/5] random: only use wincrypt in UWP builds if WINSTORECOMPAT
  is set
 
 This is a compatibility library to use older APIs that are forbidden in UWP apps.
@@ -9,39 +9,53 @@ This is a compatibility library to use older APIs that are forbidden in UWP apps
 bcrypt is supposed to be used instead of wincrypt but is only available since
 Vista.
 ---
- random/rndw32.c | 17 +++++++++++++++++
+ random/rndw32.c | 22 ++++++++++++++++++++--
  src/Makefile.am |  4 +++-
- 2 files changed, 20 insertions(+), 1 deletion(-)
+ 2 files changed, 23 insertions(+), 3 deletions(-)
 
 diff --git a/random/rndw32.c b/random/rndw32.c
-index 45d1e7e7..8b0a38fa 100644
+index 02d20cc3..f1b559e9 100644
 --- a/random/rndw32.c
 +++ b/random/rndw32.c
-@@ -98,6 +98,9 @@
+@@ -97,7 +97,11 @@
+ #define SIZEOF_DISK_PERFORMANCE_STRUCT 256
  
  /* We don't include wincrypt.h so define it here.  */
- #define HCRYPTPROV  HANDLE
 +#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && defined(WINSTORECOMPAT)
 +#include <wincrypt.h>
++#else
+ #define HCRYPTPROV  HANDLE
 +#endif
  
  
  /* When we query the performance counters, we allocate an initial buffer and
-@@ -259,6 +262,7 @@ init_system_rng (void)
+@@ -114,7 +118,7 @@
+ 
+ /* Intel Chipset CSP type and name */
+ #define PROV_INTEL_SEC  22
+-#define INTEL_DEF_PROV  "Intel Hardware Cryptographic Service Provider"
++#define INTEL_DEF_PROV  TEXT("Intel Hardware Cryptographic Service Provider")
+ 
+ 
+ 
+@@ -258,8 +262,9 @@ static void
+ init_system_rng (void)
+ {
    system_rng_available = 0;
-   hRNGProv = NULL;
+-  hRNGProv = NULL;
++  hRNGProv = (HCRYPTPROV)NULL;
  
 +#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
    hAdvAPI32 = GetModuleHandle ("AdvAPI32.dll");
    if (!hAdvAPI32)
      return;
-@@ -274,6 +278,19 @@ init_system_rng (void)
+@@ -275,6 +280,19 @@ init_system_rng (void)
       This isn't exported by name, so we have to get it by ordinal.  */
    pRtlGenRandom = (RTLGENRANDOM)
      GetProcAddress (hAdvAPI32, "SystemFunction036");
 +#elif defined(WINSTORECOMPAT)
 +  hAdvAPI32 = NULL;
-+  pCryptAcquireContext = CryptAcquireContextA;
++  pCryptAcquireContext = CryptAcquireContextW;
 +  pCryptGenRandom = CryptGenRandom;
 +  pCryptReleaseContext = CryptReleaseContext;
 +  pRtlGenRandom = NULL;
@@ -56,13 +70,13 @@ index 45d1e7e7..8b0a38fa 100644
    /* Try and connect to the PIII RNG CSP.  The AMD 768 southbridge (from
       the 760 MP chipset) also has a hardware RNG, but there doesn't appear
 diff --git a/src/Makefile.am b/src/Makefile.am
-index 3cc4a552..a22acd41 100644
+index aa3548f6..154b35c7 100644
 --- a/src/Makefile.am
 +++ b/src/Makefile.am
-@@ -123,7 +123,9 @@ libgcrypt_la_LIBADD = $(gcrypt_res) \
+@@ -126,7 +126,9 @@ libgcrypt_la_LIBADD = $(gcrypt_res) \
  	../random/librandom.la \
  	../mpi/libmpi.la \
- 	../compat/libcompat.la  $(GPG_ERROR_LIBS)
+ 	../compat/libcompat.la $(DL_LIBS) $(GPG_ERROR_LIBS)
 -
 +if HAVE_W32_SYSTEM
 +libgcrypt_la_LIBADD += -lbcrypt
@@ -71,5 +85,5 @@ index 3cc4a552..a22acd41 100644
  dumpsexp_SOURCES = dumpsexp.c
  dumpsexp_CFLAGS = $(arch_gpg_error_cflags)
 -- 
-2.26.0.windows.1
+2.37.3.windows.1
 


=====================================
contrib/src/gcrypt/64bits-relocation.patch deleted
=====================================
@@ -1,20 +0,0 @@
---- libgcrypt/cipher/rijndael.c.orig	2016-08-25 17:54:33.755153207 +0200
-+++ libgcrypt/cipher/rijndael.c	2016-08-25 17:54:36.655151003 +0200
-@@ -744,7 +744,7 @@
-   const void *key = ctx->keyschenc;
-   uintptr_t rounds = ctx->rounds;
-   uintptr_t ret;
--  asm volatile ("movq %[encT], %%r8\n\t"
-+  asm volatile ("movabs %[encT], %%r8\n\t"
-                 "callq *%[ret]\n\t"
-                 : [ret] "=a" (ret),
-                   "+D" (key),
-@@ -1127,7 +1127,7 @@
-   const void *key = ctx->keyschdec;
-   uintptr_t rounds = ctx->rounds;
-   uintptr_t ret;
--  asm volatile ("movq %[dectabs], %%r8\n\t"
-+  asm volatile ("movabs %[dectabs], %%r8\n\t"
-                 "callq *%[ret]\n\t"
-                 : [ret] "=a" (ret),
-                   "+D" (key),


=====================================
contrib/src/gcrypt/SHA512SUMS
=====================================
@@ -1 +1 @@
-c76d9c9dfb2b831177848b0df7e41d05d1587d28af5322ab0518c9200cdcb1470413940a414036559e7bbed3e24d2e89340f7f06026697f65492c00761cc6385  libgcrypt-1.7.10.tar.bz2
+e5ca7966624fff16c3013795836a2c4377f0193dbb4ac5ad2b79654b1fa8992e17d83816569a402212dc8367a7980d4141f5d6ac282bae6b9f02186365b61f13  libgcrypt-1.10.1.tar.bz2
\ No newline at end of file


=====================================
contrib/src/gcrypt/clang-mips64.patch deleted
=====================================
@@ -1,12 +0,0 @@
-diff -Naur libgcrypt.orig/mpi/longlong.h libgcrypt/mpi/longlong.h
---- libgcrypt.orig/mpi/longlong.h	2016-06-08 18:18:15.000000000 +0200
-+++ libgcrypt/mpi/longlong.h	2016-08-30 12:56:30.751262074 +0200
-@@ -890,7 +890,7 @@
-  **************  MIPS/64  **************
-  ***************************************/
- #if (defined (__mips) && __mips >= 3) && W_TYPE_SIZE == 64
--# if (__GNUC__ >= 5) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
-+# if defined (__clang__) || (__GNUC__ >= 5) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
- typedef unsigned int UTItype __attribute__ ((mode (TI)));
- #  define umul_ppmm(w1, w0, u, v) \
-   do {                                                                 \


=====================================
contrib/src/gcrypt/disable-tests-compilation.patch
=====================================
@@ -1,6 +1,17 @@
---- libgcrypt-1.7.3/Makefile.am.orig	2016-08-24 15:10:23.181783280 +0200
-+++ libgcrypt-1.7.3/Makefile.am	2016-08-24 15:11:19.813780757 +0200
-@@ -31,8 +31,8 @@
+From 35d4dd642c955f5aa006ad8d105105a15ff14921 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne at videolan.org>
+Date: Fri, 11 Sep 2015 16:43:11 +0200
+Subject: [PATCH 1/5] disable tests compilation
+
+---
+ Makefile.am | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 77355d1a..737f32ad 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -41,8 +41,8 @@ doc =
  endif
  
  
@@ -11,3 +22,6 @@
  
  EXTRA_DIST = autogen.sh autogen.rc README.GIT LICENSES      	           \
               ChangeLog-2011 build-aux/ChangeLog-2011 doc/ChangeLog-2011    \
+-- 
+2.37.3.windows.1
+


=====================================
contrib/src/gcrypt/fix-pthread-detection.patch
=====================================
@@ -1,14 +1,25 @@
---- libgcrypt/configure.ac.old	2017-04-20 16:49:00.239092950 +0200
-+++ libgcrypt/configure.ac	2017-04-20 16:57:18.205011934 +0200
-@@ -215,7 +215,6 @@
- print_egd_notice=no
+From 54a245738b12ad8985935de0ffea24980ce48db9 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= <hugo at beauzee.fr>
+Date: Thu, 20 Apr 2017 17:26:02 +0200
+Subject: [PATCH 2/5] Fix pthread detection
+
+---
+ configure.ac | 8 +++-----
+ 1 file changed, 3 insertions(+), 5 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 6ea38f53..781f3163 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -239,7 +239,6 @@ LIBGCRYPT_THREAD_MODULES=""
+ # Other definitions.
  have_w32_system=no
  have_w32ce_system=no
 -have_pthread=no
  
  
  # Setup some stuff depending on host.
-@@ -751,10 +750,9 @@
+@@ -828,10 +827,9 @@ AC_SUBST(PTH_LIBS)
  # Check whether pthreads is available
  #
  if test "$have_w32_system" != yes; then
@@ -22,3 +33,6 @@
  fi
  
  
+-- 
+2.37.3.windows.1
+


=====================================
contrib/src/gcrypt/gcrypt-uwp-getpid.patch
=====================================
@@ -0,0 +1,16 @@
+--- gcrypt/compat/libcompat.h.orig	2019-06-23 17:35:08.000000000 +0200
++++ gcrypt/compat/libcompat.h	2023-05-23 14:09:47.426668700 +0200
+@@ -26,6 +26,13 @@ const char *_gcry_compat_identification
+ #ifndef HAVE_GETPID
+ pid_t _gcry_getpid (void);
+ #define getpid() _gcry_getpid ()
++#elif defined(_WIN32)
++#include <winapifamily.h>
++# if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
++# include <windows.h>
++   /* getpid is incorrectly detected, it's not available in this case */
++#  define getpid() GetCurrentProcessId ()
++# endif
+ #endif
+ 
+ #ifndef HAVE_CLOCK


=====================================
contrib/src/gcrypt/rules.mak
=====================================
@@ -1,5 +1,5 @@
 # GCRYPT
-GCRYPT_VERSION := 1.7.10
+GCRYPT_VERSION := 1.10.1
 GCRYPT_URL := $(GNUGPG)/libgcrypt/libgcrypt-$(GCRYPT_VERSION).tar.bz2
 
 PKGS += gcrypt
@@ -16,29 +16,31 @@ gcrypt: libgcrypt-$(GCRYPT_VERSION).tar.bz2 .sum-gcrypt
 	$(UNPACK)
 	$(APPLY) $(SRC)/gcrypt/disable-tests-compilation.patch
 	$(APPLY) $(SRC)/gcrypt/fix-pthread-detection.patch
-	$(APPLY) $(SRC)/gcrypt/0001-random-Don-t-assume-that-_WIN64-implies-x86_64.patch
-	$(APPLY) $(SRC)/gcrypt/0002-aarch64-mpi-Fix-building-the-mpi-aarch64-assembly-fo.patch
 	$(APPLY) $(SRC)/gcrypt/0001-compat-provide-a-getpid-replacement-that-works-on-Wi.patch
 	$(APPLY) $(SRC)/gcrypt/0007-random-don-t-use-API-s-that-are-forbidden-in-UWP-app.patch
 	$(APPLY) $(SRC)/gcrypt/0008-random-only-use-wincrypt-in-UWP-builds-if-WINSTORECO.patch
-ifdef HAVE_WIN64
-	$(APPLY) $(SRC)/gcrypt/64bits-relocation.patch
-endif
-ifeq ($(CC), clang)
-ifeq ($(ARCH),mips64el)
-	$(APPLY) $(SRC)/gcrypt/clang-mips64.patch
-endif
+
+	# don't use getpid in UWP as it's not actually available
+	$(APPLY) $(SRC)/gcrypt/gcrypt-uwp-getpid.patch
+ifdef HAVE_CROSS_COMPILE
+	# disable cross-compiled command line tools that can't be run
+	sed -i.orig -e 's,^bin_PROGRAMS ,bin_PROGRAMS_disabled ,g' $(UNPACK_DIR)/src/Makefile.am
 endif
+
 	$(MOVE)
 
 DEPS_gcrypt = gpg-error
 
 GCRYPT_CONF = \
-	--enable-ciphers=aes,des,rfc2268,arcfour \
-	--enable-digests=sha1,md5,rmd160,sha256,sha512 \
+	--enable-ciphers=aes,des,rfc2268,arcfour,chacha20 \
+	--enable-digests=sha1,md5,rmd160,sha256,sha512,blake2 \
 	--enable-pubkey-ciphers=dsa,rsa,ecc \
 	--disable-docs
 
+ifneq ($(call need_pkg,"gpg-error >= 1.27"),)
+GCRYPT_CONF += --with-libgpg-error-prefix=$(PREFIX)
+endif
+
 ifdef HAVE_WIN32
 ifeq ($(ARCH),x86_64)
 GCRYPT_CONF += --disable-asm --disable-padlock-support
@@ -54,6 +56,9 @@ GCRYPT_CONF += --disable-aesni-support
 ifeq ($(ARCH),aarch64)
 GCRYPT_CONF += --disable-asm --disable-arm-crypto-support
 endif
+ifeq ($(ARCH), x86_64)
+GCRYPT_CONF += ac_cv_sys_symbol_underscore=yes
+endif
 else
 ifdef HAVE_BSD
 GCRYPT_CONF += --disable-asm --disable-aesni-support
@@ -77,10 +82,6 @@ endif
 endif
 
 .gcrypt: gcrypt
-	# Reconfiguring this requires a git repo to be available, to
-	# successfully produce a nonempty mym4_revision_dec.
-	cd $< && git init && git config --local user.email "cone at example.com" && git config --local user.name "Cony Cone" && \
-		git commit --allow-empty -m "dummy commit"
 	$(RECONF)
 	cd $< && $(HOSTVARS) ./configure $(HOSTCONF) CFLAGS="$(CFLAGS) $(GCRYPT_EXTRA_CFLAGS)" $(GCRYPT_CONF)
 	cd $< && $(MAKE) install



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/4f988b342493165cda2b9b5d6d63261569a953ce...504ffcaae914b91c7f61d92f6284f2a37af8b4d5

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/4f988b342493165cda2b9b5d6d63261569a953ce...504ffcaae914b91c7f61d92f6284f2a37af8b4d5
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list