diff mbox series

[oe,meta-oe,3/3] efivar: Fix build with clang

Message ID 20170825035628.7995-3-raj.khem@gmail.com
State Accepted
Commit 6f6f0b6284b3aea1e0b2f7c8b115ed0378192596
Headers show
Series [oe,meta-oe,1/3] libhugetlbfs: Define HUGETLB_LDSCRIPT_PATH | expand

Commit Message

Khem Raj Aug. 25, 2017, 3:56 a.m. UTC
Signed-off-by: Khem Raj <raj.khem@gmail.com>

---
 ...-Add-Wunknown-attributes-when-using-clang.patch | 32 ++++++++++++++++++++++
 meta-oe/recipes-extended/efivar/efivar_0.31.bb     |  1 +
 2 files changed, 33 insertions(+)
 create mode 100644 meta-oe/recipes-extended/efivar/efivar/0001-efivar-dp.h-Add-Wunknown-attributes-when-using-clang.patch

-- 
2.14.1

-- 
_______________________________________________
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
diff mbox series

Patch

diff --git a/meta-oe/recipes-extended/efivar/efivar/0001-efivar-dp.h-Add-Wunknown-attributes-when-using-clang.patch b/meta-oe/recipes-extended/efivar/efivar/0001-efivar-dp.h-Add-Wunknown-attributes-when-using-clang.patch
new file mode 100644
index 000000000..1b8815e9d
--- /dev/null
+++ b/meta-oe/recipes-extended/efivar/efivar/0001-efivar-dp.h-Add-Wunknown-attributes-when-using-clang.patch
@@ -0,0 +1,32 @@ 
+From 3d43c5efdb632da5d7387dcadce4e87b83929c64 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 24 Aug 2017 15:54:47 -0700
+Subject: [PATCH] efivar-dp.h: Add -Wunknown-attributes when using clang
+
+change !dp check to a comparision against NULL to silent clang warning
+nonnull parameter 'dp' will evaluate to 'true' on first encounter
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/include/efivar/efivar-dp.h | 12 +++++++-----
+ 1 file changed, 7 insertions(+), 5 deletions(-)
+
+Index: git/src/include/efivar/efivar-dp.h
+===================================================================
+--- git.orig/src/include/efivar/efivar-dp.h
++++ git/src/include/efivar/efivar-dp.h
+@@ -783,9 +783,14 @@ extern int efidp_append_instance(const_e
+  * though older or other compilers might just ignore that attribute if they
+  * don't support it.  Ugh.
+  */
++#pragma GCC diagnostic push
+ #if defined(__GNUC__) && __GNUC__ >= 6
+ #pragma GCC diagnostic ignored "-Wnonnull-compare"
+ #endif
++#if defined(__clang__)
++#pragma GCC diagnostic ignored "-Wunknown-attributes"
++#pragma GCC diagnostic ignored "-Wpointer-bool-conversion"
++#endif
+ 
+ static inline int16_t
+ __attribute__((__artificial__))
diff --git a/meta-oe/recipes-extended/efivar/efivar_0.31.bb b/meta-oe/recipes-extended/efivar/efivar_0.31.bb
index 10dde896e..6ad3b361d 100644
--- a/meta-oe/recipes-extended/efivar/efivar_0.31.bb
+++ b/meta-oe/recipes-extended/efivar/efivar_0.31.bb
@@ -17,6 +17,7 @@  SRC_URI = "git://github.com/rhinstaller/efivar.git \
            file://allow-multi-definitions-for-native.patch \
            file://0001-makeguids-Do-not-use-__bswap_constant_-16-32-macros.patch \
            file://musl-strndupa.patch \
+           file://0001-efivar-dp.h-Add-Wunknown-attributes-when-using-clang.patch \
            "
 SRC_URI_append_class-target = " file://0001-efivar-fix-for-cross-compile.patch \
                                 file://0003-efivar-fix-for-cross-compile.patch \