summaryrefslogtreecommitdiffstats
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-11 16:59:18 +0100
commit63bafcca5d4c0b5d6481f5f64fe2c9d1f3d9e6fe (patch)
tree7c49d7aae8d946b0ebbdb826a17538c2193782e0 /meta/recipes-extended/mdadm/files/0001-mdadm-Add-Wimplicit-fallthrough-0-in-Makefile.patch
parent7f5437ac91a66901d71828fe648a8a470af877a3 (diff)
downloadpoky-63bafcca5d4c0b5d6481f5f64fe2c9d1f3d9e6fe.tar.gz
mdadm: Backport and make fixes for building with gcc7
(From OE-Core rev: c901af4574693ede5f1dcbccccc7c5a820b3d659) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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 @@
1From aa09af0fe2ec0737fa04ffd00957532684e257b9 Mon Sep 17 00:00:00 2001
2From: Xiao Ni <xni@redhat.com>
3Date: Fri, 17 Mar 2017 19:55:42 +0800
4Subject: [PATCH 1/5] mdadm: Add Wimplicit-fallthrough=0 in Makefile
5
6There are many errors like 'error: this statement may fall through'.
7But the logic is right. So add the flag Wimplicit-fallthrough=0
8to disable the error messages. The method I use is from
9https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
10#index-Wimplicit-fallthrough-375
11
12Signed-off-by: Xiao Ni <xni@redhat.com>
13Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com>
14---
15Upstream-Status: Backport
16 Makefile | 5 +++++
17 1 file changed, 5 insertions(+)
18
19diff --git a/Makefile b/Makefile
20index 0f307ec..e1a7058 100644
21--- a/Makefile
22+++ b/Makefile
23@@ -48,6 +48,11 @@ ifdef WARN_UNUSED
24 CWFLAGS += -Wp,-D_FORTIFY_SOURCE=2 -O3
25 endif
26
27+FALLTHROUGH := $(shell gcc -v --help 2>&1 | grep "implicit-fallthrough" | wc -l)
28+ifneq "$(FALLTHROUGH)" "0"
29+CWFLAGS += -Wimplicit-fallthrough=0
30+endif
31+
32 ifdef DEBIAN
33 CPPFLAGS += -DDEBIAN
34 endif
35--
362.12.2
37