File 0006-libgcrypt-kdf-Include-compiler-rt.h.patch of Package grub2
From 30e4a5d97d9b0bbe239e049f20185438b01b6274 Mon Sep 17 00:00:00 2001
From: Gary Lin <glin@suse.com>
Date: Mon, 25 Aug 2025 16:10:42 +0800
Subject: [PATCH 06/12] libgcrypt/kdf: Include compiler-rt.h
There are several functions using the 64bit modulus which is not
natively supported by some 32-bit platforms. Thus, the compiler-rt.h
header has to be included for the software division functions, such as
__moddi3().
Signed-off-by: Gary Lin <glin@suse.com>
---
conf/Makefile.extra-dist | 1 +
.../12-kdf-include-compiler-rt.patch | 30 +++++++++++++++++++
2 files changed, 31 insertions(+)
create mode 100644 grub-core/lib/libgcrypt-patches/12-kdf-include-compiler-rt.patch
Index: grub-2.12/conf/Makefile.extra-dist
===================================================================
--- grub-2.12.orig/conf/Makefile.extra-dist
+++ grub-2.12/conf/Makefile.extra-dist
@@ -42,6 +42,7 @@ EXTRA_DIST += grub-core/lib/libgcrypt-pa
EXTRA_DIST += grub-core/lib/libgcrypt-patches/09-blake2b-hash-buffers.patch
EXTRA_DIST += grub-core/lib/libgcrypt-patches/10-kdf-use-GPG-errs.patch
EXTRA_DIST += grub-core/lib/libgcrypt-patches/11-kdf-remove-unsupported-kdfs.patch
+EXTRA_DIST += grub-core/lib/libgcrypt-patches/12-kdf-include-compiler-rt.patch
EXTRA_DIST += grub-core/lib/libgcrypt
EXTRA_DIST += grub-core/lib/libgcrypt-grub/mpi/generic
Index: grub-2.12/grub-core/lib/libgcrypt-patches/12-kdf-include-compiler-rt.patch
===================================================================
--- /dev/null
+++ grub-2.12/grub-core/lib/libgcrypt-patches/12-kdf-include-compiler-rt.patch
@@ -0,0 +1,30 @@
+From 9fbb0d5fc85ced411afd9371ccd94849e04618a1 Mon Sep 17 00:00:00 2001
+From: Gary Lin <glin@suse.com>
+Date: Mon, 1 Sep 2025 14:20:40 +0800
+Subject: [PATCH 4/4] libgcrypt/kdf: Include compiler-rt.h
+
+There are several functions using the 64bit modulus which is not
+natively supported by some 32-bit platforms. Thus, the compiler-rt.h
+header has to be included for the software division functions, such as
+__moddi3().
+
+Signed-off-by: Gary Lin <glin@suse.com>
+---
+ grub-core/lib/libgcrypt-grub/cipher/kdf.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/grub-core/lib/libgcrypt-grub/cipher/kdf.c b/grub-core/lib/libgcrypt-grub/cipher/kdf.c
+index c51a70eff..6e40e7de4 100644
+--- a/grub-core/lib/libgcrypt-grub/cipher/kdf.c
++++ b/grub-core/lib/libgcrypt-grub/cipher/kdf.c
+@@ -22,6 +22,7 @@ GRUB_MOD_LICENSE ("GPLv3+");
+ * License along with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
++#include <grub/compiler-rt.h>
+
+ #include "g10lib.h"
+ #include "cipher.h"
+--
+2.51.0
+