Files
gentoo/dev-libs/openssl/files/openssl-4.0.1-x86-avx2.patch
Sam James 4bf6a69026 dev-libs/openssl: add 4.0.1
Includes a workaround for bug #972756.

Bug: https://bugs.gentoo.org/977128
Closes: https://bugs.gentoo.org/972756
Signed-off-by: Sam James <sam@gentoo.org>
2026-06-10 02:15:09 +01:00

23 lines
1.2 KiB
Diff

https://bugs.gentoo.org/972756
https://github.com/openssl/openssl/issues/31199
--- a/crypto/evp/encode.c
+++ b/crypto/evp/encode.c
@@ -175,7 +175,7 @@ int EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl,
j = evp_encodeblock_int(ctx, out, in, inl - (inl % EVP_ENCODE_B64_LENGTH),
&wrap_cnt);
} else {
-#if defined(__AVX2__) && defined(HAVE_AVX2_INTRINSICS)
+#if defined(__AVX2__) && defined(HAVE_AVX2_INTRINSICS) && (defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || defined(_M_X64))
const int newlines = !(ctx->flags & EVP_ENCODE_CTX_NO_NEWLINES) ? EVP_ENCODE_B64_LENGTH : 0;
j = encode_base64_avx2(ctx,
@@ -243,7 +243,7 @@ int EVP_EncodeBlock(unsigned char *t, const unsigned char *f, int dlen)
{
int wrap_cnt = 0;
-#if defined(__AVX2__) && defined(HAVE_AVX2_INTRINSICS)
+#if defined(__AVX2__) && defined(HAVE_AVX2_INTRINSICS) && (defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || defined(_M_X64))
return (int)encode_base64_avx2(NULL, t, f, dlen, 0, &wrap_cnt);
#elif defined(HAS_IA32CAP_IS_64) && defined(HAVE_AVX2_INTRINSICS)
if ((OPENSSL_ia32cap_P[2] & (1u << 5)) != 0)