commit:     bc6508dcd976c354b41af61419c4f524a1711c3f
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 25 18:08:35 2026 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Feb 25 18:09:12 2026 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bc6508dc

dev-libs/leancrypto: fix another USE=-asm test failure

Will switch back to USE=asm default soon, we just have -asm as a workaround
for another problem for now.

Closes: https://bugs.gentoo.org/970600
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/leancrypto-1.6.0-gcm-no-asm.patch        | 51 ++++++++++++++++++++++
 ...-1.6.0-r2.ebuild => leancrypto-1.6.0-r3.ebuild} |  1 +
 2 files changed, 52 insertions(+)

diff --git a/dev-libs/leancrypto/files/leancrypto-1.6.0-gcm-no-asm.patch 
b/dev-libs/leancrypto/files/leancrypto-1.6.0-gcm-no-asm.patch
new file mode 100644
index 000000000000..832f4e607614
--- /dev/null
+++ b/dev-libs/leancrypto/files/leancrypto-1.6.0-gcm-no-asm.patch
@@ -0,0 +1,51 @@
+https://bugs.gentoo.org/970600
+https://github.com/smuellerDD/leancrypto/issues/47
+https://github.com/smuellerDD/leancrypto/commit/560a609f30ccb472ae6903d9afa957d7ad3c568a
+
+From 560a609f30ccb472ae6903d9afa957d7ad3c568a Mon Sep 17 00:00:00 2001
+From: Stephan Mueller <[email protected]>
+Date: Wed, 25 Feb 2026 19:01:20 +0100
+Subject: [PATCH] GCM: fix invocation when disabled-asm=true
+
+Signed-off-by: Stephan Mueller <[email protected]>
+---
+ aead/src/gcm.c | 15 ++++++++++++---
+ 1 file changed, 12 insertions(+), 3 deletions(-)
+
+diff --git a/aead/src/gcm.c b/aead/src/gcm.c
+index a0f24fdf..ec7bf58a 100644
+--- a/aead/src/gcm.c
++++ b/aead/src/gcm.c
+@@ -347,19 +347,28 @@ static int gcm_setkey(struct lc_aes_gcm_cryptor *ctx, 
const uint8_t *key,
+       H[1] = ptr_to_be64(h + 8);
+ 
+       /* Accelerated GCM init */
++#ifdef LC_HOST_AARCH64
+       if (feat & LC_CPU_FEATURE_ARM_PMULL) {
+               gfmul_init_armv8((uint64_t *)ctx->gcm_ctx.HL, H);
+               ctx->gcm_ctx.gcm_gmult_accel = gfmul_armv8;
+               goto out;
+-      } else if (feat & LC_CPU_FEATURE_INTEL_PCLMUL) {
++      } else
++#endif
++#ifdef LC_HOST_X86_64
++      if (feat & LC_CPU_FEATURE_INTEL_PCLMUL) {
+               gfmu_x8664_init((uint64_t *)ctx->gcm_ctx.HL, H);
+               ctx->gcm_ctx.gcm_gmult_accel = gfmu_x8664;
+               goto out;
+-      } else if (feat & LC_CPU_FEATURE_RISCV_ASM_ZBB) {
++      } else
++#endif
++#ifdef LC_HOST_RISCV64
++      if (feat & LC_CPU_FEATURE_RISCV_ASM_ZBB) {
+               gfmul_init_riscv64_zbb((uint64_t *)ctx->gcm_ctx.HL, H);
+               ctx->gcm_ctx.gcm_gmult_accel = gfmul_riscv64;
+               goto out;
+-      } else if (feat & LC_CPU_FEATURE_RISCV) {
++      } else
++#endif
++      if (feat & LC_CPU_FEATURE_RISCV) {
+               gfmul_init_riscv64((uint64_t *)ctx->gcm_ctx.HL, H);
+               ctx->gcm_ctx.gcm_gmult_accel = gfmul_riscv64;
+               goto out;
+

diff --git a/dev-libs/leancrypto/leancrypto-1.6.0-r2.ebuild 
b/dev-libs/leancrypto/leancrypto-1.6.0-r3.ebuild
similarity index 97%
rename from dev-libs/leancrypto/leancrypto-1.6.0-r2.ebuild
rename to dev-libs/leancrypto/leancrypto-1.6.0-r3.ebuild
index a659dfbb9574..291c77c36ac1 100644
--- a/dev-libs/leancrypto/leancrypto-1.6.0-r2.ebuild
+++ b/dev-libs/leancrypto/leancrypto-1.6.0-r3.ebuild
@@ -36,6 +36,7 @@ PATCHES=(
        "${FILESDIR}"/${P}-use-init.patch
        "${FILESDIR}"/${P}-avoid-accel-crash.patch
        "${FILESDIR}"/${P}-chacha20-no-asm.patch
+       "${FILESDIR}"/${P}-gcm-no-asm.patch
        "${FILESDIR}"/${PN}-1.6.0-no-force-lto.patch
 )
 

Reply via email to