aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-crypto
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2023-11-05 21:14:47 -0800
committerKhem Raj <raj.khem@gmail.com>2023-11-06 08:49:52 -0800
commitfe8ee3c8d608ecd6973b8f624836ebf49c1a9d80 (patch)
treeea461d68d756014738c000a0dec7eaf078d6b1fd /meta-oe/recipes-crypto
parent294b2e9ae951e22ffe8ac5d7c8b5e2114db17b03 (diff)
downloadmeta-openembedded-contrib-fe8ee3c8d608ecd6973b8f624836ebf49c1a9d80.tar.gz
libsodium: Fix build with clang on aarch64
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-crypto')
-rw-r--r--meta-oe/recipes-crypto/libsodium/libsodium/0001-fix-aarch64-Move-target-pragma-after-arm_neon.h-incl.patch49
-rw-r--r--meta-oe/recipes-crypto/libsodium/libsodium_1.0.19.bb3
2 files changed, 51 insertions, 1 deletions
diff --git a/meta-oe/recipes-crypto/libsodium/libsodium/0001-fix-aarch64-Move-target-pragma-after-arm_neon.h-incl.patch b/meta-oe/recipes-crypto/libsodium/libsodium/0001-fix-aarch64-Move-target-pragma-after-arm_neon.h-incl.patch
new file mode 100644
index 0000000000..7a6fae7997
--- /dev/null
+++ b/meta-oe/recipes-crypto/libsodium/libsodium/0001-fix-aarch64-Move-target-pragma-after-arm_neon.h-incl.patch
@@ -0,0 +1,49 @@
+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
+
diff --git a/meta-oe/recipes-crypto/libsodium/libsodium_1.0.19.bb b/meta-oe/recipes-crypto/libsodium/libsodium_1.0.19.bb
index 824ac45c87..2e678f3f0f 100644
--- a/meta-oe/recipes-crypto/libsodium/libsodium_1.0.19.bb
+++ b/meta-oe/recipes-crypto/libsodium/libsodium_1.0.19.bb
@@ -4,7 +4,8 @@ BUGTRACKER = "https://github.com/jedisct1/libsodium/issues"
LICENSE = "ISC"
LIC_FILES_CHKSUM = "file://LICENSE;md5=49ce3b426e6a002e23a1387248e6dbe9"
-SRC_URI = "https://download.libsodium.org/libsodium/releases/${BPN}-${PV}.tar.gz"
+SRC_URI = "https://download.libsodium.org/libsodium/releases/${BPN}-${PV}.tar.gz \
+ file://0001-fix-aarch64-Move-target-pragma-after-arm_neon.h-incl.patch"
SRC_URI[sha256sum] = "018d79fe0a045cca07331d37bd0cb57b2e838c51bc48fd837a1472e50068bbea"
inherit autotools