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