]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix windows build failure for arm64ec
authorslontis <shane.lontis@oracle.com>
Fri, 13 Mar 2026 04:13:40 +0000 (15:13 +1100)
committerEugene Syromiatnikov <esyr@openssl.org>
Fri, 20 Mar 2026 17:54:55 +0000 (18:54 +0100)
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)

crypto/evp/enc_b64_avx2.c
crypto/evp/enc_b64_avx2.h
crypto/evp/encode.c

index 1e2b00e6473cfed55e1137cdf8b881ab0d4580da..e6f571dd8e3a795bab0660eb4152c9a713fb2dba 100644 (file)
@@ -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
index 9c871ac13c5cd92178a4d0d7fc0f579890a1b715..db67b5cf8ad065ddc1962c432f435e14892cf3d7 100644 (file)
@@ -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
index e6c0bbbb21ad7524744f8c62230515952985e820..eacc68bb96551cc0934bff981813cd53f8e2ccf9 100644 (file)
@@ -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"