summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-oe/recipes-crypto/libkcapi/libkcapi/0001-Use-__builtin_bswap32-on-Clang-if-supported.patch39
-rw-r--r--meta-oe/recipes-crypto/libkcapi/libkcapi/0001-kcapi-kdf-Move-code-to-fix.patch73
-rw-r--r--meta-oe/recipes-crypto/libkcapi/libkcapi_1.2.0.bb (renamed from meta-oe/recipes-crypto/libkcapi/libkcapi_git.bb)11
3 files changed, 3 insertions, 120 deletions
diff --git a/meta-oe/recipes-crypto/libkcapi/libkcapi/0001-Use-__builtin_bswap32-on-Clang-if-supported.patch b/meta-oe/recipes-crypto/libkcapi/libkcapi/0001-Use-__builtin_bswap32-on-Clang-if-supported.patch
deleted file mode 100644
index e713665ab3..0000000000
--- a/meta-oe/recipes-crypto/libkcapi/libkcapi/0001-Use-__builtin_bswap32-on-Clang-if-supported.patch
+++ /dev/null
@@ -1,39 +0,0 @@
1From 7b5dd67fee58f9f54c8a676abe2131776c0a3c52 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 20 Nov 2019 13:41:39 -0800
4Subject: [PATCH] Use __builtin_bswap32 on Clang if supported
5
6clang pretends to be gcc 4.2.1 so GCC_VERSION macro will decide that
7__builtin_bswap32 is not supported on clang, whereas in reality it might
8so its better to add a check for enquiring clang if it supports
9__builtin_bswap32 or not
10
11Upstream-Status: Submitted [https://github.com/smuellerDD/libkcapi/pull/83]
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13---
14 lib/kcapi-kdf.c | 6 +++++-
15 1 file changed, 5 insertions(+), 1 deletion(-)
16
17diff --git a/lib/kcapi-kdf.c b/lib/kcapi-kdf.c
18index 9e53a0b..f32fbe9 100644
19--- a/lib/kcapi-kdf.c
20+++ b/lib/kcapi-kdf.c
21@@ -54,10 +54,14 @@
22 #include "kcapi.h"
23 #include "internal.h"
24
25+#ifndef __has_builtin
26+# define __has_builtin(x) 0
27+#endif
28+
29 #define GCC_VERSION (__GNUC__ * 10000 \
30 + __GNUC_MINOR__ * 100 \
31 + __GNUC_PATCHLEVEL__)
32-#if GCC_VERSION >= 40400
33+#if GCC_VERSION >= 40400 || (defined(__clang__) && __has_builtin(__builtin_bswap32))
34 # define __HAVE_BUILTIN_BSWAP32__
35 #endif
36
37--
382.24.0
39
diff --git a/meta-oe/recipes-crypto/libkcapi/libkcapi/0001-kcapi-kdf-Move-code-to-fix.patch b/meta-oe/recipes-crypto/libkcapi/libkcapi/0001-kcapi-kdf-Move-code-to-fix.patch
deleted file mode 100644
index 7ed9caf096..0000000000
--- a/meta-oe/recipes-crypto/libkcapi/libkcapi/0001-kcapi-kdf-Move-code-to-fix.patch
+++ /dev/null
@@ -1,73 +0,0 @@
1From 8f961521add49278b48c9721fc53e05ee3543b74 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 16 Nov 2019 23:03:51 -0800
4Subject: [PATCH] kcapi-kdf: Move code to fix
5
6Fixes clang build
7unused function '_bswap32' [-Werror,-Wunused-function]
8
9Upstream-Status: Submitted [https://github.com/smuellerDD/libkcapi/pull/83]
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
12 lib/kcapi-kdf.c | 37 +++++++++++++++++--------------------
13 1 file changed, 17 insertions(+), 20 deletions(-)
14
15diff --git a/lib/kcapi-kdf.c b/lib/kcapi-kdf.c
16index ea39846..9e53a0b 100644
17--- a/lib/kcapi-kdf.c
18+++ b/lib/kcapi-kdf.c
19@@ -54,6 +54,20 @@
20 #include "kcapi.h"
21 #include "internal.h"
22
23+#define GCC_VERSION (__GNUC__ * 10000 \
24+ + __GNUC_MINOR__ * 100 \
25+ + __GNUC_PATCHLEVEL__)
26+#if GCC_VERSION >= 40400
27+# define __HAVE_BUILTIN_BSWAP32__
28+#endif
29+
30+/* Endian dependent byte swap operations. */
31+#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
32+# define be_bswap32(x) ((uint32_t)(x))
33+#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
34+# ifdef __HAVE_BUILTIN_BSWAP32__
35+# define be_bswap32(x) (uint32_t)__builtin_bswap32((uint32_t)(x))
36+# else
37 static inline uint32_t rol32(uint32_t x, int n)
38 {
39 return ( (x << (n&(32-1))) | (x >> ((32-n)&(32-1))) );
40@@ -68,27 +82,10 @@ static inline uint32_t _bswap32(uint32_t x)
41 {
42 return ((rol32(x, 8) & 0x00ff00ffL) | (ror32(x, 8) & 0xff00ff00L));
43 }
44-
45-#define GCC_VERSION (__GNUC__ * 10000 \
46- + __GNUC_MINOR__ * 100 \
47- + __GNUC_PATCHLEVEL__)
48-#if GCC_VERSION >= 40400
49-# define __HAVE_BUILTIN_BSWAP32__
50-#endif
51-
52-#ifdef __HAVE_BUILTIN_BSWAP32__
53-# define _swap32(x) (uint32_t)__builtin_bswap32((uint32_t)(x))
54-#else
55-# define _swap32(x) _bswap32(x)
56-#endif
57-
58-/* Endian dependent byte swap operations. */
59-#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
60-# define be_bswap32(x) ((uint32_t)(x))
61-#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
62-# define be_bswap32(x) _swap32(x)
63+# define be_bswap32(x) _bswap32(x)
64+# endif
65 #else
66-#error "Endianess not defined"
67+# error "endianess not defined"
68 #endif
69
70 DSO_PUBLIC
71--
722.24.0
73
diff --git a/meta-oe/recipes-crypto/libkcapi/libkcapi_git.bb b/meta-oe/recipes-crypto/libkcapi/libkcapi_1.2.0.bb
index 4e217a351d..b478e4c580 100644
--- a/meta-oe/recipes-crypto/libkcapi/libkcapi_git.bb
+++ b/meta-oe/recipes-crypto/libkcapi/libkcapi_1.2.0.bb
@@ -1,18 +1,13 @@
1SUMMARY = "Linux Kernel Crypto API User Space Interface Library" 1SUMMARY = "Linux Kernel Crypto API User Space Interface Library"
2HOMEPAGE = "http://www.chronox.de/libkcapi.html" 2HOMEPAGE = "http://www.chronox.de/libkcapi.html"
3LICENSE = "BSD | GPL-2.0" 3LICENSE = "BSD | GPL-2.0"
4LIC_FILES_CHKSUM = "file://COPYING;md5=14d5a68b28755c04ebdba226e888b157" 4LIC_FILES_CHKSUM = "file://COPYING;md5=c78be93ed8d1637f2a3f4a83ff9d5f54"
5 5
6DEPENDS = "libtool" 6DEPENDS = "libtool"
7 7
8S = "${WORKDIR}/git" 8S = "${WORKDIR}/git"
9SRCREV = "5649050d201856bf06c8738b5d2aa1710c86ac2f" 9SRCREV = "8397f0f7c45264a3b9aff5a1f9119df25eeb4c60"
10PV = "1.1.5" 10SRC_URI = "git://github.com/smuellerDD/libkcapi.git"
11SRC_URI = " \
12 git://github.com/smuellerDD/libkcapi.git \
13 file://0001-kcapi-kdf-Move-code-to-fix.patch \
14 file://0001-Use-__builtin_bswap32-on-Clang-if-supported.patch \
15"
16 11
17inherit autotools 12inherit autotools
18 13