From: slontis Date: Fri, 13 Mar 2026 04:13:40 +0000 (+1100) Subject: Fix windows build failure for arm64ec X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=232f17f065e089cab931d2babbed548e5958e6b2;p=thirdparty%2Fopenssl.git Fix windows build failure for arm64ec The new b64 encoder code uses __m256 which is not currently supported in ARM64EC code, since it does not natively support x64-specific instruction sets like AVX. Disable the fast AVX path if arm64EC is used. Fixes: https://github.com/openssl/openssl/issues/30361 Complements: 3a69b1902892 "Added AVX2 encoding + scalar improvements" Reviewed-by: Tomas Mraz Reviewed-by: Paul Dale Reviewed-by: Eugene Syromiatnikov MergeDate: Fri Mar 20 17:55:30 2026 (Merged from https://github.com/openssl/openssl/pull/30406) --- diff --git a/crypto/evp/enc_b64_avx2.c b/crypto/evp/enc_b64_avx2.c index 1e2b00e6473..e6f571dd8e3 100644 --- a/crypto/evp/enc_b64_avx2.c +++ b/crypto/evp/enc_b64_avx2.c @@ -6,6 +6,7 @@ #include "evp_local.h" #if defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || defined(_M_X64) +#if !defined(_M_ARM64EC) #define STRINGIFY_IMPLEMENTATION_(a) #a #define STRINGIFY(a) STRINGIFY_IMPLEMENTATION_(a) @@ -667,4 +668,5 @@ int encode_base64_avx2(EVP_ENCODE_CTX *ctx, unsigned char *dst, return (int)(out - (uint8_t *)dst) + +evp_encodeblock_int(ctx, out, src + i, srclen - i, final_wrap_cnt); } OPENSSL_UNTARGET_AVX2 +#endif /* !defined(_M_ARM64EC) */ #endif diff --git a/crypto/evp/enc_b64_avx2.h b/crypto/evp/enc_b64_avx2.h index 9c871ac13c5..db67b5cf8ad 100644 --- a/crypto/evp/enc_b64_avx2.h +++ b/crypto/evp/enc_b64_avx2.h @@ -4,9 +4,11 @@ #include #if defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || defined(_M_X64) +#if !defined(_M_ARM64EC) int encode_base64_avx2(EVP_ENCODE_CTX *ctx, unsigned char *out, const unsigned char *src, int srclen, int newlines, int *wrap_cnt); +#endif /* !defined(_M_ARM64EC) */ #endif #endif diff --git a/crypto/evp/encode.c b/crypto/evp/encode.c index e6c0bbbb21a..eacc68bb965 100644 --- a/crypto/evp/encode.c +++ b/crypto/evp/encode.c @@ -16,8 +16,9 @@ #include "evp_local.h" #if defined(OPENSSL_CPUID_OBJ) && !defined(OPENSSL_NO_ASM) && (defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || defined(_M_X64)) - +#if !defined(_M_ARM64EC) #define HAS_IA32CAP_IS_64 +#endif /* !defined(_M_ARM64EC) */ #endif #include "enc_b64_avx2.h"