Commit 232f17f065 for openssl.org

commit 232f17f065e089cab931d2babbed548e5958e6b2
Author: slontis <shane.lontis@oracle.com>
Date:   Fri Mar 13 15:13:40 2026 +1100

    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 <tomas@openssl.foundation>
    Reviewed-by: Paul Dale <paul.dale@oracle.com>
    Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
    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 1e2b00e647..e6f571dd8e 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 9c871ac13c..db67b5cf8a 100644
--- a/crypto/evp/enc_b64_avx2.h
+++ b/crypto/evp/enc_b64_avx2.h
@@ -4,9 +4,11 @@
 #include <openssl/evp.h>

 #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 e6c0bbbb21..eacc68bb96 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"