mbedtls: Fix UWP arm32 build after 2.28.3 enabled AES-NI intrinsics on MSVC

This commit is contained in:
Rémi Verschelde 2023-09-07 10:26:51 +02:00
parent 7ce807a9c5
commit a9710a2a9b
No known key found for this signature in database
GPG key ID: C3336907360768E1
3 changed files with 22 additions and 3 deletions

View file

@ -288,7 +288,8 @@ File extracted from upstream release tarball:
- The `LICENSE` file. - The `LICENSE` file.
- Applied the patch in `patches/1453.diff` to fix UWP build (upstream PR: - Applied the patch in `patches/1453.diff` to fix UWP build (upstream PR:
https://github.com/ARMmbed/mbedtls/pull/1453). https://github.com/ARMmbed/mbedtls/pull/1453).
Applied the patch in `patches/windows-arm64-hardclock.diff` Applied the patch in `patches/windows-arm64-hardclock.diff`.
Applied the patch in `aesni-no-arm-intrinsics.patch` also to fix UWP build.
- Added 2 files `godot_core_mbedtls_platform.c` and `godot_core_mbedtls_config.h` - Added 2 files `godot_core_mbedtls_platform.c` and `godot_core_mbedtls_config.h`
providing configuration for light bundling with core. providing configuration for light bundling with core.

View file

@ -54,9 +54,10 @@
* macros that may change in future releases. * macros that may change in future releases.
*/ */
#undef MBEDTLS_AESNI_HAVE_INTRINSICS #undef MBEDTLS_AESNI_HAVE_INTRINSICS
#if defined(_MSC_VER) #if defined(_MSC_VER) && (defined(_M_AMD64) || defined(_M_IX86))
/* Visual Studio supports AESNI intrinsics since VS 2008 SP1. We only support /* Visual Studio supports AESNI intrinsics since VS 2008 SP1. We only support
* VS 2013 and up for other reasons anyway, so no need to check the version. */ * VS 2013 and up for other reasons anyway, so no need to check the version.
* Only supported on x64 and x86. */
#define MBEDTLS_AESNI_HAVE_INTRINSICS #define MBEDTLS_AESNI_HAVE_INTRINSICS
#endif #endif
/* GCC-like compilers: currently, we only support intrinsics if the requisite /* GCC-like compilers: currently, we only support intrinsics if the requisite

View file

@ -0,0 +1,17 @@
diff --git a/thirdparty/mbedtls/include/mbedtls/aesni.h b/thirdparty/mbedtls/include/mbedtls/aesni.h
index 6741dead05..6c545bd4a3 100644
--- a/thirdparty/mbedtls/include/mbedtls/aesni.h
+++ b/thirdparty/mbedtls/include/mbedtls/aesni.h
@@ -54,9 +54,10 @@
* macros that may change in future releases.
*/
#undef MBEDTLS_AESNI_HAVE_INTRINSICS
-#if defined(_MSC_VER)
+#if defined(_MSC_VER) && (defined(_M_AMD64) || defined(_M_IX86))
/* Visual Studio supports AESNI intrinsics since VS 2008 SP1. We only support
- * VS 2013 and up for other reasons anyway, so no need to check the version. */
+ * VS 2013 and up for other reasons anyway, so no need to check the version.
+ * Only supported on x64 and x86. */
#define MBEDTLS_AESNI_HAVE_INTRINSICS
#endif
/* GCC-like compilers: currently, we only support intrinsics if the requisite