blob: 7a6fae79972d41f7eb09ae4919a49df3f9713102 [file] [log] [blame]
From d3253310f7c0fc0f1aad6864e3b57958ea1bb9c5 Mon Sep 17 00:00:00 2001
From: tux3 <barrdetwix@gmail.com>
Date: Mon, 16 Oct 2023 16:42:04 +0200
Subject: [PATCH] fix(aarch64): Move target #pragma after arm_neon.h include
Fix per https://github.com/android/ndk/issues/1945
If the pragma is done before the header include,
in NDK 26 the attribute may apply to the functions in arm_neon.h
Upstream-Status: Backport [https://github.com/jedisct1/libsodium/pull/1321]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
.../aes256gcm/armcrypto/aead_aes256gcm_armcrypto.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/libsodium/crypto_aead/aes256gcm/armcrypto/aead_aes256gcm_armcrypto.c b/src/libsodium/crypto_aead/aes256gcm/armcrypto/aead_aes256gcm_armcrypto.c
index 0a5a128..aa76f5c 100644
--- a/src/libsodium/crypto_aead/aes256gcm/armcrypto/aead_aes256gcm_armcrypto.c
+++ b/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 <arm_neon.h>
+#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
--
2.42.1