summaryrefslogtreecommitdiff
path: root/meta/recipes-extended/mdadm/files/0001-mdadm-Add-Wimplicit-fallthrough-0-in-Makefile.patch
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2017-04-19 19:31:47 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-05-04 13:49:46 +0100
commit25372ee708e2fb2cefab4840a7f1e115344da8af (patch)
treef1a0b59ea000fd36614b783c55b46241cec7b14d /meta/recipes-extended/mdadm/files/0001-mdadm-Add-Wimplicit-fallthrough-0-in-Makefile.patch
parent5a79995a85329dc7fa4c6333bc2c0900ea145a7d (diff)
downloadopenembedded-core-25372ee708e2fb2cefab4840a7f1e115344da8af.tar.gz
openembedded-core-25372ee708e2fb2cefab4840a7f1e115344da8af.tar.bz2
openembedded-core-25372ee708e2fb2cefab4840a7f1e115344da8af.zip
mdadm: Backport and make fixes for building with gcc7
Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/recipes-extended/mdadm/files/0001-mdadm-Add-Wimplicit-fallthrough-0-in-Makefile.patch')
-rw-r--r--meta/recipes-extended/mdadm/files/0001-mdadm-Add-Wimplicit-fallthrough-0-in-Makefile.patch37
1 files changed, 37 insertions, 0 deletions
diff --git a/meta/recipes-extended/mdadm/files/0001-mdadm-Add-Wimplicit-fallthrough-0-in-Makefile.patch b/meta/recipes-extended/mdadm/files/0001-mdadm-Add-Wimplicit-fallthrough-0-in-Makefile.patch
new file mode 100644
index 0000000000..ce15170c75
--- /dev/null
+++ b/meta/recipes-extended/mdadm/files/0001-mdadm-Add-Wimplicit-fallthrough-0-in-Makefile.patch
@@ -0,0 +1,37 @@
+From aa09af0fe2ec0737fa04ffd00957532684e257b9 Mon Sep 17 00:00:00 2001
+From: Xiao Ni <xni@redhat.com>
+Date: Fri, 17 Mar 2017 19:55:42 +0800
+Subject: [PATCH 1/5] mdadm: Add Wimplicit-fallthrough=0 in Makefile
+
+There are many errors like 'error: this statement may fall through'.
+But the logic is right. So add the flag Wimplicit-fallthrough=0
+to disable the error messages. The method I use is from
+https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
+#index-Wimplicit-fallthrough-375
+
+Signed-off-by: Xiao Ni <xni@redhat.com>
+Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com>
+---
+Upstream-Status: Backport
+ Makefile | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/Makefile b/Makefile
+index 0f307ec..e1a7058 100644
+--- a/Makefile
++++ b/Makefile
+@@ -48,6 +48,11 @@ ifdef WARN_UNUSED
+ CWFLAGS += -Wp,-D_FORTIFY_SOURCE=2 -O3
+ endif
+
++FALLTHROUGH := $(shell gcc -v --help 2>&1 | grep "implicit-fallthrough" | wc -l)
++ifneq "$(FALLTHROUGH)" "0"
++CWFLAGS += -Wimplicit-fallthrough=0
++endif
++
+ ifdef DEBIAN
+ CPPFLAGS += -DDEBIAN
+ endif
+--
+2.12.2
+