Browse Source

[experiment] mbedtls force ARM64 Neon even when macros say otherwise (#2793)

more of the mbedtls trying to make macro magic even through they do runtime checks

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2793
Reviewed-by: crueter <crueter@eden-emu.dev>
Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
Co-authored-by: lizzie <lizzie@eden-emu.dev>
Co-committed-by: lizzie <lizzie@eden-emu.dev>
vk-fix-oom-force-maller-buffers
lizzie 3 weeks ago
committed by crueter
parent
commit
55cc4d5ede
No known key found for this signature in database GPG Key ID: 425ACD2D4830EBC6
  1. 13
      .patch/mbedtls/0001-aesni-fix.patch
  2. 10
      .patch/mbedtls/0001-cmake-version.patch
  3. 13
      .patch/mbedtls/0002-aesni-fix.patch
  4. 20
      .patch/mbedtls/0002-arm64-aes-fix.patch
  5. 4
      externals/cpmfile.json

13
.patch/mbedtls/0003-aesni-fix.patch → .patch/mbedtls/0001-aesni-fix.patch

@ -1,3 +1,16 @@
diff --git a/library/aesni.h b/library/aesni.h
index 754c984c79..59e27afd3e 100644
--- a/library/aesni.h
+++ b/library/aesni.h
@@ -35,7 +35,7 @@
/* GCC-like compilers: currently, we only support intrinsics if the requisite
* target flag is enabled when building the library (e.g. `gcc -mpclmul -msse2`
* or `clang -maes -mpclmul`). */
-#if (defined(__GNUC__) || defined(__clang__)) && defined(__AES__) && defined(__PCLMUL__)
+#if defined(__GNUC__) || defined(__clang__)
#define MBEDTLS_AESNI_HAVE_INTRINSICS
#endif
/* For 32-bit, we only support intrinsics */
diff --git a/library/aesni.c b/library/aesni.c diff --git a/library/aesni.c b/library/aesni.c
index 2857068..3e104ab 100644 index 2857068..3e104ab 100644
--- a/library/aesni.c --- a/library/aesni.c

10
.patch/mbedtls/0001-cmake-version.patch

@ -1,10 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1811c42..bac9098 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.6)
+cmake_minimum_required(VERSION 3.5)
if(TEST_CPP)
project("mbed TLS" C CXX)
else()

13
.patch/mbedtls/0002-aesni-fix.patch

@ -1,13 +0,0 @@
diff --git a/library/aesni.h b/library/aesni.h
index 754c984c79..59e27afd3e 100644
--- a/library/aesni.h
+++ b/library/aesni.h
@@ -35,7 +35,7 @@
/* GCC-like compilers: currently, we only support intrinsics if the requisite
* target flag is enabled when building the library (e.g. `gcc -mpclmul -msse2`
* or `clang -maes -mpclmul`). */
-#if (defined(__GNUC__) || defined(__clang__)) && defined(__AES__) && defined(__PCLMUL__)
+#if defined(__GNUC__) || defined(__clang__)
#define MBEDTLS_AESNI_HAVE_INTRINSICS
#endif
/* For 32-bit, we only support intrinsics */

20
.patch/mbedtls/0002-arm64-aes-fix.patch

@ -0,0 +1,20 @@
diff --git a/library/common.h b/library/common.h
index 50f2a29..c60d9dc 100644
--- a/library/common.h
+++ b/library/common.h
@@ -19,11 +19,11 @@
#include <stdint.h>
#include <stddef.h>
-#if defined(__ARM_NEON)
-#include <arm_neon.h>
+#if defined(MBEDTLS_PLATFORM_IS_WINDOWS_ON_ARM64)
+#include <arm64_neon.h.h>
#define MBEDTLS_HAVE_NEON_INTRINSICS
-#elif defined(MBEDTLS_PLATFORM_IS_WINDOWS_ON_ARM64)
-#include <arm64_neon.h>
+#elif defined(__ANDROID__) || defined(__ARM_NEON)
+#include <arm_neon.h>
#define MBEDTLS_HAVE_NEON_INTRINSICS
#endif

4
externals/cpmfile.json

@ -103,8 +103,8 @@
"artifact": "%TAG%.tar.bz2", "artifact": "%TAG%.tar.bz2",
"skip_updates": true, "skip_updates": true,
"patches": [ "patches": [
"0002-aesni-fix.patch",
"0003-aesni-fix.patch"
"0001-aesni-fix.patch",
"0002-arm64-aes-fix.patch"
] ]
}, },
"enet": { "enet": {

Loading…
Cancel
Save