Skip to contentSkip to conversation

nss: Update to 3.29.1

PATCH New Khem Raj 1 participant 5 messages Apr 20, 2017

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/5 nss: Update to 3.29.1

Also fix build with gcc7 along

---
 .../nss/0001-Fix-warnings-found-with-gcc7.patch    | 41 ++++++++++++++++++++++
 .../nss/{nss_3.28.1.bb => nss_3.29.1.bb}           | 28 +++++++--------
 2 files changed, 55 insertions(+), 14 deletions(-)
 create mode 100644 meta/recipes-support/nss/nss/0001-Fix-warnings-found-with-gcc7.patch
 rename meta/recipes-support/nss/{nss_3.28.1.bb => nss_3.29.1.bb} (90%)
meta/recipes-support/nss/nss/0001-Fix-warnings-found-with-gcc7.patch new file +41 -0
new file mode 100644
index 00000000000..b16fb020c1c
@@ -0,0 +1,41 @@
+From a1d2ef6a8e1bc721e44640bdb85747deaf8edcca Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Wed, 19 Apr 2017 10:50:37 -0700
+Subject: [PATCH] Fix warnings found with gcc7
+
+GCC7 finds more type conversion issues
+
+| pkix_pl_ocsprequest.c: In function 'pkix_pl_OcspRequest_Hashcode':
+| pkix_pl_ocsprequest.c:92:60: error: '<<' in boolean context, did you mean '<' ? [-Werror=int-in-bool-context]
+|          *pHashcode = (((((extensionHash << 8) || certHash) << 8) ||
+|                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
+| pkix_pl_ocsprequest.c:93:27: error: '<<' in boolean context, did you mean '<' ? [-Werror=int-in-bool-context]
+|          *pHashcode = (((((extensionHash << 8) || certHash) << 8) ||
+|                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+|                  dateHash) << 8) || signerHash;
+|                  ~~~~~~~~~~^~~~~
+| cc1: all warnings being treated as errors
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ nss/lib/libpkix/pkix_pl_nss/pki/pkix_pl_ocsprequest.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/nss/lib/libpkix/pkix_pl_nss/pki/pkix_pl_ocsprequest.c b/nss/lib/libpkix/pkix_pl_nss/pki/pkix_pl_ocsprequest.c
+index 171a3d2..d5eef88 100644
+--- a/nss/lib/libpkix/pkix_pl_nss/pki/pkix_pl_ocsprequest.c
++++ b/nss/lib/libpkix/pkix_pl_nss/pki/pkix_pl_ocsprequest.c
+@@ -89,7 +89,7 @@ pkix_pl_OcspRequest_Hashcode(
+         PKIX_HASHCODE(ocspRq->signerCert, &signerHash, plContext,
+                 PKIX_CERTHASHCODEFAILED);
+ 
+-        *pHashcode = (((((extensionHash << 8) || certHash) << 8) ||
++        *pHashcode = ((PKIX_UInt32)(((PKIX_UInt32)((extensionHash << 8) || certHash) << 8) ||
+                 dateHash) << 8) || signerHash;
+ 
+ cleanup:
+-- 
+2.12.2
+
meta/recipes-support/nss/nss_3.29.1.bb renamed from meta/recipes-support/nss/nss_3.28.1.bb +14 -14
similarity index 90%
rename from meta/recipes-support/nss/nss_3.28.1.bb
rename to meta/recipes-support/nss/nss_3.29.1.bb
index fed86fc8e92..48db0312b10 100644
@@ -14,20 +14,20 @@ LIC_FILES_CHKSUM = "file://nss/COPYING;md5=3b1e88e1b9c0b5a4b2881d46cce06a18 \
                     file://nss/lib/freebl/mpi/doc/LICENSE;md5=491f158d09d948466afce85d6f1fe18f \
                     file://nss/lib/freebl/mpi/doc/LICENSE-MPL;md5=5d425c8f3157dbf212db2ec53d9e5132"
 
-SRC_URI = "\
-    http://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/NSS_3_28_1_RTM/src/${BP}.tar.gz \
-    file://0001-nss-fix-support-cross-compiling.patch \
-    file://nss-no-rpath-for-cross-compiling.patch \
-    file://nss-fix-incorrect-shebang-of-perl.patch \
-    file://nss-fix-nsinstall-build.patch \
-    file://disable-Wvarargs-with-clang.patch \
-    file://pqg.c-ULL_addend.patch \
-    file://Fix-compilation-for-X32.patch \
-    file://nss.pc.in \
-    file://signlibs.sh \
-"
-SRC_URI[md5sum] = "e98d48435cee5792f97ef7fc35a602c3"
-SRC_URI[sha256sum] = "58cc0c05c0ed9523e6d820bea74f513538f48c87aac931876e3d3775de1a82ad"
+SRC_URI = "http://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/NSS_3_29_1_RTM/src/${BP}.tar.gz \
+           file://nss.pc.in \
+           file://signlibs.sh \
+           file://0001-nss-fix-support-cross-compiling.patch \
+           file://nss-no-rpath-for-cross-compiling.patch \
+           file://nss-fix-incorrect-shebang-of-perl.patch \
+           file://nss-fix-nsinstall-build.patch \
+           file://disable-Wvarargs-with-clang.patch \
+           file://pqg.c-ULL_addend.patch \
+           file://Fix-compilation-for-X32.patch \
+           file://0001-Fix-warnings-found-with-gcc7.patch \
+           "
+SRC_URI[md5sum] = "0525d1a45931892daa0f368d379d4aa4"
+SRC_URI[sha256sum] = "47259bc5c4439d8228d7c577ea652ed140588f27eae8ebb39cc91057aea37366"
 
 UPSTREAM_CHECK_URI = "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/NSS_Releases"
 UPSTREAM_CHECK_REGEX = "NSS_(?P<pver>.+)_release_notes"
Signature · 1 line
2.12.2
author
#1 lore raw

PATCH 2/5 json-c: Upgrade to 0.12.1 release

Backport fix for gcc7 warning along the way

---
 ...-FALLTHRU-comment-to-handle-GCC7-warnings.patch | 74 ++++++++++++++++++++++
 .../0001-Link-against-libm-when-needed.patch       | 53 ----------------
 .../0001-json_tokener-requires-INF-and-NAN.patch   | 37 -----------
 .../json-c/{json-c_0.12.bb => json-c_0.12.1.bb}    | 18 +++---
 4 files changed, 83 insertions(+), 99 deletions(-)
 create mode 100644 meta/recipes-devtools/json-c/json-c/0001-Add-FALLTHRU-comment-to-handle-GCC7-warnings.patch
 delete mode 100644 meta/recipes-devtools/json-c/json-c/0001-Link-against-libm-when-needed.patch
 delete mode 100644 meta/recipes-devtools/json-c/json-c/0001-json_tokener-requires-INF-and-NAN.patch
 rename meta/recipes-devtools/json-c/{json-c_0.12.bb => json-c_0.12.1.bb} (70%)
meta/recipes-devtools/json-c/json-c/0001-Add-FALLTHRU-comment-to-handle-GCC7-warnings.patch new file +74 -0
new file mode 100644
index 00000000000..537be5e6d29
@@ -0,0 +1,74 @@
+From 7b24f8bd95ad4f7d00c93ca2ad998c14a0266dbe Mon Sep 17 00:00:00 2001
+From: marxin <[email protected]>
+Date: Tue, 21 Mar 2017 08:42:11 +0100
+Subject: [PATCH] Add FALLTHRU comment to handle GCC7 warnings.
+
+---
+Upstream-Status: Backport
+Signed-off-by: Khem Raj <[email protected]>
+
+ json_object.c  |  1 +
+ json_tokener.c |  1 +
+ linkhash.c     | 22 +++++++++++-----------
+ 3 files changed, 13 insertions(+), 11 deletions(-)
+
+diff --git a/json_object.c b/json_object.c
+index 6cc73bc..77e8b21 100644
+--- a/json_object.c
++++ b/json_object.c
+@@ -552,6 +552,7 @@ int64_t json_object_get_int64(struct json_object *jso)
+     return jso->o.c_boolean;
+   case json_type_string:
+ 	if (json_parse_int64(jso->o.c_string.str, &cint) == 0) return cint;
++	/* FALLTHRU */
+   default:
+     return 0;
+   }
+diff --git a/json_tokener.c b/json_tokener.c
+index 9a76293..ae7b1ae 100644
+--- a/json_tokener.c
++++ b/json_tokener.c
+@@ -305,6 +305,7 @@ struct json_object* json_tokener_parse_ex(struct json_tokener *tok,
+             tok->err = json_tokener_error_parse_unexpected;
+             goto out;
+         }
++	/* FALLTHRU */
+       case '"':
+ 	state = json_tokener_state_string;
+ 	printbuf_reset(tok->pb);
+diff --git a/linkhash.c b/linkhash.c
+index 712c387..74e3b0f 100644
+--- a/linkhash.c
++++ b/linkhash.c
+@@ -376,17 +376,17 @@ static uint32_t hashlittle( const void *key, size_t length, uint32_t initval)
+     /*-------------------------------- last block: affect all 32 bits of (c) */
+     switch(length)                   /* all the case statements fall through */
+     {
+-    case 12: c+=((uint32_t)k[11])<<24;
+-    case 11: c+=((uint32_t)k[10])<<16;
+-    case 10: c+=((uint32_t)k[9])<<8;
+-    case 9 : c+=k[8];
+-    case 8 : b+=((uint32_t)k[7])<<24;
+-    case 7 : b+=((uint32_t)k[6])<<16;
+-    case 6 : b+=((uint32_t)k[5])<<8;
+-    case 5 : b+=k[4];
+-    case 4 : a+=((uint32_t)k[3])<<24;
+-    case 3 : a+=((uint32_t)k[2])<<16;
+-    case 2 : a+=((uint32_t)k[1])<<8;
++    case 12: c+=((uint32_t)k[11])<<24; /* FALLTHRU */
++    case 11: c+=((uint32_t)k[10])<<16; /* FALLTHRU */
++    case 10: c+=((uint32_t)k[9])<<8; /* FALLTHRU */
++    case 9 : c+=k[8]; /* FALLTHRU */
++    case 8 : b+=((uint32_t)k[7])<<24; /* FALLTHRU */
++    case 7 : b+=((uint32_t)k[6])<<16; /* FALLTHRU */
++    case 6 : b+=((uint32_t)k[5])<<8; /* FALLTHRU */
++    case 5 : b+=k[4]; /* FALLTHRU */
++    case 4 : a+=((uint32_t)k[3])<<24; /* FALLTHRU */
++    case 3 : a+=((uint32_t)k[2])<<16; /* FALLTHRU */
++    case 2 : a+=((uint32_t)k[1])<<8; /* FALLTHRU */
+     case 1 : a+=k[0];
+              break;
+     case 0 : return c;
+-- 
+2.12.2
+
meta/recipes-devtools/json-c/json-c/0001-Link-against-libm-when-needed.patch deleted +0 -53

53 lines not on this page · raw message

meta/recipes-devtools/json-c/json-c/0001-json_tokener-requires-INF-and-NAN.patch deleted +0 -37
deleted file mode 100644
index d29d9118dc4..00000000000
@@ -1,37 +0,0 @@
-From 9be71700eb580c815688584a64621a38867c3fdd Mon Sep 17 00:00:00 2001
-From: James Myatt <[email protected]>
-Date: Thu, 5 Feb 2015 15:57:14 +0000
-Subject: [PATCH] json_tokener requires INF and NAN
-
----
-Upstream-Status: Backport
-
- json_tokener.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-Index: json-c-0.12/json_tokener.c
-===================================================================
---- json-c-0.12.orig/json_tokener.c
-+++ json-c-0.12/json_tokener.c
-@@ -16,6 +16,7 @@
- #include "config.h"
- 
- #include <math.h>
-+#include "math_compat.h"
- #include <stdio.h>
- #include <stdlib.h>
- #include <stddef.h>
-@@ -352,12 +353,10 @@ struct json_object* json_tokener_parse_e
- 
-     case json_tokener_state_inf: /* aka starts with 'i' */
-       {
--	int size;
--	int size_inf;
-+	size_t size_inf;
- 	int is_negative = 0;
- 
- 	printbuf_memappend_fast(tok->pb, &c, 1);
--	size = json_min(tok->st_pos+1, json_null_str_len);
- 	size_inf = json_min(tok->st_pos+1, json_inf_str_len);
- 	char *infbuf = tok->pb->buf;
- 	if (*infbuf == '-')
meta/recipes-devtools/json-c/json-c_0.12.1.bb renamed from meta/recipes-devtools/json-c/json-c_0.12.bb +9 -9
similarity index 70%
rename from meta/recipes-devtools/json-c/json-c_0.12.bb
rename to meta/recipes-devtools/json-c/json-c_0.12.1.bb
index a15455c9bfb..5aa4164f2bb 100644
@@ -5,25 +5,25 @@ LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://COPYING;md5=de54b60fbbc35123ba193fea8ee216f2"
 
 SRC_URI = "https://s3.amazonaws.com/json-c_releases/releases/${BP}.tar.gz \
-           file://0001-json_tokener-requires-INF-and-NAN.patch \
-           file://0001-Link-against-libm-when-needed.patch \
-          "
-
-SRC_URI[md5sum] = "3ca4bbb881dfc4017e8021b5e0a8c491"
-SRC_URI[sha256sum] = "000c01b2b3f82dcb4261751eb71f1b084404fb7d6a282f06074d3c17078b9f3f"
+           file://0001-Add-FALLTHRU-comment-to-handle-GCC7-warnings.patch \
+           "
+SRC_URI[md5sum] = "55f7853f7d8cf664554ce3fa71bf1c7d"
+SRC_URI[sha256sum] = "2a136451a7932d80b7d197b10441e26e39428d67b1443ec43bbba824705e1123"
 
 UPSTREAM_CHECK_REGEX = "json-c-(?P<pver>\d+(\.\d+)+).tar"
 # json-c releases page is fetching the list of releases in some weird XML format
 # from https://s3.amazonaws.com/json-c_releases and processes it with javascript :-/
 #UPSTREAM_CHECK_URI = "https://s3.amazonaws.com/json-c_releases/releases/index.html"
-RECIPE_UPSTREAM_VERSION = "0.12"
-RECIPE_UPSTREAM_DATE = "Apr 11, 2014"
-CHECK_DATE = "Dec 04, 2015"
+RECIPE_UPSTREAM_VERSION = "0.12.1"
+RECIPE_UPSTREAM_DATE = "Jun 07, 2016"
+CHECK_DATE = "Apr 19, 2017"
 
 RPROVIDES_${PN} = "libjson"
 
 inherit autotools
 
+EXTRA_OECONF = "--disable-rpath --enable-rdrand"
+
 do_configure_prepend() {
     # Clean up autoconf cruft that should not be in the tarball
     rm -f ${S}/config.status
Signature · 1 line
2.12.2
author
#2 lore raw

PATCH 3/5 pax: Fix build with gcc7

In reply to Khem Raj
---
 .../pax/0001-Add-a-comment-for-fallthrough.patch   | 38 ++++++++++++++++++++++
 meta/recipes-extended/pax/pax_3.4.bb               |  9 ++---
 2 files changed, 43 insertions(+), 4 deletions(-)
 create mode 100644 meta/recipes-extended/pax/pax/0001-Add-a-comment-for-fallthrough.patch
meta/recipes-extended/pax/pax/0001-Add-a-comment-for-fallthrough.patch new file +38 -0
new file mode 100644
index 00000000000..b76f85aa458
@@ -0,0 +1,38 @@
+From e67bb3debe582f0e77770b714bd012bb1082fc41 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Wed, 19 Apr 2017 11:32:00 -0700
+Subject: [PATCH] Add a comment for fallthrough
+
+Fixes warnings with gcc7 e.g.
+
+../../../../../../../workspace/sources/pax/src/options.c: In function 'tar_options':
+../../../../../../../workspace/sources/pax/src/options.c:725:7: error: this statement may fall through [-Werror=implicit-fallthrough=]
+    if (opt_add ("write_opt=nodir") < 0)
+       ^
+../../../../../../../workspace/sources/pax/src/options.c:730:2: note: here
+  case 'O':
+  ^~~~
+cc1: all warnings being treated as errors
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ src/options.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/options.c b/src/options.c
+index c663b4e..b80819a 100644
+--- a/src/options.c
++++ b/src/options.c
+@@ -724,6 +724,7 @@ tar_options (int argc, char **argv)
+ 	case 'o':
+ 	  if (opt_add ("write_opt=nodir") < 0)
+ 	    tar_usage ();
++	  /* fallthru */
+ 	case 'O':
+ 	  Oflag = 1;
+ 	  break;
+-- 
+2.12.2
+
meta/recipes-extended/pax/pax_3.4.bb +5 -4
index 9b4e17b3df7..6df9a8186b6 100644
@@ -15,10 +15,11 @@ PR = "r2"
 DEPENDS_append_libc-musl = " fts "
 
 SRC_URI = "http://pkgs.fedoraproject.org/repo/pkgs/${BPN}/${BP}.tar.bz2/fbd9023b590b45ac3ade95870702a0d6/${BP}.tar.bz2 \
-	file://fix_for_compile_with_gcc-4.6.0.patch \
-	file://pax-3.4_fix_for_x32.patch \
-        file://0001-include-sys-sysmacros.h-for-major-minor-definitions.patch \
-"
+           file://fix_for_compile_with_gcc-4.6.0.patch \
+           file://pax-3.4_fix_for_x32.patch \
+           file://0001-include-sys-sysmacros.h-for-major-minor-definitions.patch \
+           file://0001-Add-a-comment-for-fallthrough.patch \
+           "
 
 SRC_URI_append_libc-musl = " file://0001-Fix-build-with-musl.patch \
                              file://0001-use-strtoll-instead-of-strtoq.patch \
Signature · 1 line
2.12.2
author
#3 lore raw

PATCH 4/5 aspell: Fix build with gcc7

In reply to Khem Raj
---
 meta/recipes-support/aspell/aspell/gcc7.patch  | 40 ++++++++++++++++++++++++++
 meta/recipes-support/aspell/aspell_0.60.6.1.bb |  4 ++-
 2 files changed, 43 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-support/aspell/aspell/gcc7.patch
meta/recipes-support/aspell/aspell/gcc7.patch new file +40 -0
new file mode 100644
index 00000000000..6ffd0772fa1
@@ -0,0 +1,40 @@
+From 8089fa02122fed0a6394eba14bbedcb1d18e2384 Mon Sep 17 00:00:00 2001
+From: Kevin Atkinson <[email protected]>
+Date: Thu, 29 Dec 2016 00:50:31 -0500
+Subject: [PATCH] Compile Fixes for GCC 7.
+
+Closes #519.
+---
+Signed-off-by: Khem Raj <[email protected]>
+Upstream-Status: Backport
+
+ modules/filter/tex.cpp | 2 +-
+ prog/check_funs.cpp    | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/modules/filter/tex.cpp b/modules/filter/tex.cpp
+index a979539..19ab63c 100644
+--- a/modules/filter/tex.cpp
++++ b/modules/filter/tex.cpp
+@@ -174,7 +174,7 @@ namespace {
+ 
+     if (c == '{') {
+ 
+-      if (top.in_what == Parm || top.in_what == Opt || top.do_check == '\0')
++      if (top.in_what == Parm || top.in_what == Opt || *top.do_check == '\0')
+ 	push_command(Parm);
+ 
+       top.in_what = Parm;
+diff --git a/prog/check_funs.cpp b/prog/check_funs.cpp
+index db54f3d..89ee09d 100644
+--- a/prog/check_funs.cpp
++++ b/prog/check_funs.cpp
+@@ -647,7 +647,7 @@ static void print_truncate(FILE * out, const char * word, int width) {
+     }
+   }
+   if (i == width-1) {
+-    if (word == '\0')
++    if (*word == '\0')
+       put(out,' ');
+     else if (word[len] == '\0')
+       put(out, word, len);
meta/recipes-support/aspell/aspell_0.60.6.1.bb +3 -1
index 5a23754b74b..19a7155d66a 100644
@@ -6,7 +6,9 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=7fbc338309ac38fefcd64b04bb903e34"
 
 PR = "r1"
 
-SRC_URI = "${GNU_MIRROR}/aspell/aspell-${PV}.tar.gz"
+SRC_URI = "${GNU_MIRROR}/aspell/aspell-${PV}.tar.gz \
+           file://gcc7.patch \
+          "
 SRC_URI[md5sum] = "e66a9c9af6a60dc46134fdacf6ce97d7"
 SRC_URI[sha256sum] = "f52583a83a63633701c5f71db3dc40aab87b7f76b29723aeb27941eff42df6e1"
 
Signature · 1 line
2.12.2
author
#4 lore raw

PATCH 5/5 mdadm: Backport and make fixes for building with gcc7

In reply to Khem Raj
---
 ...m-Add-Wimplicit-fallthrough-0-in-Makefile.patch |  37 ++++++
 ...pecify-enough-length-when-write-to-buffer.patch |  75 ++++++++++++
 ...rintf-with-strncpy-at-some-places-to-avoi.patch |  59 ++++++++++
 ...orced-type-conversion-to-avoid-truncation.patch |  33 ++++++
 ...d-a-comment-to-indicate-valid-fallthrough.patch | 128 +++++++++++++++++++++
 meta/recipes-extended/mdadm/mdadm_4.0.bb           |   5 +
 6 files changed, 337 insertions(+)
 create mode 100644 meta/recipes-extended/mdadm/files/0001-mdadm-Add-Wimplicit-fallthrough-0-in-Makefile.patch
 create mode 100644 meta/recipes-extended/mdadm/files/0002-mdadm-Specify-enough-length-when-write-to-buffer.patch
 create mode 100644 meta/recipes-extended/mdadm/files/0003-Replace-snprintf-with-strncpy-at-some-places-to-avoi.patch
 create mode 100644 meta/recipes-extended/mdadm/files/0004-mdadm-Forced-type-conversion-to-avoid-truncation.patch
 create mode 100644 meta/recipes-extended/mdadm/files/0005-Add-a-comment-to-indicate-valid-fallthrough.patch
meta/recipes-extended/mdadm/files/0001-mdadm-Add-Wimplicit-fallthrough-0-in-Makefile.patch new file +37 -0
new file mode 100644
index 00000000000..ce15170c758
@@ -0,0 +1,37 @@
+From aa09af0fe2ec0737fa04ffd00957532684e257b9 Mon Sep 17 00:00:00 2001
+From: Xiao Ni <[email protected]>
+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 <[email protected]>
+Signed-off-by: Jes Sorensen <[email protected]>
+---
+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
+
meta/recipes-extended/mdadm/files/0002-mdadm-Specify-enough-length-when-write-to-buffer.patch new file +75 -0

75 lines not on this page · raw message

meta/recipes-extended/mdadm/files/0003-Replace-snprintf-with-strncpy-at-some-places-to-avoi.patch new file +59 -0

59 lines not on this page · raw message

meta/recipes-extended/mdadm/files/0004-mdadm-Forced-type-conversion-to-avoid-truncation.patch new file +33 -0
new file mode 100644
index 00000000000..94fde42e992
@@ -0,0 +1,33 @@
+From 5da889032e2d99751ed9fe60016146e9ae8114cd Mon Sep 17 00:00:00 2001
+From: Xiao Ni <[email protected]>
+Date: Sat, 18 Mar 2017 10:33:45 +0800
+Subject: [PATCH 4/5] mdadm: Forced type conversion to avoid truncation
+
+Gcc reports it needs 19 bytes to right to disk->serial. Because the
+type of argument i is int. But the meaning of i is failed disk
+number. So it doesn't need to use 19 bytes.  Just add a type
+conversion to avoid this building error
+
+Signed-off-by: Xiao Ni <[email protected]>
+Signed-off-by: Jes Sorensen <[email protected]>
+---
+Upstream-Status: Backport
+ super-intel.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/super-intel.c b/super-intel.c
+index 5499098..4e466ff 100644
+--- a/super-intel.c
++++ b/super-intel.c
+@@ -5228,7 +5228,7 @@ static int init_super_imsm_volume(struct supertype *st, mdu_array_info_t *info,
+ 			disk->status = CONFIGURED_DISK | FAILED_DISK;
+ 			disk->scsi_id = __cpu_to_le32(~(__u32)0);
+ 			snprintf((char *) disk->serial, MAX_RAID_SERIAL_LEN,
+-				 "missing:%d", i);
++				 "missing:%d", (__u8)i);
+ 		}
+ 		find_missing(super);
+ 	} else {
+-- 
+2.12.2
+
meta/recipes-extended/mdadm/files/0005-Add-a-comment-to-indicate-valid-fallthrough.patch new file +128 -0

128 lines not on this page · raw message

meta/recipes-extended/mdadm/mdadm_4.0.bb +5 -0
index 62614f060f2..98a10a8b15d 100644
@@ -16,6 +16,11 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/raid/mdadm/${BPN}-${PV}.tar.xz \
            file://run-ptest \
            file://0001-mdadm.h-Undefine-dprintf-before-redefining.patch \
            file://0001-include-sys-sysmacros.h-for-major-minor-defintions.patch \
+           file://0001-mdadm-Add-Wimplicit-fallthrough-0-in-Makefile.patch \
+           file://0002-mdadm-Specify-enough-length-when-write-to-buffer.patch \
+           file://0003-Replace-snprintf-with-strncpy-at-some-places-to-avoi.patch \
+           file://0004-mdadm-Forced-type-conversion-to-avoid-truncation.patch \
+           file://0005-Add-a-comment-to-indicate-valid-fallthrough.patch \
            "
 SRC_URI[md5sum] = "2cb4feffea9167ba71b5f346a0c0a40d"
 SRC_URI[sha256sum] = "1d6ae7f24ced3a0fa7b5613b32f4a589bb4881e3946a5a2c3724056254ada3a9"
Signature · 1 line
2.12.2