Compare commits

...
Sign in to create a new pull request.

1 commit

Author SHA1 Message Date
Marcin Juszkiewicz
191749b695 Fix missing header on RISC-V
Signed-off-by: Marcin Juszkiewicz <mjuszkiewicz@redhat.com>
2025-11-26 12:49:11 +01:00
3 changed files with 101 additions and 1 deletions

View file

@ -0,0 +1,59 @@
Add missing simd-common-riscv.h header.
It was missing in 1.11.1 release tarball.
---
diff --git a/cipher/simd-common-riscv.h b/cipher/simd-common-riscv.h
new file mode 100644
index 00000000..8381000f
--- /dev/null
+++ b/cipher/simd-common-riscv.h
@@ -0,0 +1,48 @@
+/* simd-common-riscv.h - Common macros for RISC-V vector code
+ *
+ * Copyright (C) 2025 Jussi Kivilinna <jussi.kivilinna@iki.fi>
+ *
+ * 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 GCRY_SIMD_COMMON_RISCV_H
+#define GCRY_SIMD_COMMON_RISCV_H
+
+#include <config.h>
+
+#define memory_barrier_with_vec(a) __asm__("" : "+vr"(a) :: "memory")
+
+#define clear_vec_regs() __asm__ volatile("vsetvli zero, %0, e8, m1, ta, ma;\n" \
+ "vmv.v.i v0, 0;\n" \
+ "vmv.v.i v1, 0;\n" \
+ "vmv2r.v v2, v0;\n" \
+ "vmv4r.v v4, v0;\n" \
+ "vmv8r.v v8, v0;\n" \
+ "vmv8r.v v16, v0;\n" \
+ "vmv8r.v v24, v0;\n" \
+ : \
+ : "r" (~0) \
+ : "memory", "vl", "vtype", \
+ "v0", "v1", "v2", "v3", \
+ "v4", "v5", "v6", "v7", \
+ "v8", "v9", "v10", "v11", \
+ "v12", "v13", "v14", "v15", \
+ "v16", "v17", "v18", "v19", \
+ "v20", "v21", "v22", "v23", \
+ "v24", "v25", "v26", "v27", \
+ "v28", "v29", "v30", "v31")
+
+#endif /* GCRY_SIMD_COMMON_RISCV_H */

View file

@ -0,0 +1,33 @@
From 62f84bb3040fc138f061032889574f82ce72a0bc Mon Sep 17 00:00:00 2001
Message-ID: <62f84bb3040fc138f061032889574f82ce72a0bc.1764154972.git.marcin@juszkiewicz.com.pl>
From: Collin Funk via Gcrypt-devel <gcrypt-devel@gnupg.org>
Date: Fri, 16 May 2025 21:10:37 -0700
Subject: [PATCH] Fix missing simd-common-riscv.h in libgcrypt tarball.
* cipher/Makefile.am (EXTRA_libcipher_la_SOURCES): Add
simd-common-riscv.h.
--
GnuPG-bug-id: 7647
Signed-off-by: Collin Funk <collin.funk1@gmail.com>
---
cipher/Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cipher/Makefile.am b/cipher/Makefile.am
index c33cce0a..2e129cab 100644
--- a/cipher/Makefile.am
+++ b/cipher/Makefile.am
@@ -129,7 +129,7 @@ EXTRA_libcipher_la_SOURCES = \
seed.c \
serpent.c serpent-sse2-amd64.S serpent-avx2-amd64.S \
serpent-avx512-x86.c serpent-armv7-neon.S \
- simd-common-aarch64.h simd-common-ppc.h \
+ simd-common-aarch64.h simd-common-ppc.h simd-common-riscv.h \
sm4.c sm4-aesni-avx-amd64.S sm4-aesni-avx2-amd64.S \
sm4-gfni-avx2-amd64.S sm4-gfni-avx512-amd64.S \
sm4-aarch64.S sm4-armv8-aarch64-ce.S sm4-armv9-aarch64-sve-ce.S \
--
2.52.0

View file

@ -15,7 +15,7 @@ print(string.sub(hash, 0, 16))
Name: libgcrypt
Version: 1.11.1
Release: 2%{?dist}
Release: 3%{?dist}
URL: https://www.gnupg.org/
Source0: https://www.gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-%{version}.tar.bz2
Source1: https://www.gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-%{version}.tar.bz2.sig
@ -24,6 +24,9 @@ Source2: https://gnupg.org/signature_key.asc
Patch1: libgcrypt-1.10.1-annobin.patch
# https://gitlab.com/redhat-crypto/libgcrypt/libgcrypt-mirror/-/merge_requests/19/
Patch5: libgcrypt-1.11.0-marvin.patch
# Part of 1.11.2 release
Patch6: 0001-Fix-missing-simd-common-riscv.h-in-libgcrypt-tarball.patch
Patch7: 0001-Add-missing-simd-common-riscv.h.patch
%global gcrylibdir %{_libdir}
%global gcrysoname libgcrypt.so.20
@ -60,6 +63,8 @@ applications using libgcrypt.
%setup -q
%patch 1 -p1
%patch 5 -p1
%patch 6 -p1
%patch 7 -p1
%build
# should be all algorithms except SM3 and SM4, aria
@ -174,6 +179,9 @@ mkdir -p -m 755 $RPM_BUILD_ROOT/etc/gcrypt
%license COPYING
%changelog
* Wed Nov 26 2025 Marcin Juszkiewicz <mjuszkiewicz@redhat.com> - 1.11.1-3
- Fix missing header on RISC-V
* Thu Jul 24 2025 Fedora Release Engineering <releng@fedoraproject.org> - 1.11.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild