From 79fb44fa43a22e96fc53dec377bfe7ccd67bf7a7 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Tue, 26 Mar 2024 21:04:28 -0700 Subject: minifi-cpp: Fix libsodium build on aarch64/clang Signed-off-by: Khem Raj --- .../files/0008-libsodium-aarch64_crypto.patch | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 meta-oe/recipes-extended/minifi-cpp/files/0008-libsodium-aarch64_crypto.patch (limited to 'meta-oe/recipes-extended/minifi-cpp/files/0008-libsodium-aarch64_crypto.patch') diff --git a/meta-oe/recipes-extended/minifi-cpp/files/0008-libsodium-aarch64_crypto.patch b/meta-oe/recipes-extended/minifi-cpp/files/0008-libsodium-aarch64_crypto.patch new file mode 100644 index 000000000..c2c51148f --- /dev/null +++ b/meta-oe/recipes-extended/minifi-cpp/files/0008-libsodium-aarch64_crypto.patch @@ -0,0 +1,38 @@ +Move target #pragma after arm_neon.h include + +Fix per android/ndk#1945 + +If the pragma is done before the header include, +when using clang compiler attribute may apply to the functions in arm_neon.h + +Upstream-Status: Submitted [https://github.com/jedisct1/libsodium/pull/1321] + +Signed-off-by: Khem Raj +--- a/thirdparty/libsodium-stable/src/libsodium/crypto_aead/aes256gcm/armcrypto/aead_aes256gcm_armcrypto.c ++++ b/thirdparty/libsodium-stable/src/libsodium/crypto_aead/aes256gcm/armcrypto/aead_aes256gcm_armcrypto.c +@@ -19,12 +19,6 @@ + #define __vectorcall + #endif + +-#ifdef __clang__ +-#pragma clang attribute push(__attribute__((target("neon,crypto,aes"))), apply_to = function) +-#elif defined(__GNUC__) +-#pragma GCC target("+simd+crypto") +-#endif +- + #ifndef __ARM_FEATURE_CRYPTO + #define __ARM_FEATURE_CRYPTO 1 + #endif +@@ -34,6 +28,12 @@ + + #include + ++#ifdef __clang__ ++#pragma clang attribute push(__attribute__((target("neon,crypto,aes"))), apply_to = function) ++#elif defined(__GNUC__) ++#pragma GCC target("+simd+crypto") ++#endif ++ + #define ABYTES crypto_aead_aes256gcm_ABYTES + #define NPUBBYTES crypto_aead_aes256gcm_NPUBBYTES + #define KEYBYTES crypto_aead_aes256gcm_KEYBYTES -- cgit v1.2.3-54-g00ecf