summaryrefslogtreecommitdiffstats
path: root/external/meta-openembedded/meta-oe/recipes-crypto/libkcapi
diff options
context:
space:
mode:
Diffstat (limited to 'external/meta-openembedded/meta-oe/recipes-crypto/libkcapi')
-rw-r--r--external/meta-openembedded/meta-oe/recipes-crypto/libkcapi/libkcapi/0001-Use-__builtin_bswap32-on-Clang-if-supported.patch39
-rw-r--r--external/meta-openembedded/meta-oe/recipes-crypto/libkcapi/libkcapi/0001-kcapi-kdf-Move-code-to-fix.patch73
-rw-r--r--external/meta-openembedded/meta-oe/recipes-crypto/libkcapi/libkcapi_git.bb15
3 files changed, 122 insertions, 5 deletions
diff --git a/external/meta-openembedded/meta-oe/recipes-crypto/libkcapi/libkcapi/0001-Use-__builtin_bswap32-on-Clang-if-supported.patch b/external/meta-openembedded/meta-oe/recipes-crypto/libkcapi/libkcapi/0001-Use-__builtin_bswap32-on-Clang-if-supported.patch
new file mode 100644
index 00000000..e713665a
--- /dev/null
+++ b/external/meta-openembedded/meta-oe/recipes-crypto/libkcapi/libkcapi/0001-Use-__builtin_bswap32-on-Clang-if-supported.patch
@@ -0,0 +1,39 @@
+From 7b5dd67fee58f9f54c8a676abe2131776c0a3c52 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 20 Nov 2019 13:41:39 -0800
+Subject: [PATCH] Use __builtin_bswap32 on Clang if supported
+
+clang pretends to be gcc 4.2.1 so GCC_VERSION macro will decide that
+__builtin_bswap32 is not supported on clang, whereas in reality it might
+so its better to add a check for enquiring clang if it supports
+__builtin_bswap32 or not
+
+Upstream-Status: Submitted [https://github.com/smuellerDD/libkcapi/pull/83]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/kcapi-kdf.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/lib/kcapi-kdf.c b/lib/kcapi-kdf.c
+index 9e53a0b..f32fbe9 100644
+--- a/lib/kcapi-kdf.c
++++ b/lib/kcapi-kdf.c
+@@ -54,10 +54,14 @@
+ #include "kcapi.h"
+ #include "internal.h"
+
++#ifndef __has_builtin
++# define __has_builtin(x) 0
++#endif
++
+ #define GCC_VERSION (__GNUC__ * 10000 \
+ + __GNUC_MINOR__ * 100 \
+ + __GNUC_PATCHLEVEL__)
+-#if GCC_VERSION >= 40400
++#if GCC_VERSION >= 40400 || (defined(__clang__) && __has_builtin(__builtin_bswap32))
+ # define __HAVE_BUILTIN_BSWAP32__
+ #endif
+
+--
+2.24.0
+
diff --git a/external/meta-openembedded/meta-oe/recipes-crypto/libkcapi/libkcapi/0001-kcapi-kdf-Move-code-to-fix.patch b/external/meta-openembedded/meta-oe/recipes-crypto/libkcapi/libkcapi/0001-kcapi-kdf-Move-code-to-fix.patch
new file mode 100644
index 00000000..7ed9caf0
--- /dev/null
+++ b/external/meta-openembedded/meta-oe/recipes-crypto/libkcapi/libkcapi/0001-kcapi-kdf-Move-code-to-fix.patch
@@ -0,0 +1,73 @@
+From 8f961521add49278b48c9721fc53e05ee3543b74 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 16 Nov 2019 23:03:51 -0800
+Subject: [PATCH] kcapi-kdf: Move code to fix
+
+Fixes clang build
+unused function '_bswap32' [-Werror,-Wunused-function]
+
+Upstream-Status: Submitted [https://github.com/smuellerDD/libkcapi/pull/83]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/kcapi-kdf.c | 37 +++++++++++++++++--------------------
+ 1 file changed, 17 insertions(+), 20 deletions(-)
+
+diff --git a/lib/kcapi-kdf.c b/lib/kcapi-kdf.c
+index ea39846..9e53a0b 100644
+--- a/lib/kcapi-kdf.c
++++ b/lib/kcapi-kdf.c
+@@ -54,6 +54,20 @@
+ #include "kcapi.h"
+ #include "internal.h"
+
++#define GCC_VERSION (__GNUC__ * 10000 \
++ + __GNUC_MINOR__ * 100 \
++ + __GNUC_PATCHLEVEL__)
++#if GCC_VERSION >= 40400
++# define __HAVE_BUILTIN_BSWAP32__
++#endif
++
++/* Endian dependent byte swap operations. */
++#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
++# define be_bswap32(x) ((uint32_t)(x))
++#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
++# ifdef __HAVE_BUILTIN_BSWAP32__
++# define be_bswap32(x) (uint32_t)__builtin_bswap32((uint32_t)(x))
++# else
+ static inline uint32_t rol32(uint32_t x, int n)
+ {
+ return ( (x << (n&(32-1))) | (x >> ((32-n)&(32-1))) );
+@@ -68,27 +82,10 @@ static inline uint32_t _bswap32(uint32_t x)
+ {
+ return ((rol32(x, 8) & 0x00ff00ffL) | (ror32(x, 8) & 0xff00ff00L));
+ }
+-
+-#define GCC_VERSION (__GNUC__ * 10000 \
+- + __GNUC_MINOR__ * 100 \
+- + __GNUC_PATCHLEVEL__)
+-#if GCC_VERSION >= 40400
+-# define __HAVE_BUILTIN_BSWAP32__
+-#endif
+-
+-#ifdef __HAVE_BUILTIN_BSWAP32__
+-# define _swap32(x) (uint32_t)__builtin_bswap32((uint32_t)(x))
+-#else
+-# define _swap32(x) _bswap32(x)
+-#endif
+-
+-/* Endian dependent byte swap operations. */
+-#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
+-# define be_bswap32(x) ((uint32_t)(x))
+-#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+-# define be_bswap32(x) _swap32(x)
++# define be_bswap32(x) _bswap32(x)
++# endif
+ #else
+-#error "Endianess not defined"
++# error "endianess not defined"
+ #endif
+
+ DSO_PUBLIC
+--
+2.24.0
+
diff --git a/external/meta-openembedded/meta-oe/recipes-crypto/libkcapi/libkcapi_git.bb b/external/meta-openembedded/meta-oe/recipes-crypto/libkcapi/libkcapi_git.bb
index a93ddc82..4e217a35 100644
--- a/external/meta-openembedded/meta-oe/recipes-crypto/libkcapi/libkcapi_git.bb
+++ b/external/meta-openembedded/meta-oe/recipes-crypto/libkcapi/libkcapi_git.bb
@@ -1,28 +1,33 @@
SUMMARY = "Linux Kernel Crypto API User Space Interface Library"
HOMEPAGE = "http://www.chronox.de/libkcapi.html"
LICENSE = "BSD | GPL-2.0"
-LIC_FILES_CHKSUM = "file://COPYING;md5=d0421cf231423bda10cea691b613e866"
+LIC_FILES_CHKSUM = "file://COPYING;md5=14d5a68b28755c04ebdba226e888b157"
DEPENDS = "libtool"
S = "${WORKDIR}/git"
-# Use v1.1.3 with changes on top for building in OE
-SRCREV = "1c736c43eb71fbb5640d00efaf34a1edf1972c49"
-PV = "1.1.3+git${SRCPV}"
+SRCREV = "5649050d201856bf06c8738b5d2aa1710c86ac2f"
+PV = "1.1.5"
SRC_URI = " \
git://github.com/smuellerDD/libkcapi.git \
+ file://0001-kcapi-kdf-Move-code-to-fix.patch \
+ file://0001-Use-__builtin_bswap32-on-Clang-if-supported.patch \
"
inherit autotools
PACKAGECONFIG ??= ""
-PACKAGECONFIG[testapp] = "--enable-kcapi-test,,,"
+PACKAGECONFIG[testapp] = "--enable-kcapi-test,,,bash"
PACKAGECONFIG[apps] = "--enable-kcapi-speed --enable-kcapi-hasher --enable-kcapi-rngapp --enable-kcapi-encapp --enable-kcapi-dgstapp,,,"
do_install_append() {
# bindir contains testapp and apps. However it is always created, even
# when no binaries are installed (empty bin_PROGRAMS in Makefile.am),
rmdir --ignore-fail-on-non-empty ${D}${bindir}
+
+ # Remove the generated binary checksum files
+ rm -f ${D}${bindir}/.*.hmac
+ rm -f ${D}${libdir}/.*.hmac
}
CPPFLAGS_append_libc-musl_toolchain-clang = " -Wno-error=sign-compare"