[oe-commits] [meta-openembedded] 01/04: libkcapi: Move static inline functions where used

git at git.openembedded.org git at git.openembedded.org
Mon Nov 18 05:27:50 UTC 2019


This is an automated email from the git hooks/post-receive script.

khem pushed a commit to branch master-next
in repository meta-openembedded.

commit a980f46f780226d2b0dc6bd68eeb753b45616c9f
Author: Khem Raj <raj.khem at gmail.com>
AuthorDate: Sat Nov 16 23:30:10 2019 -0800

    libkcapi: Move static inline functions where used
    
    Clang warns about unused functions on some arches e.g. mips
    unused function '_bswap32' [-Werror,-Wunused-function]
    
    Signed-off-by: Khem Raj <raj.khem at gmail.com>
---
 .../libkcapi/0001-kcapi-kdf-Move-code-to-fix.patch | 72 ++++++++++++++++++++++
 meta-oe/recipes-crypto/libkcapi/libkcapi_git.bb    |  1 +
 2 files changed, 73 insertions(+)

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
new file mode 100644
index 0000000..c24b963
--- /dev/null
+++ b/meta-oe/recipes-crypto/libkcapi/libkcapi/0001-kcapi-kdf-Move-code-to-fix.patch
@@ -0,0 +1,72 @@
+From a028eaf9491052335e78c118aaa4d690933c0223 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem at 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]
+
+Signed-off-by: Khem Raj <raj.khem at gmail.com>
+---
+ lib/kcapi-kdf.c | 35 +++++++++++++++++------------------
+ 1 file changed, 17 insertions(+), 18 deletions(-)
+
+diff --git a/lib/kcapi-kdf.c b/lib/kcapi-kdf.c
+index ea39846..08f8fbe 100644
+--- a/lib/kcapi-kdf.c
++++ b/lib/kcapi-kdf.c
+@@ -54,6 +54,22 @@
+ #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
++
++#ifdef __HAVE_BUILTIN_BSWAP32__
++# define be_swap32(x) (uint32_t)__builtin_bswap32((uint32_t)(x))
++#else
++# define be_bswap32(x) _bswap32(x)
++/* Endian dependent byte swap operations.  */
++# if __BYTE_ORDER__ ==  __ORDER_BIG_ENDIAN__
++#  define _bswap32(x) ((uint32_t)(x))
++# elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
++
+ static inline uint32_t rol32(uint32_t x, int n)
+ {
+ 	return ( (x << (n&(32-1))) | (x >> ((32-n)&(32-1))) );
+@@ -69,27 +85,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)
+ #else
+ #error "Endianess not defined"
+ #endif
++#endif
+ 
+ DSO_PUBLIC
+ int32_t kcapi_kdf_dpi(struct kcapi_handle *handle,
+-- 
+2.24.0
+
diff --git a/meta-oe/recipes-crypto/libkcapi/libkcapi_git.bb b/meta-oe/recipes-crypto/libkcapi/libkcapi_git.bb
index 7990709..aa438e5 100644
--- a/meta-oe/recipes-crypto/libkcapi/libkcapi_git.bb
+++ b/meta-oe/recipes-crypto/libkcapi/libkcapi_git.bb
@@ -10,6 +10,7 @@ SRCREV = "5649050d201856bf06c8738b5d2aa1710c86ac2f"
 PV = "1.1.5"
 SRC_URI = " \
     git://github.com/smuellerDD/libkcapi.git \
+    file://0001-kcapi-kdf-Move-code-to-fix.patch \
 "
 
 inherit autotools

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list