1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
|
From 3a59f8e5331bb6be5d298bc5c136a79102196c1d Mon Sep 17 00:00:00 2001
From: Frank Denis <github@pureftpd.org>
Date: Fri, 20 Oct 2023 13:47:57 +0200
Subject: [PATCH] aarch64: set compiler attributes *after* including
<arm_neon.h>
Fixes #1321
Upstream-Status: Backport
[https://github.com/jedisct1/libsodium/commit/8f453f41f8834e0fe47610f2a3e03e696ddb3450]
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
---
thirdparty/libsodium-stable/configure.ac | 11 ++++++-----
.../crypto_aead/aegis128l/aegis128l_armcrypto.c | 12 ++++++------
.../crypto_aead/aegis256/aegis256_armcrypto.c | 12 ++++++------
.../aes256gcm/armcrypto/aead_aes256gcm_armcrypto.c | 12 ++++++------
4 files changed, 24 insertions(+), 23 deletions(-)
diff --git a/thirdparty/libsodium-stable/configure.ac b/thirdparty/libsodium-stable/configure.ac
index df83ef512..be67d3417 100644
--- a/thirdparty/libsodium-stable/configure.ac
+++ b/thirdparty/libsodium-stable/configure.ac
@@ -398,11 +398,6 @@ AS_IF([test "x$EMSCRIPTEN" = "x"], [
have_armcrypto=no
AC_MSG_CHECKING(for ARM crypto instructions set)
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
- #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
@@ -411,6 +406,12 @@ AS_IF([test "x$EMSCRIPTEN" = "x"], [
#endif
#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
]], [[
vaeseq_u8(vmovq_n_u8(0), vmovq_n_u8(0));
diff --git a/thirdparty/libsodium-stable/src/libsodium/crypto_aead/aegis128l/aegis128l_armcrypto.c b/thirdparty/libsodium-stable/src/libsodium/crypto_aead/aegis128l/aegis128l_armcrypto.c
index 825de8a1c..a01f60cbe 100644
--- a/thirdparty/libsodium-stable/src/libsodium/crypto_aead/aegis128l/aegis128l_armcrypto.c
+++ b/thirdparty/libsodium-stable/src/libsodium/crypto_aead/aegis128l/aegis128l_armcrypto.c
@@ -17,12 +17,6 @@
#include "aegis128l_armcrypto.h"
-#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
@@ -32,6 +26,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 AES_BLOCK_LENGTH 16
typedef uint8x16_t aes_block_t;
diff --git a/thirdparty/libsodium-stable/src/libsodium/crypto_aead/aegis256/aegis256_armcrypto.c b/thirdparty/libsodium-stable/src/libsodium/crypto_aead/aegis256/aegis256_armcrypto.c
index e1ebd577a..058e2072b 100644
--- a/thirdparty/libsodium-stable/src/libsodium/crypto_aead/aegis256/aegis256_armcrypto.c
+++ b/thirdparty/libsodium-stable/src/libsodium/crypto_aead/aegis256/aegis256_armcrypto.c
@@ -17,12 +17,6 @@
#include "aegis256_armcrypto.h"
-#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
@@ -32,6 +26,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 AES_BLOCK_LENGTH 16
typedef uint8x16_t aes_block_t;
diff --git 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
index 0a5a12811..aa76f5cd1 100644
--- 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 <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.34.1
|