summaryrefslogtreecommitdiff
path: root/import-layers/yocto-poky/meta/recipes-devtools
diff options
context:
space:
mode:
authorBrad Bishop <bradleyb@fuzziesquirrel.com>2017-12-04 09:01:44 +0300
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2017-12-14 20:17:23 +0300
commit37a0e4ddff58c0120cc5cfef104b60d0e180638c (patch)
tree1628857a2eb33ab517ba93d6a3ca25e55bd3e628 /import-layers/yocto-poky/meta/recipes-devtools
parent3c4c45d1e9a2324191a8640b22df1b71f15f3037 (diff)
downloadopenbmc-37a0e4ddff58c0120cc5cfef104b60d0e180638c.tar.xz
Squashed 'import-layers/yocto-poky/' changes from dc8508f6099..67491b0c104
Yocto 2.2.2 (Morty) Change-Id: Id9a452e28940d9f166957de243d9cb1d8818704e git-subtree-dir: import-layers/yocto-poky git-subtree-split: 67491b0c104101bb9f366d697edd23c895be4302 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'import-layers/yocto-poky/meta/recipes-devtools')
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/automake/automake/0001-automake-port-to-Perl-5.22-and-later.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/automake/automake_1.15.bb4
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-2.27.inc9
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0001-ppc-apuinfo-for-spe-parsed-incorrectly.patch37
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0016-Fix-seg-fault-in-ARM-linker-when-trying-to-parse-a-b.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0017-Fix-the-generation-of-alignment-frags-in-code-sectio.patch139
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-6965.patch127
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-6966.patch240
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-6969.patch56
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-6969_2.patch122
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-7209.patch63
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-7210.patch71
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/docbook-utils/docbook-utils-native_0.6.14.bb2
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-e2fsck-exit-with-exit-status-0-if-no-errors-were-fix.patch285
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/mkdir_p.patch20
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.43.bb2
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/0001-Add-GCC7-Wimplicit-fallthrough-support-fixes.patch318
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/0001-ar-Fix-GCC7-Wformat-length-issues.patch125
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/Fix_one_GCC7_warning.patch45
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/fallthrough.patch36
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils_0.148.bb3
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils_0.166.bb9
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2.inc5
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/ubsan-fix-check-empty-string.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc-common.inc3
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-7.11.1.inc22
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-7.11.inc9
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-common.inc24
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross-canadian.inc3
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross-canadian_7.11.1.bb (renamed from import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross-canadian_7.11.bb)0
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross_7.11.1.bb (renamed from import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross_7.11.bb)0
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb_7.11.1.bb (renamed from import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb_7.11.bb)0
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-test-customized.patch2
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/More-correctly-fix-xattrs.patch37
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_1.8.1.bb1
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_git.bb2
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python-numpy/files/d70d37b7c4aa2af3fe879a0d858c54f2aa32a725.patch47
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python-numpy/python-numpy_1.11.1.bb1
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python-numpy/python3-numpy_1.11.0.bb1
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-2.7-manifest.inc2
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python-3.5-manifest.inc2
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/python/python3-native_3.5.2.bb4
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/0001-virtio-zero-vq-inuse-in-virtio_reset.patch57
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/0002-fix-CVE-2016-7423.patch45
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/0003-fix-CVE-2016-7908.patch62
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/0004-fix-CVE-2016-7909.patch42
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/04b33e21866412689f18b7ad6daf0a54d8f959a7.patch282
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/run-ptest8
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu_2.7.0.bb5
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/0001-macros-add-_gpg_sign_cmd_extra_args.patch43
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm_5.4.16.bb3
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/sgml-common/sgml-common_0.6.3.bb2
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/subversion/subversion/0001-fix-svnadmin-create-fail-on-x86.patch56
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/subversion/subversion/serfmacro.patch22
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/subversion/subversion_1.9.4.bb2
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/11_mips-link-tool.patch37
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/gcc5-port.patch64
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/valgrind-make-ld-XXX.so-strlen-intercept-optional.patch45
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind_3.12.0.bb (renamed from import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind_3.11.0.bb)7
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/xmlto/xmlto_0.0.28.bb4
60 files changed, 2596 insertions, 159 deletions
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/automake/automake/0001-automake-port-to-Perl-5.22-and-later.patch b/import-layers/yocto-poky/meta/recipes-devtools/automake/automake/0001-automake-port-to-Perl-5.22-and-later.patch
new file mode 100644
index 000000000..0e6895fb4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/automake/automake/0001-automake-port-to-Perl-5.22-and-later.patch
@@ -0,0 +1,32 @@
+From 13f00eb4493c217269b76614759e452d8302955e Mon Sep 17 00:00:00 2001
+From: Paul Eggert <eggert@cs.ucla.edu>
+Date: Thu, 31 Mar 2016 16:35:29 -0700
+Subject: [PATCH] automake: port to Perl 5.22 and later
+
+Without this change, Perl 5.22 complains "Unescaped left brace in
+regex is deprecated" and this is planned to become a hard error in
+Perl 5.26. See:
+http://search.cpan.org/dist/perl-5.22.0/pod/perldelta.pod#A_literal_%22{%22_should_now_be_escaped_in_a_pattern
+* bin/automake.in (substitute_ac_subst_variables): Escape left brace.
+
+Upstream-Status: Backport [13f00eb4493c217269b76614759e452d8302955e]
+---
+ bin/automake.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/bin/automake.in b/bin/automake.in
+index a3a0aa318..2c8f31e14 100644
+--- a/bin/automake.in
++++ b/bin/automake.in
+@@ -3878,7 +3878,7 @@ sub substitute_ac_subst_variables_worker
+ sub substitute_ac_subst_variables
+ {
+ my ($text) = @_;
+- $text =~ s/\${([^ \t=:+{}]+)}/substitute_ac_subst_variables_worker ($1)/ge;
++ $text =~ s/\$[{]([^ \t=:+{}]+)}/substitute_ac_subst_variables_worker ($1)/ge;
+ return $text;
+ }
+
+--
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/automake/automake_1.15.bb b/import-layers/yocto-poky/meta/recipes-devtools/automake/automake_1.15.bb
index a3c72fd33..61ae3ba3e 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/automake/automake_1.15.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/automake/automake_1.15.bb
@@ -21,7 +21,9 @@ RDEPENDS_${PN}_class-native = "autoconf-native hostperl-runtime-native"
SRC_URI += " file://python-libdir.patch \
file://buildtest.patch \
file://performance.patch \
- file://new_rt_path_for_test-driver.patch"
+ file://new_rt_path_for_test-driver.patch \
+ file://0001-automake-port-to-Perl-5.22-and-later.patch \
+ "
SRC_URI[md5sum] = "716946a105ca228ab545fc37a70df3a3"
SRC_URI[sha256sum] = "7946e945a96e28152ba5a6beb0625ca715c6e32ac55f2e353ef54def0c8ed924"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-2.27.inc b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-2.27.inc
index af1420b24..0936d974d 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-2.27.inc
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils-2.27.inc
@@ -36,6 +36,15 @@ SRC_URI = "\
file://0014-libtool-remove-rpath.patch \
file://0015-binutils-mips-gas-pic-relax-linkonce.diff \
file://0015-Refine-.cfi_sections-check-to-only-consider-compact-.patch \
+ file://0016-Fix-seg-fault-in-ARM-linker-when-trying-to-parse-a-b.patch \
+ file://0017-Fix-the-generation-of-alignment-frags-in-code-sectio.patch \
+ file://0001-ppc-apuinfo-for-spe-parsed-incorrectly.patch \
+ file://CVE-2017-6965.patch \
+ file://CVE-2017-6966.patch \
+ file://CVE-2017-6969.patch \
+ file://CVE-2017-6969_2.patch \
+ file://CVE-2017-7209.patch \
+ file://CVE-2017-7210.patch \
"
S = "${WORKDIR}/git"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0001-ppc-apuinfo-for-spe-parsed-incorrectly.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0001-ppc-apuinfo-for-spe-parsed-incorrectly.patch
new file mode 100644
index 000000000..d82a0b694
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0001-ppc-apuinfo-for-spe-parsed-incorrectly.patch
@@ -0,0 +1,37 @@
+From 8941017bc0226b60ce306d5271df15820ce66a53 Mon Sep 17 00:00:00 2001
+From: Alan Modra <amodra@gmail.com>
+Date: Tue, 30 Aug 2016 20:57:32 +0930
+Subject: [PATCH] ppc apuinfo for spe parsed incorrectly
+Organization: O.S. Systems Software LTDA.
+
+apuinfo saying SPE resulted in mach = bfd_mach_ppc_vle due to a
+missing break.
+
+ PR 20531
+ * elf32-ppc.c (_bfd_elf_ppc_set_arch): Add missing "break".
+
+
+Backport from :
+https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;h=8941017b
+
+Upstream-Status: Backport
+Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
+---
+ bfd/elf32-ppc.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
+index 95ce1dc..e42ef1c 100644
+--- a/bfd/elf32-ppc.c
++++ b/bfd/elf32-ppc.c
+@@ -2246,6 +2246,7 @@ _bfd_elf_ppc_set_arch (bfd *abfd)
+ case PPC_APUINFO_BRLOCK:
+ if (mach != bfd_mach_ppc_vle)
+ mach = bfd_mach_ppc_e500;
++ break;
+
+ case PPC_APUINFO_VLE:
+ mach = bfd_mach_ppc_vle;
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0016-Fix-seg-fault-in-ARM-linker-when-trying-to-parse-a-b.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0016-Fix-seg-fault-in-ARM-linker-when-trying-to-parse-a-b.patch
new file mode 100644
index 000000000..33bf1e8f6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0016-Fix-seg-fault-in-ARM-linker-when-trying-to-parse-a-b.patch
@@ -0,0 +1,31 @@
+From 72b09de92cc597c53b1d762882b67a17fe56846c Mon Sep 17 00:00:00 2001
+From: Nick Clifton <nickc@redhat.com>
+Date: Tue, 23 Aug 2016 09:45:11 +0100
+Subject: [PATCH 16/16] Fix seg-fault in ARM linker when trying to parse a
+ binary file.
+
+ * elf32-arm.c (elf32_arm_count_additional_relocs): Return zero if
+ there is no arm data associated with the section.
+---
+Upstream-Status: Backport
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+ bfd/elf32-arm.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
+index 700bec3..3fab609 100644
+--- a/bfd/elf32-arm.c
++++ b/bfd/elf32-arm.c
+@@ -18207,7 +18207,7 @@ elf32_arm_count_additional_relocs (asection *sec)
+ {
+ struct _arm_elf_section_data *arm_data;
+ arm_data = get_arm_elf_section_data (sec);
+- return arm_data->additional_reloc_count;
++ return arm_data == NULL ? 0 : arm_data->additional_reloc_count;
+ }
+
+ /* Called to set the sh_flags, sh_link and sh_info fields of OSECTION which
+--
+2.10.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0017-Fix-the-generation-of-alignment-frags-in-code-sectio.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0017-Fix-the-generation-of-alignment-frags-in-code-sectio.patch
new file mode 100644
index 000000000..f8b46be69
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/0017-Fix-the-generation-of-alignment-frags-in-code-sectio.patch
@@ -0,0 +1,139 @@
+From 4a4286465b5d6c28968bc2b29ae08daca7f219a3 Mon Sep 17 00:00:00 2001
+From: Nick Clifton <nickc@redhat.com>
+Date: Fri, 18 Nov 2016 11:42:48 -0800
+Subject: [PATCH] Fix the generation of alignment frags in code sections for AArch64.
+
+PR gas/20364
+* config/tc-aarch64.c (s_ltorg): Change the mapping state after
+aligning the frag.
+(aarch64_init): Treat rs_align frags in code sections as
+containing code, not data.
+* testsuite/gas/aarch64/pr20364.s: New test.
+* testsuite/gas/aarch64/pr20364.d: New test driver.
+
+Backporting the patch from binutils mainline
+https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7ea12e5c3ad54da440c08f32da09534e63e515ca
+
+Upstream-Status: Backport
+
+Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
+---
+ gas/ChangeLog | 10 ++++++++++
+ gas/config/tc-aarch64.c | 10 +++++++---
+ gas/testsuite/gas/aarch64/pr20364.d | 13 +++++++++++++
+ gas/testsuite/gas/aarch64/pr20364.s | 28 ++++++++++++++++++++++++++++
+ 4 files changed, 58 insertions(+), 3 deletions(-)
+ create mode 100644 gas/testsuite/gas/aarch64/pr20364.d
+ create mode 100644 gas/testsuite/gas/aarch64/pr20364.s
+
+diff --git a/gas/ChangeLog b/gas/ChangeLog
+index a39895a..fad06dc 100644
+--- a/gas/ChangeLog
++++ b/gas/ChangeLog
+@@ -1,3 +1,13 @@
++2016-08-05 Nick Clifton <nickc@redhat.com>
++
++ PR gas/20364
++ * config/tc-aarch64.c (s_ltorg): Change the mapping state after
++ aligning the frag.
++ (aarch64_init): Treat rs_align frags in code sections as
++ containing code, not data.
++ * testsuite/gas/aarch64/pr20364.s: New test.
++ * testsuite/gas/aarch64/pr20364.d: New test driver.
++
+ 2016-08-03 Tristan Gingold <gingold@adacore.com>
+
+ * configure: Regenerate.
+diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c
+index ddc40f2..74933cb 100644
+--- a/gas/config/tc-aarch64.c
++++ b/gas/config/tc-aarch64.c
+@@ -1736,13 +1736,13 @@ s_ltorg (int ignored ATTRIBUTE_UNUSED)
+ if (pool == NULL || pool->symbol == NULL || pool->next_free_entry == 0)
+ continue;
+
+- mapping_state (MAP_DATA);
+-
+ /* Align pool as you have word accesses.
+ Only make a frag if we have to. */
+ if (!need_pass_2)
+ frag_align (align, 0, 0);
+
++ mapping_state (MAP_DATA);
++
+ record_alignment (now_seg, align);
+
+ sprintf (sym_name, "$$lit_\002%x", pool->id);
+@@ -6373,11 +6373,15 @@ aarch64_init_frag (fragS * fragP, int max_chars)
+
+ switch (fragP->fr_type)
+ {
+- case rs_align:
+ case rs_align_test:
+ case rs_fill:
+ mapping_state_2 (MAP_DATA, max_chars);
+ break;
++ case rs_align:
++ /* PR 20364: We can get alignment frags in code sections,
++ so do not just assume that we should use the MAP_DATA state. */
++ mapping_state_2 (subseg_text_p (now_seg) ? MAP_INSN : MAP_DATA, max_chars);
++ break;
+ case rs_align_code:
+ mapping_state_2 (MAP_INSN, max_chars);
+ break;
+diff --git a/gas/testsuite/gas/aarch64/pr20364.d b/gas/testsuite/gas/aarch64/pr20364.d
+new file mode 100644
+index 0000000..babcff1
+--- /dev/null
++++ b/gas/testsuite/gas/aarch64/pr20364.d
+@@ -0,0 +1,13 @@
++# Check that ".align <size>, <fill>" does not set the mapping state to DATA, causing unnecessary frag generation.
++#name: PR20364
++#objdump: -d
++
++.*: file format .*
++
++Disassembly of section \.vectors:
++
++0+000 <.*>:
++ 0: d2800000 mov x0, #0x0 // #0
++ 4: 94000000 bl 0 <plat_report_exception>
++ 8: 17fffffe b 0 <bl1_exceptions>
++
+diff --git a/gas/testsuite/gas/aarch64/pr20364.s b/gas/testsuite/gas/aarch64/pr20364.s
+new file mode 100644
+index 0000000..594ad7c
+--- /dev/null
++++ b/gas/testsuite/gas/aarch64/pr20364.s
+@@ -0,0 +1,28 @@
++ .macro vector_base label
++ .section .vectors, "ax"
++ .align 11, 0
++ \label:
++ .endm
++
++ .macro vector_entry label
++ .section .vectors, "ax"
++ .align 7, 0
++ \label:
++ .endm
++
++ .macro check_vector_size since
++ .if (. - \since) > (32 * 4)
++ .error "Vector exceeds 32 instructions"
++ .endif
++ .endm
++
++ .globl bl1_exceptions
++
++vector_base bl1_exceptions
++
++vector_entry SynchronousExceptionSP0
++ mov x0, #0x0
++ bl plat_report_exception
++ b SynchronousExceptionSP0
++ check_vector_size SynchronousExceptionSP0
++
+--
+2.7.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-6965.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-6965.patch
new file mode 100644
index 000000000..85f7f98fe
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-6965.patch
@@ -0,0 +1,127 @@
+From 6f898c17b1d6f6a29a05ca6de31f0fc8f52cfbfe Mon Sep 17 00:00:00 2001
+From: Nick Clifton <nickc@redhat.com>
+Date: Mon, 13 Feb 2017 13:08:32 +0000
+Subject: [PATCH 1/2] Fix readelf writing to illegal addresses whilst
+ processing corrupt input files containing symbol-difference relocations.
+
+ PR binutils/21137
+ * readelf.c (target_specific_reloc_handling): Add end parameter.
+ Check for buffer overflow before writing relocated values.
+ (apply_relocations): Pass end to target_specific_reloc_handling.
+
+(cherry pick from commit 03f7786e2f440b9892b1c34a58fb26222ce1b493)
+Upstream-Status: Backport [master]
+CVE: CVE-2017-6965
+
+Signed-off-by: Yuanjie Huang <yuanjie.huang@windriver.com>
+---
+ binutils/ChangeLog | 7 +++++++
+ binutils/readelf.c | 30 +++++++++++++++++++++++++-----
+ 2 files changed, 32 insertions(+), 5 deletions(-)
+
+diff --git a/binutils/ChangeLog b/binutils/ChangeLog
+index 995de87dc3..154b797a29 100644
+--- a/binutils/ChangeLog
++++ b/binutils/ChangeLog
+@@ -5,6 +5,13 @@
+ Check for buffer overflow before writing relocated values.
+ (apply_relocations): Pass end to target_specific_reloc_handling.
+
++2017-02-13 Nick Clifton <nickc@redhat.com>
++
++ PR binutils/21137
++ * readelf.c (target_specific_reloc_handling): Add end parameter.
++ Check for buffer overflow before writing relocated values.
++ (apply_relocations): Pass end to target_specific_reloc_handling.
++
+ 2016-08-03 Tristan Gingold <gingold@adacore.com>
+
+ * configure: Regenerate.
+diff --git a/binutils/readelf.c b/binutils/readelf.c
+index d31558c3b4..220671f76f 100644
+--- a/binutils/readelf.c
++++ b/binutils/readelf.c
+@@ -11345,6 +11345,7 @@ process_syminfo (FILE * file ATTRIBUTE_UNUSED)
+ static bfd_boolean
+ target_specific_reloc_handling (Elf_Internal_Rela * reloc,
+ unsigned char * start,
++ unsigned char * end,
+ Elf_Internal_Sym * symtab)
+ {
+ unsigned int reloc_type = get_reloc_type (reloc->r_info);
+@@ -11384,13 +11385,19 @@ target_specific_reloc_handling (Elf_Internal_Rela * reloc,
+ handle_sym_diff:
+ if (saved_sym != NULL)
+ {
++ int reloc_size = reloc_type == 1 ? 4 : 2;
+ bfd_vma value;
+
+ value = reloc->r_addend
+ + (symtab[get_reloc_symindex (reloc->r_info)].st_value
+ - saved_sym->st_value);
+
+- byte_put (start + reloc->r_offset, value, reloc_type == 1 ? 4 : 2);
++ if (start + reloc->r_offset + reloc_size >= end)
++ /* PR 21137 */
++ error (_("MSP430 sym diff reloc writes past end of section (%p vs %p)\n"),
++ start + reloc->r_offset + reloc_size, end);
++ else
++ byte_put (start + reloc->r_offset, value, reloc_size);
+
+ saved_sym = NULL;
+ return TRUE;
+@@ -11421,13 +11428,18 @@ target_specific_reloc_handling (Elf_Internal_Rela * reloc,
+ case 2: /* R_MN10300_16 */
+ if (saved_sym != NULL)
+ {
++ int reloc_size = reloc_type == 1 ? 4 : 2;
+ bfd_vma value;
+
+ value = reloc->r_addend
+ + (symtab[get_reloc_symindex (reloc->r_info)].st_value
+ - saved_sym->st_value);
+
+- byte_put (start + reloc->r_offset, value, reloc_type == 1 ? 4 : 2);
++ if (start + reloc->r_offset + reloc_size >= end)
++ error (_("MN10300 sym diff reloc writes past end of section (%p vs %p)\n"),
++ start + reloc->r_offset + reloc_size, end);
++ else
++ byte_put (start + reloc->r_offset, value, reloc_size);
+
+ saved_sym = NULL;
+ return TRUE;
+@@ -11462,12 +11474,20 @@ target_specific_reloc_handling (Elf_Internal_Rela * reloc,
+ break;
+
+ case 0x41: /* R_RL78_ABS32. */
+- byte_put (start + reloc->r_offset, value, 4);
++ if (start + reloc->r_offset + 4 >= end)
++ error (_("RL78 sym diff reloc writes past end of section (%p vs %p)\n"),
++ start + reloc->r_offset + 2, end);
++ else
++ byte_put (start + reloc->r_offset, value, 4);
+ value = 0;
+ return TRUE;
+
+ case 0x43: /* R_RL78_ABS16. */
+- byte_put (start + reloc->r_offset, value, 2);
++ if (start + reloc->r_offset + 2 >= end)
++ error (_("RL78 sym diff reloc writes past end of section (%p vs %p)\n"),
++ start + reloc->r_offset + 2, end);
++ else
++ byte_put (start + reloc->r_offset, value, 2);
+ value = 0;
+ return TRUE;
+
+@@ -12074,7 +12094,7 @@ apply_relocations (void * file,
+
+ reloc_type = get_reloc_type (rp->r_info);
+
+- if (target_specific_reloc_handling (rp, start, symtab))
++ if (target_specific_reloc_handling (rp, start, end, symtab))
+ continue;
+ else if (is_none_reloc (reloc_type))
+ continue;
+--
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-6966.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-6966.patch
new file mode 100644
index 000000000..5e364ef69
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-6966.patch
@@ -0,0 +1,240 @@
+From 310e2cdc0a46ef62602097f5c21c393571e76df4 Mon Sep 17 00:00:00 2001
+From: Nick Clifton <nickc@redhat.com>
+Date: Mon, 13 Feb 2017 14:03:22 +0000
+Subject: [PATCH 2/2] Fix read-after-free error in readelf when processing
+ multiple, relocated sections in an MSP430 binary.
+
+ PR binutils/21139
+ * readelf.c (target_specific_reloc_handling): Add num_syms
+ parameter. Check for symbol table overflow before accessing
+ symbol value. If reloc pointer is NULL, discard all saved state.
+ (apply_relocations): Pass num_syms to target_specific_reloc_handling.
+ Call target_specific_reloc_handling with a NULL reloc pointer
+ after processing all of the relocs.
+
+(cherry pick from commit f84ce13b6708801ca1d6289b7c4003e2f5a6d7f9)
+Upstream-Status: Backport [master]
+CVE: CVE-2017-6966
+
+Signed-off-by: Yuanjie Huang <yuanjie.huang@windriver.com>
+---
+ binutils/ChangeLog | 10 +++++
+ binutils/readelf.c | 109 +++++++++++++++++++++++++++++++++++++++++------------
+ 2 files changed, 94 insertions(+), 25 deletions(-)
+
+diff --git a/binutils/ChangeLog b/binutils/ChangeLog
+index 154b797a29..aef0a51f19 100644
+--- a/binutils/ChangeLog
++++ b/binutils/ChangeLog
+@@ -1,5 +1,15 @@
+ 2017-02-13 Nick Clifton <nickc@redhat.com>
+
++ PR binutils/21139
++ * readelf.c (target_specific_reloc_handling): Add num_syms
++ parameter. Check for symbol table overflow before accessing
++ symbol value. If reloc pointer is NULL, discard all saved state.
++ (apply_relocations): Pass num_syms to target_specific_reloc_handling.
++ Call target_specific_reloc_handling with a NULL reloc pointer
++ after processing all of the relocs.
++
++2017-02-13 Nick Clifton <nickc@redhat.com>
++
+ PR binutils/21137
+ * readelf.c (target_specific_reloc_handling): Add end parameter.
+ Check for buffer overflow before writing relocated values.
+diff --git a/binutils/readelf.c b/binutils/readelf.c
+index 220671f76f..2b6cef1638 100644
+--- a/binutils/readelf.c
++++ b/binutils/readelf.c
+@@ -11340,15 +11340,27 @@ process_syminfo (FILE * file ATTRIBUTE_UNUSED)
+
+ /* Check to see if the given reloc needs to be handled in a target specific
+ manner. If so then process the reloc and return TRUE otherwise return
+- FALSE. */
++ FALSE.
++
++ If called with reloc == NULL, then this is a signal that reloc processing
++ for the current section has finished, and any saved state should be
++ discarded. */
+
+ static bfd_boolean
+ target_specific_reloc_handling (Elf_Internal_Rela * reloc,
+ unsigned char * start,
+ unsigned char * end,
+- Elf_Internal_Sym * symtab)
++ Elf_Internal_Sym * symtab,
++ unsigned long num_syms)
+ {
+- unsigned int reloc_type = get_reloc_type (reloc->r_info);
++ unsigned int reloc_type = 0;
++ unsigned long sym_index = 0;
++
++ if (reloc)
++ {
++ reloc_type = get_reloc_type (reloc->r_info);
++ sym_index = get_reloc_symindex (reloc->r_info);
++ }
+
+ switch (elf_header.e_machine)
+ {
+@@ -11357,13 +11369,24 @@ target_specific_reloc_handling (Elf_Internal_Rela * reloc,
+ {
+ static Elf_Internal_Sym * saved_sym = NULL;
+
++ if (reloc == NULL)
++ {
++ saved_sym = NULL;
++ return TRUE;
++ }
++
+ switch (reloc_type)
+ {
+ case 10: /* R_MSP430_SYM_DIFF */
+ if (uses_msp430x_relocs ())
+ break;
+ case 21: /* R_MSP430X_SYM_DIFF */
+- saved_sym = symtab + get_reloc_symindex (reloc->r_info);
++ /* PR 21139. */
++ if (sym_index >= num_syms)
++ error (_("MSP430 SYM_DIFF reloc contains invalid symbol index %lu\n"),
++ sym_index);
++ else
++ saved_sym = symtab + sym_index;
+ return TRUE;
+
+ case 1: /* R_MSP430_32 or R_MSP430_ABS32 */
+@@ -11388,16 +11411,21 @@ target_specific_reloc_handling (Elf_Internal_Rela * reloc,
+ int reloc_size = reloc_type == 1 ? 4 : 2;
+ bfd_vma value;
+
+- value = reloc->r_addend
+- + (symtab[get_reloc_symindex (reloc->r_info)].st_value
+- - saved_sym->st_value);
+-
+- if (start + reloc->r_offset + reloc_size >= end)
+- /* PR 21137 */
+- error (_("MSP430 sym diff reloc writes past end of section (%p vs %p)\n"),
+- start + reloc->r_offset + reloc_size, end);
++ if (sym_index >= num_syms)
++ error (_("MSP430 reloc contains invalid symbol index %lu\n"),
++ sym_index);
+ else
+- byte_put (start + reloc->r_offset, value, reloc_size);
++ {
++ value = reloc->r_addend + (symtab[sym_index].st_value
++ - saved_sym->st_value);
++
++ if (start + reloc->r_offset + reloc_size >= end)
++ /* PR 21137 */
++ error (_("MSP430 sym diff reloc writes past end of section (%p vs %p)\n"),
++ start + reloc->r_offset + reloc_size, end);
++ else
++ byte_put (start + reloc->r_offset, value, reloc_size);
++ }
+
+ saved_sym = NULL;
+ return TRUE;
+@@ -11417,13 +11445,24 @@ target_specific_reloc_handling (Elf_Internal_Rela * reloc,
+ {
+ static Elf_Internal_Sym * saved_sym = NULL;
+
++ if (reloc == NULL)
++ {
++ saved_sym = NULL;
++ return TRUE;
++ }
++
+ switch (reloc_type)
+ {
+ case 34: /* R_MN10300_ALIGN */
+ return TRUE;
+ case 33: /* R_MN10300_SYM_DIFF */
+- saved_sym = symtab + get_reloc_symindex (reloc->r_info);
++ if (sym_index >= num_syms)
++ error (_("MN10300_SYM_DIFF reloc contains invalid symbol index %lu\n"),
++ sym_index);
++ else
++ saved_sym = symtab + sym_index;
+ return TRUE;
++
+ case 1: /* R_MN10300_32 */
+ case 2: /* R_MN10300_16 */
+ if (saved_sym != NULL)
+@@ -11431,15 +11470,20 @@ target_specific_reloc_handling (Elf_Internal_Rela * reloc,
+ int reloc_size = reloc_type == 1 ? 4 : 2;
+ bfd_vma value;
+
+- value = reloc->r_addend
+- + (symtab[get_reloc_symindex (reloc->r_info)].st_value
+- - saved_sym->st_value);
+-
+- if (start + reloc->r_offset + reloc_size >= end)
+- error (_("MN10300 sym diff reloc writes past end of section (%p vs %p)\n"),
+- start + reloc->r_offset + reloc_size, end);
++ if (sym_index >= num_syms)
++ error (_("MN10300 reloc contains invalid symbol index %lu\n"),
++ sym_index);
+ else
+- byte_put (start + reloc->r_offset, value, reloc_size);
++ {
++ value = reloc->r_addend + (symtab[sym_index].st_value
++ - saved_sym->st_value);
++
++ if (start + reloc->r_offset + reloc_size >= end)
++ error (_("MN10300 sym diff reloc writes past end of section (%p vs %p)\n"),
++ start + reloc->r_offset + reloc_size, end);
++ else
++ byte_put (start + reloc->r_offset, value, reloc_size);
++ }
+
+ saved_sym = NULL;
+ return TRUE;
+@@ -11459,12 +11503,24 @@ target_specific_reloc_handling (Elf_Internal_Rela * reloc,
+ static bfd_vma saved_sym2 = 0;
+ static bfd_vma value;
+
++ if (reloc == NULL)
++ {
++ saved_sym1 = saved_sym2 = 0;
++ return TRUE;
++ }
++
+ switch (reloc_type)
+ {
+ case 0x80: /* R_RL78_SYM. */
+ saved_sym1 = saved_sym2;
+- saved_sym2 = symtab[get_reloc_symindex (reloc->r_info)].st_value;
+- saved_sym2 += reloc->r_addend;
++ if (sym_index >= num_syms)
++ error (_("RL78_SYM reloc contains invalid symbol index %lu\n"),
++ sym_index);
++ else
++ {
++ saved_sym2 = symtab[sym_index].st_value;
++ saved_sym2 += reloc->r_addend;
++ }
+ return TRUE;
+
+ case 0x83: /* R_RL78_OPsub. */
+@@ -12094,7 +12150,7 @@ apply_relocations (void * file,
+
+ reloc_type = get_reloc_type (rp->r_info);
+
+- if (target_specific_reloc_handling (rp, start, end, symtab))
++ if (target_specific_reloc_handling (rp, start, end, symtab, num_syms))
+ continue;
+ else if (is_none_reloc (reloc_type))
+ continue;
+@@ -12190,6 +12246,9 @@ apply_relocations (void * file,
+ }
+
+ free (symtab);
++ /* Let the target specific reloc processing code know that
++ we have finished with these relocs. */
++ target_specific_reloc_handling (NULL, NULL, NULL, NULL, 0);
+
+ if (relocs_return)
+ {
+--
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-6969.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-6969.patch
new file mode 100644
index 000000000..3d036c4cf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-6969.patch
@@ -0,0 +1,56 @@
+From 489246368e2c49a795ad5ecbc8895cbc854292fa Mon Sep 17 00:00:00 2001
+From: Nick Clifton <nickc@redhat.com>
+Date: Fri, 17 Feb 2017 15:59:45 +0000
+Subject: Fix illegal memory accesses in readelf when parsing a corrupt binary.
+
+ PR binutils/21156
+ * readelf.c (find_section_in_set): Test for invalid section
+ indicies.
+
+CVE: CVE-2017-6969
+Upstream-Status: Backport [master]
+
+Signed-off-by: Yuanjie Huang <yuanjie.huang@windriver.com>
+---
+ binutils/ChangeLog | 6 ++++++
+ binutils/readelf.c | 10 ++++++++--
+ 2 files changed, 14 insertions(+), 2 deletions(-)
+
+diff --git a/binutils/ChangeLog b/binutils/ChangeLog
+index a70bdb7a7b..dbf8eb079e 100644
+--- a/binutils/ChangeLog
++++ b/binutils/ChangeLog
+@@ -1,3 +1,9 @@
++2017-02-17 Nick Clifton <nickc@redhat.com>
++
++ PR binutils/21156
++ * readelf.c (find_section_in_set): Test for invalid section
++ indicies.
++
+ 2016-08-03 Tristan Gingold <gingold@adacore.com>
+
+ * configure: Regenerate.
+diff --git a/binutils/readelf.c b/binutils/readelf.c
+index d31558c3b4..7f7365dbc5 100644
+--- a/binutils/readelf.c
++++ b/binutils/readelf.c
+@@ -674,8 +674,14 @@ find_section_in_set (const char * name, unsigned int * set)
+ if (set != NULL)
+ {
+ while ((i = *set++) > 0)
+- if (streq (SECTION_NAME (section_headers + i), name))
+- return section_headers + i;
++ {
++ /* See PR 21156 for a reproducer. */
++ if (i >= elf_header.e_shnum)
++ continue; /* FIXME: Should we issue an error message ? */
++
++ if (streq (SECTION_NAME (section_headers + i), name))
++ return section_headers + i;
++ }
+ }
+
+ return find_section (name);
+--
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-6969_2.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-6969_2.patch
new file mode 100644
index 000000000..491c7086e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-6969_2.patch
@@ -0,0 +1,122 @@
+From 59fcd64fe65a89fb0acaf5463840310701189375 Mon Sep 17 00:00:00 2001
+From: Nick Clifton <nickc@redhat.com>
+Date: Mon, 20 Feb 2017 14:40:39 +0000
+Subject: Fix another memory access error in readelf when parsing a corrupt
+ binary.
+
+ PR binutils/21156
+ * dwarf.c (cu_tu_indexes_read): Move into...
+ (load_cu_tu_indexes): ... here. Change the variable into
+ tri-state. Change the function into boolean, returning
+ false if the indicies could not be loaded.
+ (find_cu_tu_set): Return NULL if the indicies could not be
+ loaded.
+
+CVE: CVE-2017-6969
+Upstream-Status: Backport [master]
+
+Signed-off-by: Yuanjie Huang <yuanjie.huang@windriver.com>
+---
+ binutils/ChangeLog | 10 ++++++++++
+ binutils/dwarf.c | 34 ++++++++++++++++++++--------------
+ 2 files changed, 30 insertions(+), 14 deletions(-)
+
+diff --git a/binutils/ChangeLog b/binutils/ChangeLog
+index dbf8eb079e..55d2f8ba40 100644
+--- a/binutils/ChangeLog
++++ b/binutils/ChangeLog
+@@ -1,3 +1,13 @@
++2017-02-20 Nick Clifton <nickc@redhat.com>
++
++ PR binutils/21156
++ * dwarf.c (cu_tu_indexes_read): Move into...
++ (load_cu_tu_indexes): ... here. Change the variable into
++ tri-state. Change the function into boolean, returning
++ false if the indicies could not be loaded.
++ (find_cu_tu_set): Return NULL if the indicies could not be
++ loaded.
++
+ 2017-02-17 Nick Clifton <nickc@redhat.com>
+
+ PR binutils/21156
+diff --git a/binutils/dwarf.c b/binutils/dwarf.c
+index 282e069958..a23267feb6 100644
+--- a/binutils/dwarf.c
++++ b/binutils/dwarf.c
+@@ -76,7 +76,6 @@ int dwarf_check = 0;
+ as a zero-terminated list of section indexes comprising one set of debug
+ sections from a .dwo file. */
+
+-static int cu_tu_indexes_read = 0;
+ static unsigned int *shndx_pool = NULL;
+ static unsigned int shndx_pool_size = 0;
+ static unsigned int shndx_pool_used = 0;
+@@ -99,7 +98,7 @@ static int tu_count = 0;
+ static struct cu_tu_set *cu_sets = NULL;
+ static struct cu_tu_set *tu_sets = NULL;
+
+-static void load_cu_tu_indexes (void *file);
++static bfd_boolean load_cu_tu_indexes (void *);
+
+ /* Values for do_debug_lines. */
+ #define FLAG_DEBUG_LINES_RAW 1
+@@ -2713,7 +2712,7 @@ load_debug_info (void * file)
+ return num_debug_info_entries;
+
+ /* If this is a DWARF package file, load the CU and TU indexes. */
+- load_cu_tu_indexes (file);
++ (void) load_cu_tu_indexes (file);
+
+ if (load_debug_section (info, file)
+ && process_debug_info (&debug_displays [info].section, file, abbrev, 1, 0))
+@@ -7302,21 +7301,27 @@ process_cu_tu_index (struct dwarf_section *section, int do_display)
+ section sets that we can use to associate a .debug_info.dwo section
+ with its associated .debug_abbrev.dwo section in a .dwp file. */
+
+-static void
++static bfd_boolean
+ load_cu_tu_indexes (void *file)
+ {
++ static int cu_tu_indexes_read = -1; /* Tri-state variable. */
++
+ /* If we have already loaded (or tried to load) the CU and TU indexes
+ then do not bother to repeat the task. */
+- if (cu_tu_indexes_read)
+- return;
+-
+- if (load_debug_section (dwp_cu_index, file))
+- process_cu_tu_index (&debug_displays [dwp_cu_index].section, 0);
+-
+- if (load_debug_section (dwp_tu_index, file))
+- process_cu_tu_index (&debug_displays [dwp_tu_index].section, 0);
++ if (cu_tu_indexes_read == -1)
++ {
++ cu_tu_indexes_read = TRUE;
++
++ if (load_debug_section (dwp_cu_index, file))
++ if (! process_cu_tu_index (&debug_displays [dwp_cu_index].section, 0))
++ cu_tu_indexes_read = FALSE;
++
++ if (load_debug_section (dwp_tu_index, file))
++ if (! process_cu_tu_index (&debug_displays [dwp_tu_index].section, 0))
++ cu_tu_indexes_read = FALSE;
++ }
+
+- cu_tu_indexes_read = 1;
++ return (bfd_boolean) cu_tu_indexes_read;
+ }
+
+ /* Find the set of sections that includes section SHNDX. */
+@@ -7326,7 +7331,8 @@ find_cu_tu_set (void *file, unsigned int shndx)
+ {
+ unsigned int i;
+
+- load_cu_tu_indexes (file);
++ if (! load_cu_tu_indexes (file))
++ return NULL;
+
+ /* Find SHNDX in the shndx pool. */
+ for (i = 0; i < shndx_pool_used; i++)
+--
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-7209.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-7209.patch
new file mode 100644
index 000000000..336d72cfe
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-7209.patch
@@ -0,0 +1,63 @@
+From 6e5e9d96b5bd7dc3147db9917d6a7a20682915cc Mon Sep 17 00:00:00 2001
+From: Nick Clifton <nickc@redhat.com>
+Date: Mon, 13 Feb 2017 15:04:37 +0000
+Subject: Fix invalid read of section contents whilst processing a corrupt
+ binary.
+
+ PR binutils/21135
+ * readelf.c (dump_section_as_bytes): Handle the case where
+ uncompress_section_contents returns false.
+
+CVE: CVE-2017-7209
+Upstream-Status: Backport[master]
+
+Signed-off-by: Yuanjie Huang <yuanjie.huang@windriver.com>
+---
+ binutils/ChangeLog | 6 ++++++
+ binutils/readelf.c | 16 ++++++++++++----
+ 2 files changed, 18 insertions(+), 4 deletions(-)
+
+diff --git a/binutils/ChangeLog b/binutils/ChangeLog
+index 55d2f8ba40..c4d8e60eca 100644
+--- a/binutils/ChangeLog
++++ b/binutils/ChangeLog
+@@ -1,3 +1,9 @@
++2017-02-13 Nick Clifton <nickc@redhat.com>
++
++ PR binutils/21135
++ * readelf.c (dump_section_as_bytes): Handle the case where
++ uncompress_section_contents returns false.
++
+ 2017-02-20 Nick Clifton <nickc@redhat.com>
+
+ PR binutils/21156
+diff --git a/binutils/readelf.c b/binutils/readelf.c
+index 7f7365dbc5..bc4e92fa81 100644
+--- a/binutils/readelf.c
++++ b/binutils/readelf.c
+@@ -12473,10 +12473,18 @@ dump_section_as_bytes (Elf_Internal_Shdr * section,
+ new_size -= 12;
+ }
+
+- if (uncompressed_size
+- && uncompress_section_contents (& start, uncompressed_size,
+- & new_size))
+- section_size = new_size;
++ if (uncompressed_size)
++ {
++ if (uncompress_section_contents (& start, uncompressed_size,
++ & new_size))
++ section_size = new_size;
++ else
++ {
++ error (_("Unable to decompress section %s\n"),
++ printable_section_name (section));
++ return;
++ }
++ }
+ }
+
+ if (relocate)
+--
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-7210.patch b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-7210.patch
new file mode 100644
index 000000000..211d2bfd8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/binutils/binutils/CVE-2017-7210.patch
@@ -0,0 +1,71 @@
+From 80958b04c91edcd41c42807225a7ad1b2a4ce0e6 Mon Sep 17 00:00:00 2001
+From: Nick Clifton <nickc@redhat.com>
+Date: Tue, 14 Feb 2017 14:07:29 +0000
+Subject: Fix handling of corrupt STABS enum type strings.
+
+ PR binutils/21157
+ * stabs.c (parse_stab_enum_type): Check for corrupt NAME:VALUE
+ pairs.
+ (parse_number): Exit early if passed an empty string.
+
+CVE: CVE-2017-7210
+Upstream-Status: Backport [master]
+
+Signed-off-by: Yuanjie Huang <yuanjie.huang@windriver.com>
+---
+ binutils/ChangeLog | 7 +++++++
+ binutils/stabs.c | 14 +++++++++++++-
+ 2 files changed, 20 insertions(+), 1 deletion(-)
+
+diff --git a/binutils/ChangeLog b/binutils/ChangeLog
+index c4d8e60eca..2bae9ec587 100644
+--- a/binutils/ChangeLog
++++ b/binutils/ChangeLog
+@@ -1,3 +1,10 @@
++2017-02-14 Nick Clifton <nickc@redhat.com>
++
++ PR binutils/21157
++ * stabs.c (parse_stab_enum_type): Check for corrupt NAME:VALUE
++ pairs.
++ (parse_number): Exit early if passed an empty string.
++
+ 2017-02-13 Nick Clifton <nickc@redhat.com>
+
+ PR binutils/21135
+diff --git a/binutils/stabs.c b/binutils/stabs.c
+index aebde7afe9..c425afe98e 100644
+--- a/binutils/stabs.c
++++ b/binutils/stabs.c
+@@ -232,6 +232,10 @@ parse_number (const char **pp, bfd_boolean *poverflow)
+
+ orig = *pp;
+
++ /* Stop early if we are passed an empty string. */
++ if (*orig == 0)
++ return (bfd_vma) 0;
++
+ errno = 0;
+ ul = strtoul (*pp, (char **) pp, 0);
+ if (ul + 1 != 0 || errno == 0)
+@@ -1975,9 +1979,17 @@ parse_stab_enum_type (void *dhandle, const char **pp)
+ bfd_signed_vma val;
+
+ p = *pp;
+- while (*p != ':')
++ while (*p != ':' && *p != 0)
+ ++p;
+
++ if (*p == 0)
++ {
++ bad_stab (orig);
++ free (names);
++ free (values);
++ return DEBUG_TYPE_NULL;
++ }
++
+ name = savestring (*pp, p - *pp);
+
+ *pp = p + 1;
+--
+2.11.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/docbook-utils/docbook-utils-native_0.6.14.bb b/import-layers/yocto-poky/meta/recipes-devtools/docbook-utils/docbook-utils-native_0.6.14.bb
index c3a5f3b42..44b43a810 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/docbook-utils/docbook-utils-native_0.6.14.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/docbook-utils/docbook-utils-native_0.6.14.bb
@@ -10,7 +10,7 @@ DEPENDS = "openjade-native sgmlspl-native docbook-dsssl-stylesheets-native docbo
PR = "r3"
SRC_URI = "\
- ftp://sources.redhat.com/pub/docbook-tools/new-trials/SOURCES/docbook-utils-${PV}.tar.gz \
+ http://ftp.osuosl.org/pub/blfs/conglomeration/docbook-utils/docbook-utils-${PV}.tar.gz \
file://re.patch \
"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-e2fsck-exit-with-exit-status-0-if-no-errors-were-fix.patch b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-e2fsck-exit-with-exit-status-0-if-no-errors-were-fix.patch
new file mode 100644
index 000000000..44f3888b1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-e2fsck-exit-with-exit-status-0-if-no-errors-were-fix.patch
@@ -0,0 +1,285 @@
+From b9bb77a0dd712f06b262a12766972b99cd801269 Mon Sep 17 00:00:00 2001
+From: Theodore Ts'o <tytso@mit.edu>
+Date: Thu, 16 Feb 2017 22:02:35 -0500
+Subject: [PATCH] e2fsck: exit with exit status 0 if no errors were fixed
+
+Previously, e2fsck would exit with a status code of 1 even though the
+only changes that it made to the file system were various
+optimziations and not fixing file system corruption. Since the man
+page states that an exit status of 1 means "file system errors
+corrupted", fix e2fsck to return an exit status of 0.
+
+Upstream-Status: Backport
+
+Signed-off-by: Theodore Ts'o <tytso@mit.edu>
+Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
+
+Conflicts:
+ e2fsck/e2fsck.conf.5.in
+---
+ e2fsck/e2fsck.conf.5.in | 34 +++++++++++++++++++++++++++++
+ e2fsck/journal.c | 1 +
+ e2fsck/problem.c | 8 ++++---
+ e2fsck/problemP.h | 1 +
+ e2fsck/unix.c | 20 +++++++++++++----
+ tests/f_collapse_extent_tree/expect.1 | 2 +-
+ tests/f_compress_extent_tree_level/expect.1 | 2 +-
+ tests/f_convert_bmap/expect.1 | 2 +-
+ tests/f_convert_bmap_and_extent/expect.1 | 2 +-
+ tests/f_extent_htree/expect.1 | 2 +-
+ tests/f_jnl_errno/expect.1 | 2 +-
+ tests/f_journal/expect.1 | 2 +-
+ tests/f_orphan/expect.1 | 2 +-
+ tests/f_orphan_extents_inode/expect.1 | 2 +-
+ tests/f_rehash_dir/expect.1 | 2 +-
+ tests/f_unsorted_EAs/expect.1 | 2 +-
+ 16 files changed, 68 insertions(+), 18 deletions(-)
+
+diff --git a/e2fsck/e2fsck.conf.5.in b/e2fsck/e2fsck.conf.5.in
+index 1f80a04..6a205ce 100644
+--- a/e2fsck/e2fsck.conf.5.in
++++ b/e2fsck/e2fsck.conf.5.in
+@@ -326,6 +326,40 @@ defaults to true.
+ This relation controls whether or not the scratch file directory is used
+ instead of an in-memory data structure when tracking inode counts. It
+ defaults to true.
++.TP
++.I not_a_fix
++This boolean option, it set to true, marks the problem as
++one where if the user gives permission to make the requested change,
++it does not mean that the file system had a problem which has since
++been fixed. This is used for requests to optimize the file system's
++data structure, such as pruning an extent tree.
++@TDB_MAN_COMMENT@.SH THE [scratch_files] STANZA
++@TDB_MAN_COMMENT@The following relations are defined in the
++@TDB_MAN_COMMENT@.I [scratch_files]
++@TDB_MAN_COMMENT@stanza.
++@TDB_MAN_COMMENT@.TP
++@TDB_MAN_COMMENT@.I directory
++@TDB_MAN_COMMENT@If the directory named by this relation exists and is
++@TDB_MAN_COMMENT@writeable, then e2fsck will attempt to use this
++@TDB_MAN_COMMENT@directory to store scratch files instead of using
++@TDB_MAN_COMMENT@in-memory data structures.
++@TDB_MAN_COMMENT@.TP
++@TDB_MAN_COMMENT@.I numdirs_threshold
++@TDB_MAN_COMMENT@If this relation is set, then in-memory data structures
++@TDB_MAN_COMMENT@be used if the number of directories in the filesystem
++@TDB_MAN_COMMENT@are fewer than amount specified.
++@TDB_MAN_COMMENT@.TP
++@TDB_MAN_COMMENT@.I dirinfo
++@TDB_MAN_COMMENT@This relation controls whether or not the scratch file
++@TDB_MAN_COMMENT@directory is used instead of an in-memory data
++@TDB_MAN_COMMENT@structure for directory information. It defaults to
++@TDB_MAN_COMMENT@true.
++@TDB_MAN_COMMENT@.TP
++@TDB_MAN_COMMENT@.I icount
++@TDB_MAN_COMMENT@This relation controls whether or not the scratch file
++@TDB_MAN_COMMENT@directory is used instead of an in-memory data
++@TDB_MAN_COMMENT@structure when tracking inode counts. It defaults to
++@TDB_MAN_COMMENT@true.
+ .SH LOGGING
+ E2fsck has the facility to save the information from an e2fsck run in a
+ directory so that a system administrator can review its output at their
+diff --git a/e2fsck/journal.c b/e2fsck/journal.c
+index c8ac57d..b4cf329 100644
+--- a/e2fsck/journal.c
++++ b/e2fsck/journal.c
+@@ -572,6 +572,7 @@ static void clear_v2_journal_fields(journal_t *journal)
+ if (!fix_problem(ctx, PR_0_CLEAR_V2_JOURNAL, &pctx))
+ return;
+
++ ctx->flags |= E2F_FLAG_PROBLEMS_FIXED;
+ memset(((char *) journal->j_superblock) + V1_SB_SIZE, 0,
+ ctx->fs->blocksize-V1_SB_SIZE);
+ mark_buffer_dirty(journal->j_sb_buffer);
+diff --git a/e2fsck/problem.c b/e2fsck/problem.c
+index 1e645e4..2b01ffc 100644
+--- a/e2fsck/problem.c
++++ b/e2fsck/problem.c
+@@ -1261,12 +1261,12 @@ static struct e2fsck_problem problem_table[] = {
+ /* Inode extent tree could be shorter */
+ { PR_1E_CAN_COLLAPSE_EXTENT_TREE,
+ N_("@i %i @x tree (at level %b) could be shorter. "),
+- PROMPT_FIX, PR_NO_OK | PR_PREEN_NO | PR_PREEN_OK },
++ PROMPT_FIX, PR_NO_OK | PR_PREEN_NO | PR_PREEN_OK | PR_NOT_A_FIX },
+
+ /* Inode extent tree could be narrower */
+ { PR_1E_CAN_NARROW_EXTENT_TREE,
+ N_("@i %i @x tree (at level %b) could be narrower. "),
+- PROMPT_FIX, PR_NO_OK | PR_PREEN_NO | PR_PREEN_OK },
++ PROMPT_FIX, PR_NO_OK | PR_PREEN_NO | PR_PREEN_OK | PR_NOT_A_FIX },
+
+ /* Pass 2 errors */
+
+@@ -2146,6 +2146,7 @@ int fix_problem(e2fsck_t ctx, problem_t code, struct problem_context *pctx)
+ reconfigure_bool(ctx, ptr, key, PR_NO_NOMSG, "no_nomsg");
+ reconfigure_bool(ctx, ptr, key, PR_PREEN_NOHDR, "preen_noheader");
+ reconfigure_bool(ctx, ptr, key, PR_FORCE_NO, "force_no");
++ reconfigure_bool(ctx, ptr, key, PR_NOT_A_FIX, "not_a_fix");
+ profile_get_integer(ctx->profile, "options",
+ "max_count_problems", 0, 0,
+ &ptr->max_count);
+@@ -2263,7 +2264,8 @@ int fix_problem(e2fsck_t ctx, problem_t code, struct problem_context *pctx)
+ if (ptr->flags & PR_AFTER_CODE)
+ answer = fix_problem(ctx, ptr->second_code, pctx);
+
+- if (answer && (ptr->prompt != PROMPT_NONE))
++ if (answer && (ptr->prompt != PROMPT_NONE) &&
++ !(ptr->flags & PR_NOT_A_FIX))
+ ctx->flags |= E2F_FLAG_PROBLEMS_FIXED;
+
+ return answer;
+diff --git a/e2fsck/problemP.h b/e2fsck/problemP.h
+index 7944cd6..63bb8df 100644
+--- a/e2fsck/problemP.h
++++ b/e2fsck/problemP.h
+@@ -44,3 +44,4 @@ struct latch_descr {
+ #define PR_CONFIG 0x080000 /* This problem has been customized
+ from the config file */
+ #define PR_FORCE_NO 0x100000 /* Force the answer to be no */
++#define PR_NOT_A_FIX 0x200000 /* Yes doesn't mean a problem was fixed */
+diff --git a/e2fsck/unix.c b/e2fsck/unix.c
+index 004a6e5..d33d7fd 100644
+--- a/e2fsck/unix.c
++++ b/e2fsck/unix.c
+@@ -1896,11 +1896,23 @@ no_journal:
+ fix_problem(ctx, PR_6_IO_FLUSH, &pctx);
+
+ if (was_changed) {
+- exit_value |= FSCK_NONDESTRUCT;
+- if (!(ctx->options & E2F_OPT_PREEN))
+- log_out(ctx, _("\n%s: ***** FILE SYSTEM WAS "
+- "MODIFIED *****\n"),
++ int fs_fixed = (ctx->flags & E2F_FLAG_PROBLEMS_FIXED);
++
++ if (fs_fixed)
++ exit_value |= FSCK_NONDESTRUCT;
++ if (!(ctx->options & E2F_OPT_PREEN)) {
++#if 0 /* Do this later; it breaks too many tests' golden outputs */
++ log_out(ctx, fs_fixed ?
++ _("\n%s: ***** FILE SYSTEM ERRORS "
++ "CORRECTED *****\n") :
++ _("%s: File system was modified.\n"),
+ ctx->device_name);
++#else
++ log_out(ctx,
++ _("\n%s: ***** FILE SYSTEM WAS MODIFIED *****\n"),
++ ctx->device_name);
++#endif
++ }
+ if (ctx->mount_flags & EXT2_MF_ISROOT) {
+ log_out(ctx, _("%s: ***** REBOOT SYSTEM *****\n"),
+ ctx->device_name);
+diff --git a/tests/f_collapse_extent_tree/expect.1 b/tests/f_collapse_extent_tree/expect.1
+index e2eb65e..8165a58 100644
+--- a/tests/f_collapse_extent_tree/expect.1
++++ b/tests/f_collapse_extent_tree/expect.1
+@@ -13,4 +13,4 @@ Pass 5: Checking group summary information
+
+ test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
+ test_filesys: 12/128 files (0.0% non-contiguous), 19/512 blocks
+-Exit status is 1
++Exit status is 0
+diff --git a/tests/f_compress_extent_tree_level/expect.1 b/tests/f_compress_extent_tree_level/expect.1
+index a359c99..dd33f63 100644
+--- a/tests/f_compress_extent_tree_level/expect.1
++++ b/tests/f_compress_extent_tree_level/expect.1
+@@ -20,4 +20,4 @@ Pass 5: Checking group summary information
+
+ test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
+ test_filesys: 12/128 files (8.3% non-contiguous), 26/512 blocks
+-Exit status is 1
++Exit status is 0
+diff --git a/tests/f_convert_bmap/expect.1 b/tests/f_convert_bmap/expect.1
+index 7d2ca86..c387962 100644
+--- a/tests/f_convert_bmap/expect.1
++++ b/tests/f_convert_bmap/expect.1
+@@ -23,4 +23,4 @@ Pass 5: Checking group summary information
+
+ test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
+ test_filesys: 12/128 files (8.3% non-contiguous), 570/2048 blocks
+-Exit status is 1
++Exit status is 0
+diff --git a/tests/f_convert_bmap_and_extent/expect.1 b/tests/f_convert_bmap_and_extent/expect.1
+index 7af91aa..c86c571 100644
+--- a/tests/f_convert_bmap_and_extent/expect.1
++++ b/tests/f_convert_bmap_and_extent/expect.1
+@@ -30,4 +30,4 @@ Pass 5: Checking group summary information
+
+ test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
+ test_filesys: 13/128 files (15.4% non-contiguous), 574/2048 blocks
+-Exit status is 1
++Exit status is 0
+diff --git a/tests/f_extent_htree/expect.1 b/tests/f_extent_htree/expect.1
+index 223ca69..ea48405 100644
+--- a/tests/f_extent_htree/expect.1
++++ b/tests/f_extent_htree/expect.1
+@@ -26,4 +26,4 @@ test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
+ 0 sockets
+ ------------
+ 343 files
+-Exit status is 1
++Exit status is 0
+diff --git a/tests/f_jnl_errno/expect.1 b/tests/f_jnl_errno/expect.1
+index c572951..4134234 100644
+--- a/tests/f_jnl_errno/expect.1
++++ b/tests/f_jnl_errno/expect.1
+@@ -6,4 +6,4 @@ Pass 5: Checking group summary information
+
+ test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
+ test_filesys: 11/2048 files (9.1% non-contiguous), 1330/8192 blocks
+-Exit status is 1
++Exit status is 0
+diff --git a/tests/f_journal/expect.1 b/tests/f_journal/expect.1
+index a202c80..0a18654 100644
+--- a/tests/f_journal/expect.1
++++ b/tests/f_journal/expect.1
+@@ -59,4 +59,4 @@ Pass 5: Checking group summary information
+
+ test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
+ test_filesys: 53/2048 files (1.9% non-contiguous), 1409/8192 blocks
+-Exit status is 1
++Exit status is 0
+diff --git a/tests/f_orphan/expect.1 b/tests/f_orphan/expect.1
+index eddc1f8..087ebee 100644
+--- a/tests/f_orphan/expect.1
++++ b/tests/f_orphan/expect.1
+@@ -11,4 +11,4 @@ Pass 5: Checking group summary information
+
+ test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
+ test_filesys: 12/2048 files (0.0% non-contiguous), 1303/8192 blocks
+-Exit status is 1
++Exit status is 0
+diff --git a/tests/f_orphan_extents_inode/expect.1 b/tests/f_orphan_extents_inode/expect.1
+index 2eaab78..5d713b3 100644
+--- a/tests/f_orphan_extents_inode/expect.1
++++ b/tests/f_orphan_extents_inode/expect.1
+@@ -7,4 +7,4 @@ Pass 5: Checking group summary information
+
+ test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
+ test_filesys: 12/16 files (0.0% non-contiguous), 21/100 blocks
+-Exit status is 1
++Exit status is 0
+diff --git a/tests/f_rehash_dir/expect.1 b/tests/f_rehash_dir/expect.1
+index 6076765..c1449ba 100644
+--- a/tests/f_rehash_dir/expect.1
++++ b/tests/f_rehash_dir/expect.1
+@@ -7,4 +7,4 @@ Pass 5: Checking group summary information
+
+ test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
+ test_filesys: 105/2048 files (2.9% non-contiguous), 336/512 blocks
+-Exit status is 1
++Exit status is 0
+diff --git a/tests/f_unsorted_EAs/expect.1 b/tests/f_unsorted_EAs/expect.1
+index 7d588d7..64b9045 100644
+--- a/tests/f_unsorted_EAs/expect.1
++++ b/tests/f_unsorted_EAs/expect.1
+@@ -8,4 +8,4 @@ Pass 5: Checking group summary information
+
+ test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
+ test_filesys: 12/2048 files (0.0% non-contiguous), 1294/2048 blocks
+-Exit status is 1
++Exit status is 0
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/mkdir_p.patch b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/mkdir_p.patch
new file mode 100644
index 000000000..b0fa4b8cc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/mkdir_p.patch
@@ -0,0 +1,20 @@
+e2fsprogs: expand @mkdir_p@
+
+Add AC_SUBST to configure.ac. @mkdir_p@ is currently
+not expanded so no locale data is written into usr/share/locale.
+
+Upstream-Status: Pending
+
+Signed-off-by: Joe Slater <jslater@windriver.com>
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -811,6 +811,8 @@ AC_SUBST(PACKAGE)
+ AC_SUBST(VERSION)
+
+ AM_GNU_GETTEXT
++dnl @MKDIR_P@ is expanded in AM_GNU_GETTEXT
++AC_SUBST([mkdir_p],['$(MKDIR_P)'])
+ dnl
+ dnl End of configuration options
+ dnl
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.43.bb b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.43.bb
index f4855bc43..dcfb564a4 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.43.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.43.bb
@@ -9,6 +9,8 @@ SRC_URI += "file://acinclude.m4 \
file://ptest.patch \
file://mkdir.patch \
file://Revert-mke2fs-enable-the-metadata_csum-and-64bit-fea.patch \
+ file://mkdir_p.patch \
+ file://0001-e2fsck-exit-with-exit-status-0-if-no-errors-were-fix.patch \
"
SRC_URI_append_class-native = " file://e2fsprogs-fix-missing-check-for-permission-denied.patch"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/0001-Add-GCC7-Wimplicit-fallthrough-support-fixes.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/0001-Add-GCC7-Wimplicit-fallthrough-support-fixes.patch
new file mode 100644
index 000000000..a240323f3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/0001-Add-GCC7-Wimplicit-fallthrough-support-fixes.patch
@@ -0,0 +1,318 @@
+From 09949994e76eea3c1230a5c88ffa8fdf588b120f Mon Sep 17 00:00:00 2001
+From: Mark Wielaard <mjw@redhat.com>
+Date: Wed, 2 Nov 2016 13:29:26 +0100
+Subject: [PATCH] Add GCC7 -Wimplicit-fallthrough support/fixes.
+
+GCC7 will have a new -Wimplicit-fallthrough warning. It did catch one
+small buglet in elflint option procession. So it seems useful to enable
+to make sure all swatch case fallthroughs are deliberate.
+
+Add configure check to detect whether gcc support -Wimplicit-fallthrough
+and enable it. Add fixes and explicit fallthrough comments where necessary.
+
+Signed-off-by: Mark Wielaard <mjw@redhat.com>
+
+Upstream-Status: Backport
+Upstream-Commit: a3cc8182b2ae05290b0eafa74b70746d7befc0e4
+---
+ backends/alpha_retval.c | 4 +---
+ backends/i386_regs.c | 1 +
+ backends/i386_retval.c | 3 +--
+ backends/linux-core-note.c | 4 ++--
+ backends/ppc_regs.c | 2 +-
+ backends/x86_64_regs.c | 1 +
+ config/eu.am | 8 +++++++-
+ configure.ac | 10 ++++++++++
+ libcpu/i386_disasm.c | 2 +-
+ libdw/cfi.c | 2 ++
+ libdw/encoded-value.h | 1 +
+ libdwfl/dwfl_report_elf.c | 2 +-
+ src/addr2line.c | 1 +
+ src/elfcompress.c | 3 ++-
+ src/elflint.c | 4 +++-
+ src/objdump.c | 4 +++-
+ tests/backtrace-data.c | 1 +
+ tests/backtrace.c | 2 +-
+ 18 files changed, 40 insertions(+), 15 deletions(-)
+
+diff --git a/backends/alpha_retval.c b/backends/alpha_retval.c
+index 53dbfa45..7232b462 100644
+--- a/backends/alpha_retval.c
++++ b/backends/alpha_retval.c
+@@ -130,9 +130,7 @@ alpha_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
+ return nloc_intreg;
+ }
+ }
+-
+- /* Else fall through. */
+-
++ /* Fallthrough */
+ case DW_TAG_structure_type:
+ case DW_TAG_class_type:
+ case DW_TAG_union_type:
+diff --git a/backends/i386_regs.c b/backends/i386_regs.c
+index fb8ded33..fd963a62 100644
+--- a/backends/i386_regs.c
++++ b/backends/i386_regs.c
+@@ -92,6 +92,7 @@ i386_register_info (Ebl *ebl __attribute__ ((unused)),
+ case 5:
+ case 8:
+ *type = DW_ATE_address;
++ /* Fallthrough */
+ case 0 ... 3:
+ case 6 ... 7:
+ name[0] = 'e';
+diff --git a/backends/i386_retval.c b/backends/i386_retval.c
+index 9da797d5..4aa646fe 100644
+--- a/backends/i386_retval.c
++++ b/backends/i386_retval.c
+@@ -122,9 +122,8 @@ i386_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
+ return nloc_intreg;
+ if (size <= 8)
+ return nloc_intregpair;
+-
+- /* Else fall through. */
+ }
++ /* Fallthrough */
+
+ case DW_TAG_structure_type:
+ case DW_TAG_class_type:
+diff --git a/backends/linux-core-note.c b/backends/linux-core-note.c
+index ff2b226f..321721f3 100644
+--- a/backends/linux-core-note.c
++++ b/backends/linux-core-note.c
+@@ -219,8 +219,8 @@ EBLHOOK(core_note) (const GElf_Nhdr *nhdr, const char *name,
+ case sizeof "CORE":
+ if (memcmp (name, "CORE", nhdr->n_namesz) == 0)
+ break;
+- /* Buggy old Linux kernels didn't terminate "LINUX".
+- Fall through. */
++ /* Buggy old Linux kernels didn't terminate "LINUX". */
++ /* Fall through. */
+
+ case sizeof "LINUX":
+ if (memcmp (name, "LINUX", nhdr->n_namesz) == 0)
+diff --git a/backends/ppc_regs.c b/backends/ppc_regs.c
+index 4b92a9aa..bcf4f7a3 100644
+--- a/backends/ppc_regs.c
++++ b/backends/ppc_regs.c
+@@ -140,7 +140,7 @@ ppc_register_info (Ebl *ebl __attribute__ ((unused)),
+ case 100:
+ if (*bits == 32)
+ return stpcpy (name, "mq") + 1 - name;
+-
++ /* Fallthrough */
+ case 102 ... 107:
+ name[0] = 's';
+ name[1] = 'p';
+diff --git a/backends/x86_64_regs.c b/backends/x86_64_regs.c
+index 2172d9f1..84304407 100644
+--- a/backends/x86_64_regs.c
++++ b/backends/x86_64_regs.c
+@@ -87,6 +87,7 @@ x86_64_register_info (Ebl *ebl __attribute__ ((unused)),
+
+ case 6 ... 7:
+ *type = DW_ATE_address;
++ /* Fallthrough */
+ case 0 ... 5:
+ name[0] = 'r';
+ name[1] = baseregs[regno][0];
+diff --git a/config/eu.am b/config/eu.am
+index 4998771d..8fe1e259 100644
+--- a/config/eu.am
++++ b/config/eu.am
+@@ -61,10 +61,16 @@ else
+ NULL_DEREFERENCE_WARNING=
+ endif
+
++if HAVE_IMPLICIT_FALLTHROUGH_WARNING
++IMPLICIT_FALLTHROUGH_WARNING=-Wimplicit-fallthrough
++else
++IMPLICIT_FALLTHROUGH_WARNING=
++endif
++
+ AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 \
+ -Wold-style-definition -Wstrict-prototypes \
+ $(LOGICAL_OP_WARNING) $(DUPLICATED_COND_WARNING) \
+- $(NULL_DEREFERENCE_WARNING) \
++ $(NULL_DEREFERENCE_WARNING) $(IMPLICIT_FALLTHROUGH_WARNING) \
+ $(if $($(*F)_no_Werror),,-Werror) \
+ $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
+ $(if $($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \
+diff --git a/configure.ac b/configure.ac
+index 86a69c66..35850c64 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -336,6 +336,16 @@ CFLAGS="$old_CFLAGS"])
+ AM_CONDITIONAL(HAVE_NULL_DEREFERENCE_WARNING,
+ [test "x$ac_cv_null_dereference" != "xno"])
+
++# -Wimplicit-fallthrough was added by GCC7
++AC_CACHE_CHECK([whether gcc accepts -Wimplicit-fallthrough], ac_cv_implicit_fallthrough, [dnl
++old_CFLAGS="$CFLAGS"
++CFLAGS="$CFLAGS -Wimplicit-fallthrough -Werror"
++AC_COMPILE_IFELSE([AC_LANG_SOURCE([])],
++ ac_cv_implicit_fallthrough=yes, ac_cv_implicit_fallthrough=no)
++CFLAGS="$old_CFLAGS"])
++AM_CONDITIONAL(HAVE_IMPLICIT_FALLTHROUGH_WARNING,
++ [test "x$ac_cv_implicit_fallthrough" != "xno"])
++
+ dnl Check if we have argp available from our libc
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+diff --git a/libcpu/i386_disasm.c b/libcpu/i386_disasm.c
+index 832241f2..1a584635 100644
+--- a/libcpu/i386_disasm.c
++++ b/libcpu/i386_disasm.c
+@@ -819,7 +819,7 @@ i386_disasm (const uint8_t **startp, const uint8_t *end, GElf_Addr addr,
+ ++param_start;
+ break;
+ }
+-
++ /* Fallthrough */
+ default:
+ assert (! "INVALID not handled");
+ }
+diff --git a/libdw/cfi.c b/libdw/cfi.c
+index 1fd668d7..daa845f3 100644
+--- a/libdw/cfi.c
++++ b/libdw/cfi.c
+@@ -138,6 +138,7 @@ execute_cfi (Dwarf_CFI *cache,
+
+ case DW_CFA_advance_loc1:
+ operand = *program++;
++ /* Fallthrough */
+ case DW_CFA_advance_loc + 0 ... DW_CFA_advance_loc + CFI_PRIMARY_MAX:
+ advance_loc:
+ loc += operand * cie->code_alignment_factor;
+@@ -300,6 +301,7 @@ execute_cfi (Dwarf_CFI *cache,
+
+ case DW_CFA_restore_extended:
+ get_uleb128 (operand, program, end);
++ /* Fallthrough */
+ case DW_CFA_restore + 0 ... DW_CFA_restore + CFI_PRIMARY_MAX:
+
+ if (unlikely (abi_cfi) && likely (opcode == DW_CFA_restore))
+diff --git a/libdw/encoded-value.h b/libdw/encoded-value.h
+index 48d868fb..f0df4cec 100644
+--- a/libdw/encoded-value.h
++++ b/libdw/encoded-value.h
+@@ -64,6 +64,7 @@ encoded_value_size (const Elf_Data *data, const unsigned char e_ident[],
+ if (*end++ & 0x80u)
+ return end - p;
+ }
++ return 0;
+
+ default:
+ return 0;
+diff --git a/libdwfl/dwfl_report_elf.c b/libdwfl/dwfl_report_elf.c
+index 1c6e401d..73a5511a 100644
+--- a/libdwfl/dwfl_report_elf.c
++++ b/libdwfl/dwfl_report_elf.c
+@@ -170,7 +170,7 @@ __libdwfl_elf_address_range (Elf *elf, GElf_Addr base, bool add_p_vaddr,
+ /* An assigned base address is meaningless for these. */
+ base = 0;
+ add_p_vaddr = true;
+-
++ /* Fallthrough. */
+ case ET_DYN:
+ default:;
+ size_t phnum;
+diff --git a/src/addr2line.c b/src/addr2line.c
+index 0ce854f6..bea24aea 100644
+--- a/src/addr2line.c
++++ b/src/addr2line.c
+@@ -632,6 +632,7 @@ handle_address (const char *string, Dwfl *dwfl)
+ case 1:
+ addr = 0;
+ j = i;
++ /* Fallthrough */
+ case 2:
+ if (string[j] != '\0')
+ break;
+diff --git a/src/elfcompress.c b/src/elfcompress.c
+index d0ca469c..57afa116 100644
+--- a/src/elfcompress.c
++++ b/src/elfcompress.c
+@@ -153,7 +153,8 @@ parse_opt (int key, char *arg __attribute__ ((unused)),
+ argp_error (state,
+ N_("Only one input file allowed together with '-o'"));
+ /* We only use this for checking the number of arguments, we don't
+- actually want to consume them, so fallthrough. */
++ actually want to consume them. */
++ /* Fallthrough */
+ default:
+ return ARGP_ERR_UNKNOWN;
+ }
+diff --git a/src/elflint.c b/src/elflint.c
+index 15b12f6f..2c45fcb8 100644
+--- a/src/elflint.c
++++ b/src/elflint.c
+@@ -210,6 +210,7 @@ parse_opt (int key, char *arg __attribute__ ((unused)),
+
+ case 'd':
+ is_debuginfo = true;
++ break;
+
+ case ARGP_gnuld:
+ gnuld = true;
+@@ -3963,6 +3964,7 @@ section [%2zu] '%s': merge flag set but entry size is zero\n"),
+ case SHT_NOBITS:
+ if (is_debuginfo)
+ break;
++ /* Fallthrough */
+ default:
+ ERROR (gettext ("\
+ section [%2zu] '%s' has unexpected type %d for an executable section\n"),
+@@ -4305,7 +4307,7 @@ section [%2d] '%s': unknown core file note type %" PRIu32
+ if (nhdr.n_namesz == sizeof "Linux"
+ && !memcmp (data->d_buf + name_offset, "Linux", sizeof "Linux"))
+ break;
+-
++ /* Fallthrough */
+ default:
+ if (shndx == 0)
+ ERROR (gettext ("\
+diff --git a/src/objdump.c b/src/objdump.c
+index 0aa41e89..94e9e021 100644
+--- a/src/objdump.c
++++ b/src/objdump.c
+@@ -234,7 +234,9 @@ parse_opt (int key, char *arg,
+ program_invocation_short_name);
+ exit (EXIT_FAILURE);
+ }
+-
++ /* We only use this for checking the number of arguments, we don't
++ actually want to consume them. */
++ /* Fallthrough */
+ default:
+ return ARGP_ERR_UNKNOWN;
+ }
+diff --git a/tests/backtrace-data.c b/tests/backtrace-data.c
+index bc5ceba0..b7158dae 100644
+--- a/tests/backtrace-data.c
++++ b/tests/backtrace-data.c
+@@ -250,6 +250,7 @@ thread_callback (Dwfl_Thread *thread, void *thread_arg __attribute__ ((unused)))
+ break;
+ case -1:
+ error (1, 0, "dwfl_thread_getframes: %s", dwfl_errmsg (-1));
++ break;
+ default:
+ abort ();
+ }
+diff --git a/tests/backtrace.c b/tests/backtrace.c
+index 12476430..bf5995b4 100644
+--- a/tests/backtrace.c
++++ b/tests/backtrace.c
+@@ -123,7 +123,7 @@ callback_verify (pid_t tid, unsigned frameno, Dwarf_Addr pc,
+ assert (symname2 == NULL || strcmp (symname2, "jmp") != 0);
+ break;
+ }
+- /* PASSTHRU */
++ /* FALLTHRU */
+ case 4:
+ assert (symname != NULL && strcmp (symname, "stdarg") == 0);
+ break;
+--
+2.13.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/0001-ar-Fix-GCC7-Wformat-length-issues.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/0001-ar-Fix-GCC7-Wformat-length-issues.patch
new file mode 100644
index 000000000..346547678
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/0001-ar-Fix-GCC7-Wformat-length-issues.patch
@@ -0,0 +1,125 @@
+From f090883ca61f0bf0f979c5b26d4e1a69e805156e Mon Sep 17 00:00:00 2001
+From: Mark Wielaard <mjw@redhat.com>
+Date: Thu, 10 Nov 2016 18:45:02 +0100
+Subject: [PATCH] ar: Fix GCC7 -Wformat-length issues.
+
+GCC7 adds warnings for snprintf formatting into too small buffers.
+Fix the two issues pointed out by the new warning. The ar header
+fields are fixed length containing left-justified strings without
+zero terminator. snprintf always adds a '\0' char at the end (which
+we then don't copy into the ar header field) and numbers are decimal
+strings of fixed 10 chars (-Wformat-length thinks formatting
+them as size_t might overflow the buffer on 64bit arches).
+
+Signed-off-by: Mark Wielaard <mjw@redhat.com>
+
+Upstream-Status: Backport
+Upstream-Commit: d5afff85e22b38949f3e7936231c67de16e180e8
+---
+ src/ar.c | 15 +++++++++++----
+ src/arlib.c | 16 ++++++++++------
+ 2 files changed, 21 insertions(+), 10 deletions(-)
+
+diff --git a/src/ar.c b/src/ar.c
+index 1320d07b..f2160d35 100644
+--- a/src/ar.c
++++ b/src/ar.c
+@@ -1,5 +1,5 @@
+ /* Create, modify, and extract from archives.
+- Copyright (C) 2005-2012 Red Hat, Inc.
++ Copyright (C) 2005-2012, 2016 Red Hat, Inc.
+ This file is part of elfutils.
+ Written by Ulrich Drepper <drepper@redhat.com>, 2005.
+
+@@ -853,7 +853,10 @@ write_member (struct armem *memb, off_t *startp, off_t *lenp, Elf *elf,
+ off_t end_off, int newfd)
+ {
+ struct ar_hdr arhdr;
+- char tmpbuf[sizeof (arhdr.ar_name) + 1];
++ /* The ar_name is not actually zero teminated, but we need that for
++ snprintf. Also if the name is too long, then the string starts
++ with '/' plus an index off number (decimal). */
++ char tmpbuf[sizeof (arhdr.ar_name) + 2];
+
+ bool changed_header = memb->long_name_off != -1;
+ if (changed_header)
+@@ -1455,7 +1458,11 @@ do_oper_insert (int oper, const char *arfname, char **argv, int argc,
+
+ /* Create the header. */
+ struct ar_hdr arhdr;
+- char tmpbuf[sizeof (arhdr.ar_name) + 1];
++ /* The ar_name is not actually zero teminated, but we
++ need that for snprintf. Also if the name is too
++ long, then the string starts with '/' plus an index
++ off number (decimal). */
++ char tmpbuf[sizeof (arhdr.ar_name) + 2];
+ if (all->long_name_off == -1)
+ {
+ size_t namelen = strlen (all->name);
+@@ -1465,7 +1472,7 @@ do_oper_insert (int oper, const char *arfname, char **argv, int argc,
+ }
+ else
+ {
+- snprintf (tmpbuf, sizeof (arhdr.ar_name) + 1, "/%-*ld",
++ snprintf (tmpbuf, sizeof (tmpbuf), "/%-*ld",
+ (int) sizeof (arhdr.ar_name), all->long_name_off);
+ memcpy (arhdr.ar_name, tmpbuf, sizeof (arhdr.ar_name));
+ }
+diff --git a/src/arlib.c b/src/arlib.c
+index 43a9145b..0c2e4cde 100644
+--- a/src/arlib.c
++++ b/src/arlib.c
+@@ -1,5 +1,5 @@
+ /* Functions to handle creation of Linux archives.
+- Copyright (C) 2007-2012 Red Hat, Inc.
++ Copyright (C) 2007-2012, 2016 Red Hat, Inc.
+ This file is part of elfutils.
+ Written by Ulrich Drepper <drepper@redhat.com>, 2007.
+
+@@ -23,6 +23,7 @@
+ #include <assert.h>
+ #include <error.h>
+ #include <gelf.h>
++#include <inttypes.h>
+ #include <libintl.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+@@ -107,6 +108,9 @@ arlib_init (void)
+ void
+ arlib_finalize (void)
+ {
++ /* Note that the size is stored as decimal string in 10 chars,
++ without zero terminator (we add + 1 here only so snprintf can
++ put it at the end, we then don't use it when we memcpy it). */
+ char tmpbuf[sizeof (((struct ar_hdr *) NULL)->ar_size) + 1];
+
+ symtab.longnameslen = obstack_object_size (&symtab.longnamesob);
+@@ -121,9 +125,9 @@ arlib_finalize (void)
+
+ symtab.longnames = obstack_finish (&symtab.longnamesob);
+
+- int s = snprintf (tmpbuf, sizeof (tmpbuf), "%-*zu",
++ int s = snprintf (tmpbuf, sizeof (tmpbuf), "%-*" PRIu32 "",
+ (int) sizeof (((struct ar_hdr *) NULL)->ar_size),
+- symtab.longnameslen - sizeof (struct ar_hdr));
++ (uint32_t) (symtab.longnameslen - sizeof (struct ar_hdr)));
+ memcpy (&((struct ar_hdr *) symtab.longnames)->ar_size, tmpbuf, s);
+ }
+
+@@ -169,10 +173,10 @@ arlib_finalize (void)
+
+ /* See comment for ar_date above. */
+ memcpy (&((struct ar_hdr *) symtab.symsoff)->ar_size, tmpbuf,
+- snprintf (tmpbuf, sizeof (tmpbuf), "%-*zu",
++ snprintf (tmpbuf, sizeof (tmpbuf), "%-*" PRIu32 "",
+ (int) sizeof (((struct ar_hdr *) NULL)->ar_size),
+- symtab.symsofflen + symtab.symsnamelen
+- - sizeof (struct ar_hdr)));
++ (uint32_t) (symtab.symsofflen + symtab.symsnamelen
++ - sizeof (struct ar_hdr))));
+ }
+
+
+--
+2.13.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/Fix_one_GCC7_warning.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/Fix_one_GCC7_warning.patch
new file mode 100644
index 000000000..25f5e1482
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/Fix_one_GCC7_warning.patch
@@ -0,0 +1,45 @@
+From 8e2ab18b874d1fda06243ad00209d44e2992928a Mon Sep 17 00:00:00 2001
+From: Mark Wielaard <mark@klomp.org>
+Date: Sun, 12 Feb 2017 21:51:34 +0100
+Subject: [PATCH 1/2] libasm: Fix one GCC7 -Wformat-truncation=2 warning.
+
+Make sure that if we have really lots of labels the tempsym doesn't get
+truncated because it is too small to hold the whole name.
+
+This doesn't enable -Wformat-truncation=2 or fix other "issues" pointed
+out by enabling this warning because there are currently some issues
+with it. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79448
+
+Signed-off-by: Mark Wielaard <mark@klomp.org>
+
+Upstream-Status: Backport (https://sourceware.org/git/?p=elfutils.git;a=commit;h=93c51144c3f664d4e9709da75a1d0fa00ea0fe95)
+Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
+---
+ libasm/asm_newsym.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/libasm/asm_newsym.c b/libasm/asm_newsym.c
+index 7f522910..76482bb2 100644
+--- a/libasm/asm_newsym.c
++++ b/libasm/asm_newsym.c
+@@ -1,5 +1,5 @@
+ /* Define new symbol for current position in given section.
+- Copyright (C) 2002, 2005 Red Hat, Inc.
++ Copyright (C) 2002, 2005, 2017 Red Hat, Inc.
+ This file is part of elfutils.
+ Written by Ulrich Drepper <drepper@redhat.com>, 2002.
+
+@@ -44,7 +44,9 @@ AsmSym_t *
+ asm_newsym (AsmScn_t *asmscn, const char *name, GElf_Xword size,
+ int type, int binding)
+ {
+-#define TEMPSYMLEN 10
++/* We don't really expect labels with many digits, but in theory it could
++ be 10 digits (plus ".L" and a zero terminator). */
++#define TEMPSYMLEN 13
+ char tempsym[TEMPSYMLEN];
+ AsmSym_t *result;
+
+--
+2.13.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/fallthrough.patch b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/fallthrough.patch
new file mode 100644
index 000000000..b2623f9d2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils-0.166/fallthrough.patch
@@ -0,0 +1,36 @@
+GCC7 adds -Wimplicit-fallthrough to warn when a switch case falls through,
+however this causes warnings (which are promoted to errors) with the elfutils
+patches from Debian for mips and parisc, which use fallthrough's by design.
+
+Explicitly mark the intentional fallthrough switch cases with a comment to
+disable the warnings where the fallthrough behaviour is desired.
+
+Upstream-Status: Pending [debian]
+Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
+
+Index: elfutils-0.168/backends/parisc_retval.c
+===================================================================
+--- elfutils-0.168.orig/backends/parisc_retval.c
++++ elfutils-0.168/backends/parisc_retval.c
+@@ -166,7 +166,7 @@ parisc_return_value_location_ (Dwarf_Die
+ return nloc_intregpair;
+
+ /* Else fall through. */
+- }
++ } // fallthrough
+
+ case DW_TAG_structure_type:
+ case DW_TAG_class_type:
+Index: elfutils-0.168/backends/mips_retval.c
+===================================================================
+--- elfutils-0.168.orig/backends/mips_retval.c
++++ elfutils-0.168/backends/mips_retval.c
+@@ -387,7 +387,7 @@ mips_return_value_location (Dwarf_Die *f
+ else
+ return nloc_intregpair;
+ }
+- }
++ } // fallthrough
+
+ /* Fallthrough to handle large types */
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils_0.148.bb b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils_0.148.bb
index 6080c179f..d18b732fe 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils_0.148.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils_0.148.bb
@@ -8,8 +8,7 @@ DEPENDS = "libtool bzip2 zlib virtual/libintl"
PR = "r11"
-SRC_URI = "https://fedorahosted.org/releases/e/l/${BPN}/${BP}.tar.bz2"
-
+SRC_URI = "ftp://sourceware.org/pub/elfutils/${PV}/${BP}.tar.bz2"
SRC_URI[md5sum] = "a0bed1130135f17ad27533b0034dba8d"
SRC_URI[sha256sum] = "8aebfa4a745db21cf5429c9541fe482729b62efc7e53e9110151b4169fe887da"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils_0.166.bb b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils_0.166.bb
index 5c436d386..3593c1c1d 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils_0.166.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/elfutils/elfutils_0.166.bb
@@ -1,12 +1,12 @@
SUMMARY = "Utilities and libraries for handling compiled object files"
-HOMEPAGE = "https://fedorahosted.org/elfutils"
+HOMEPAGE = "https://sourceware.org/elfutils"
SECTION = "base"
LICENSE = "(GPLv3 & Elfutils-Exception)"
LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
DEPENDS = "libtool bzip2 zlib virtual/libintl"
DEPENDS_append_libc-musl = " argp-standalone fts "
-SRC_URI = "https://fedorahosted.org/releases/e/l/elfutils/${PV}/${BP}.tar.bz2"
+SRC_URI = "ftp://sourceware.org/pub/elfutils/${PV}/${BP}.tar.bz2"
SRC_URI[md5sum] = "d4e462b7891915dc5326bccefa2024ff"
SRC_URI[sha256sum] = "3c056914c8a438b210be0d790463b960fc79d234c3f05ce707cbff80e94cba30"
@@ -18,7 +18,10 @@ SRC_URI += "\
file://0001-remove-the-unneed-checking.patch \
file://0001-fix-a-stack-usage-warning.patch \
file://aarch64_uio.patch \
+ file://Fix_one_GCC7_warning.patch \
+ file://0001-Add-GCC7-Wimplicit-fallthrough-support-fixes.patch \
file://shadow.patch \
+ file://0001-ar-Fix-GCC7-Wformat-length-issues.patch \
"
# pick the patch from debian
@@ -37,6 +40,8 @@ SRC_URI += "\
file://uclibc-support.patch \
file://elfcmp-fix-self-comparision.patch \
"
+# Fix the patches from Debian with GCC7
+SRC_URI += "file://fallthrough.patch"
SRC_URI_append_libc-musl = " file://0001-build-Provide-alternatives-for-glibc-assumptions-hel.patch "
# The buildsystem wants to generate 2 .h files from source using a binary it just built,
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2.inc b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2.inc
index b118995e1..39ae65380 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2.inc
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2.inc
@@ -80,8 +80,9 @@ SRC_URI = "\
file://0047-libgcc_s-Use-alias-for-__cpu_indicator_init-instead-.patch \
${BACKPORTS} \
"
-BACKPORTS = ""
-
+BACKPORTS = "\
+ file://ubsan-fix-check-empty-string.patch \
+"
SRC_URI[md5sum] = "9768625159663b300ae4de2f4745fcc4"
SRC_URI[sha256sum] = "9944589fc722d3e66308c0ce5257788ebd7872982a718aa2516123940671b7c5"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/ubsan-fix-check-empty-string.patch b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/ubsan-fix-check-empty-string.patch
new file mode 100644
index 000000000..c0127198e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/gcc-6.2/ubsan-fix-check-empty-string.patch
@@ -0,0 +1,28 @@
+From 8db2cf6353c13f2a84cbe49b689654897906c499 Mon Sep 17 00:00:00 2001
+From: kyukhin <kyukhin@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Sat, 3 Sep 2016 10:57:05 +0000
+Subject: [PATCH] gcc/ * ubsan.c (ubsan_use_new_style_p): Fix check for empty
+ string.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@239971 138bc75d-0d04-0410-961f-82ee72b054a4
+
+Upstream-Status: Backport
+Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
+
+---
+ gcc/ubsan.c | 2 +-
+ 2 files changed, 5 insertions(+), 1 deletion(-)
+
+Index: gcc-6.3.0/gcc/ubsan.c
+===================================================================
+--- gcc-6.3.0.orig/gcc/ubsan.c
++++ gcc-6.3.0/gcc/ubsan.c
+@@ -1471,7 +1471,7 @@ ubsan_use_new_style_p (location_t loc)
+
+ expanded_location xloc = expand_location (loc);
+ if (xloc.file == NULL || strncmp (xloc.file, "\1", 2) == 0
+- || xloc.file == '\0' || xloc.file[0] == '\xff'
++ || xloc.file[0] == '\0' || xloc.file[0] == '\xff'
+ || xloc.file[1] == '\xff')
+ return false;
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc-common.inc b/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc-common.inc
index 8a13f542c..c4de31c34 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc-common.inc
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gcc/libgcc-common.inc
@@ -144,6 +144,9 @@ BASETARGET_SYS = "${@get_original_os(d)}"
addtask extra_symlinks after do_multilib_install before do_package do_populate_sysroot
fakeroot python do_extra_symlinks() {
+ if bb.data.inherits_class('nativesdk', d):
+ return
+
targetsys = d.getVar('BASETARGET_SYS', True)
if targetsys != d.getVar('TARGET_SYS', True):
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-7.11.1.inc b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-7.11.1.inc
new file mode 100644
index 000000000..d9dfe6f3f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-7.11.1.inc
@@ -0,0 +1,22 @@
+LICENSE = "GPLv2 & GPLv3 & LGPLv2 & LGPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
+ file://COPYING3;md5=d32239bcb673463ab874e80d47fae504 \
+ file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6 \
+ file://COPYING.LIB;md5=9f604d8a4f8e74f4f5140845a21b6674"
+
+SRC_URI = "http://ftp.gnu.org/gnu/gdb/gdb-${PV}.tar.xz \
+ file://0001-include-sys-types.h-for-mode_t.patch \
+ file://0002-make-man-install-relative-to-DESTDIR.patch \
+ file://0003-mips-linux-nat-Define-_ABIO32-if-not-defined.patch \
+ file://0004-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch \
+ file://0005-Add-support-for-Renesas-SH-sh4-architecture.patch \
+ file://0006-Dont-disable-libreadline.a-when-using-disable-static.patch \
+ file://0007-use-asm-sgidefs.h.patch \
+ file://0008-Use-exorted-definitions-of-SIGRTMIN.patch \
+ file://0009-Change-order-of-CFLAGS.patch \
+ file://0010-resolve-restrict-keyword-conflict.patch \
+ file://0011-avx_mpx.patch \
+"
+
+SRC_URI[md5sum] = "5aa71522e488e358243917967db87476"
+SRC_URI[sha256sum] = "e9216da4e3755e9f414c1aa0026b626251dfc57ffe572a266e98da4f6988fc70"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-7.11.inc b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-7.11.inc
deleted file mode 100644
index a9267d554..000000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-7.11.inc
+++ /dev/null
@@ -1,9 +0,0 @@
-LICENSE = "GPLv2 & GPLv3 & LGPLv2 & LGPLv3"
-LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
- file://COPYING3;md5=d32239bcb673463ab874e80d47fae504 \
- file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6 \
- file://COPYING.LIB;md5=9f604d8a4f8e74f4f5140845a21b6674"
-
-SRC_URI[md5sum] = "b93a2721393e5fa226375b42d567d90b"
-SRC_URI[sha256sum] = "ff14f8050e6484508c73cbfa63731e57901478490ca1672dc0b5e2b03f6af622"
-
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-common.inc b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-common.inc
index 09231434d..33a5ce983 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-common.inc
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-common.inc
@@ -1,6 +1,5 @@
SUMMARY = "GNU debugger"
HOMEPAGE = "http://www.gnu.org/software/gdb/"
-LICENSE = "GPLv3+"
SECTION = "devel"
DEPENDS = "expat zlib ncurses virtual/libiconv ${LTTNGUST}"
@@ -16,33 +15,10 @@ LTTNGUST_mips64eln32 = ""
LTTNGUST_sh4 = ""
LTTNGUST_libc-musl = ""
-LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
- file://COPYING.LIB;md5=9f604d8a4f8e74f4f5140845a21b6674 \
- file://COPYING3;md5=d32239bcb673463ab874e80d47fae504 \
- file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6"
-
inherit autotools texinfo
-SRCREV = "1a982b689ce4e20523bdf69e47fdd574c4f63934"
-
-SRC_URI = "git://sourceware.org/git/binutils-gdb.git;branch=gdb-7.11-branch \
- file://0001-include-sys-types.h-for-mode_t.patch \
- file://0002-make-man-install-relative-to-DESTDIR.patch \
- file://0003-mips-linux-nat-Define-_ABIO32-if-not-defined.patch \
- file://0004-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch \
- file://0005-Add-support-for-Renesas-SH-sh4-architecture.patch \
- file://0006-Dont-disable-libreadline.a-when-using-disable-static.patch \
- file://0007-use-asm-sgidefs.h.patch \
- file://0008-Use-exorted-definitions-of-SIGRTMIN.patch \
- file://0009-Change-order-of-CFLAGS.patch \
- file://0010-resolve-restrict-keyword-conflict.patch \
- file://0011-avx_mpx.patch \
-"
-
UPSTREAM_CHECK_GITTAGREGEX = "gdb\-(?P<pver>.+)\-release"
-S = "${WORKDIR}/git"
-
B = "${WORKDIR}/build-${TARGET_SYS}"
EXTRA_OEMAKE = "'SUBDIRS=intl mmalloc libiberty opcodes bfd sim gdb etc utils'"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross-canadian.inc b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross-canadian.inc
index e53081d0c..3ff198953 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross-canadian.inc
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross-canadian.inc
@@ -14,7 +14,8 @@ GDBPROPREFIX = "--program-prefix='${TARGET_PREFIX}'"
PACKAGECONFIG ??= "python readline"
PACKAGECONFIG[python] = "--with-python=${WORKDIR}/python,--without-python,nativesdk-python3, \
nativesdk-python3-core nativesdk-python3-lang nativesdk-python3-re \
- nativesdk-python3-codecs nativesdk-python3-netclient"
+ nativesdk-python3-codecs nativesdk-python3-netclient \
+ nativesdk-python3-importlib"
PACKAGECONFIG[readline] = "--with-system-readline,--without-system-readline,nativesdk-readline"
SSTATE_DUPWHITELIST += "${STAGING_DATADIR}/gdb"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross-canadian_7.11.bb b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross-canadian_7.11.1.bb
index 301035940..301035940 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross-canadian_7.11.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross-canadian_7.11.1.bb
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross_7.11.bb b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross_7.11.1.bb
index 50cf159fd..50cf159fd 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross_7.11.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb-cross_7.11.1.bb
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb_7.11.bb b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb_7.11.1.bb
index 57cffc998..57cffc998 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb_7.11.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/gdb/gdb_7.11.1.bb
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-test-customized.patch b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-test-customized.patch
index 84b0b88f2..477be29ef 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-test-customized.patch
+++ b/import-layers/yocto-poky/meta/recipes-devtools/perl/perl/perl-test-customized.patch
@@ -17,7 +17,7 @@ Index: perl-5.22.1/t/porting/customized.dat
ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist.pm bef099988b15fb0b2a1f5ac48c01af1f7f36d329
-ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm 8168e18f0e3ce3ece4bb7e7c72d57ec07c67c402
-ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm 7115e97a53559cb3ec061dd6f7f344e522724c4a
-+ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm a08ecf80c8f0a234243817713b2a5ab0dcae3c0a
++ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm 8c22e119b96d674f1f268a9c495bb4aa04e1100b
+ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm 3d7abd674b15ed323f743594ef0bd09db76b1aee
ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker/Config.pm f8db8d4245bf0684b8210c811f50d7cfb1a27d78
ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker/FAQ.pod 757bffb47857521311f8f3bde43ebe165f8d5191
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/More-correctly-fix-xattrs.patch b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/More-correctly-fix-xattrs.patch
new file mode 100644
index 000000000..3d178f9b4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/More-correctly-fix-xattrs.patch
@@ -0,0 +1,37 @@
+From 45eca34c754d416a38bee90fb2d3c110a0b6cc5f Mon Sep 17 00:00:00 2001
+From: Seebs <seebs@seebs.net>
+Date: Thu, 3 Nov 2016 11:36:12 -0500
+Subject: [PATCH] More-correctly fix xattrs
+
+Fix provided by Patrick Ohly <patrick.ohly@intel.com>. This resolves
+the actual cause of the path length mismatches, and explains why
+I couldn't quite explain why the previous one had only sometimes
+worked, also why it showed up on directories but not plain files.
+
+Signed-off-by: Seebs <seebs@seebs.net>
+
+Fixes [YOCTO #10623]
+
+Upstream-Status: Backport [commit 45eca34c754d416a38bee90fb2d3c110a0b6cc5f]
+
+Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
+---
+ pseudo_client.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/pseudo_client.c b/pseudo_client.c
+index 6a08df3..b1a00fa 100644
+--- a/pseudo_client.c
++++ b/pseudo_client.c
+@@ -1676,7 +1676,7 @@ pseudo_client_op(pseudo_op_t op, int access, int fd, int dirfd, const char *path
+ * empty path for that.
+ */
+ if (path_extra_1) {
+- size_t full_len = path_extra_1len + 1 + pathlen;
++ size_t full_len = path_extra_1len + 1 + pathlen - strip_slash;
+ size_t partial_len = pathlen - 1 - strip_slash;
+ if (path_extra_2) {
+ full_len += path_extra_2len + 1;
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_1.8.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_1.8.1.bb
index fb70034b4..90b53c0c1 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_1.8.1.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_1.8.1.bb
@@ -10,6 +10,7 @@ SRC_URI = "http://downloads.yoctoproject.org/releases/pseudo/${BPN}-${PV}.tar.bz
file://0001-Quiet-diagnostics-during-startup-for-pseudo-d.patch \
file://0002-Use-correct-file-descriptor.patch \
file://0003-Fix-renameat-parallel-to-previous-fix-to-rename.patch \
+ file://More-correctly-fix-xattrs.patch \
"
SRC_URI[md5sum] = "ee38e4fb62ff88ad067b1a5a3825bac7"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_git.bb b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_git.bb
index 8110b1a19..ac923bbb7 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_git.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_git.bb
@@ -1,6 +1,6 @@
require pseudo.inc
-SRCREV = "befc6dbd6469d428c9e0830dbe51bdf7ac39d9ae"
+SRCREV = "45eca34c754d416a38bee90fb2d3c110a0b6cc5f"
PV = "1.8.1+git${SRCPV}"
DEFAULT_PREFERENCE = "-1"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python-numpy/files/d70d37b7c4aa2af3fe879a0d858c54f2aa32a725.patch b/import-layers/yocto-poky/meta/recipes-devtools/python-numpy/files/d70d37b7c4aa2af3fe879a0d858c54f2aa32a725.patch
new file mode 100644
index 000000000..08cb078fa
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python-numpy/files/d70d37b7c4aa2af3fe879a0d858c54f2aa32a725.patch
@@ -0,0 +1,47 @@
+From 154b2c19f392817a936aea0190e276f8228cb489 Mon Sep 17 00:00:00 2001
+From: "Erik M. Bray" <erik.bray@lri.fr>
+Date: Mon, 12 Dec 2016 13:07:16 +0100
+Subject: [PATCH] BUG: xlocale.h is not available in newlib--all the defines
+ used here from xlocale.h are instead found in locale.h
+
+Added a feature check for xlocale.h, with fallback to locale.h if it is
+missing.
+---
+ numpy/core/setup_common.py | 1 +
+ numpy/core/src/multiarray/numpyos.c | 8 +++++++-
+ 2 files changed, 8 insertions(+), 1 deletion(-)
+
+Upstream-Status: Backport
+RP 2017/9/6
+
+diff --git a/numpy/core/setup_common.py b/numpy/core/setup_common.py
+index ba7521e3043..a1729e65656 100644
+--- a/numpy/core/setup_common.py
++++ b/numpy/core/setup_common.py
+@@ -113,6 +113,7 @@ def check_api_version(apiversion, codegen_dir):
+ "xmmintrin.h", # SSE
+ "emmintrin.h", # SSE2
+ "features.h", # for glibc version linux
++ "xlocale.h" # see GH#8367
+ ]
+
+ # optional gcc compiler builtins and their call arguments and optional a
+diff --git a/numpy/core/src/multiarray/numpyos.c b/numpy/core/src/multiarray/numpyos.c
+index 450ec40b6e0..84617ea78c3 100644
+--- a/numpy/core/src/multiarray/numpyos.c
++++ b/numpy/core/src/multiarray/numpyos.c
+@@ -15,7 +15,13 @@
+
+ #ifdef HAVE_STRTOLD_L
+ #include <stdlib.h>
+-#include <xlocale.h>
++#ifdef HAVE_XLOCALE_H
++ /*
++ * the defines from xlocale.h are included in locale.h on some sytems;
++ * see gh-8367
++ */
++ #include <xlocale.h>
++#endif
+ #endif
+
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python-numpy/python-numpy_1.11.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/python-numpy/python-numpy_1.11.1.bb
index c5af720a9..c94f5c3d1 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/python-numpy/python-numpy_1.11.1.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python-numpy/python-numpy_1.11.1.bb
@@ -9,6 +9,7 @@ SRC_URI = "https://files.pythonhosted.org/packages/source/n/${SRCNAME}/${SRCNAME
file://0001-Don-t-search-usr-and-so-on-for-libraries-by-default-.patch \
file://remove-build-path-in-comments.patch \
file://fix_shebang_f2py.patch \
+ file://d70d37b7c4aa2af3fe879a0d858c54f2aa32a725.patch \
${CONFIGFILESURI} "
UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/numpy/files/"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python-numpy/python3-numpy_1.11.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/python-numpy/python3-numpy_1.11.0.bb
index 3cca2239d..8b502febc 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/python-numpy/python3-numpy_1.11.0.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python-numpy/python3-numpy_1.11.0.bb
@@ -9,6 +9,7 @@ SRC_URI = "https://files.pythonhosted.org/packages/source/n/${SRCNAME}/${SRCNAME
file://0001-Don-t-search-usr-and-so-on-for-libraries-by-default-.patch \
file://remove-build-path-in-comments.patch \
file://fix_shebang_f2py.patch \
+ file://d70d37b7c4aa2af3fe879a0d858c54f2aa32a725.patch \
${CONFIGFILESURI} "
UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/numpy/files/"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-2.7-manifest.inc b/import-layers/yocto-poky/meta/recipes-devtools/python/python-2.7-manifest.inc
index 189689d4c..621024f6a 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/python/python-2.7-manifest.inc
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-2.7-manifest.inc
@@ -246,7 +246,7 @@ RDEPENDS_${PN}-terminal="${PN}-core ${PN}-io"
FILES_${PN}-terminal="${libdir}/python2.7/pty.* ${libdir}/python2.7/tty.* "
SUMMARY_${PN}-tests="Python tests"
-RDEPENDS_${PN}-tests="${PN}-core"
+RDEPENDS_${PN}-tests="${PN}-core ${PN}-modules"
FILES_${PN}-tests="${libdir}/python2.7/test "
SUMMARY_${PN}-textutils="Python option parsing, text wrapping and CSV support"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python-3.5-manifest.inc b/import-layers/yocto-poky/meta/recipes-devtools/python/python-3.5-manifest.inc
index 304611432..6c690db80 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/python/python-3.5-manifest.inc
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python-3.5-manifest.inc
@@ -115,7 +115,7 @@ FILES_${PN}-image="${libdir}/python3.5/colorsys.* ${libdir}/python3.5/imghdr.* $
SUMMARY_${PN}-importlib="Python import implementation library"
RDEPENDS_${PN}-importlib="${PN}-core ${PN}-lang"
-FILES_${PN}-importlib="${libdir}/python3.5/importlib "
+FILES_${PN}-importlib="${libdir}/python3.5/importlib ${libdir}/python3.5/imp.* "
SUMMARY_${PN}-io="Python low-level I/O"
RDEPENDS_${PN}-io="${PN}-core ${PN}-math"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/python/python3-native_3.5.2.bb b/import-layers/yocto-poky/meta/recipes-devtools/python/python3-native_3.5.2.bb
index 594f15c7c..f32f05cca 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/python/python3-native_3.5.2.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/python/python3-native_3.5.2.bb
@@ -65,7 +65,8 @@ RPROVIDES += " \
python3-unittest-native \
"
-EXTRA_OECONF_append = " --bindir=${bindir}/${PN} --without-ensurepip"
+# uninative may be used on pre glibc 2.25 systems which don't have getentropy
+EXTRA_OECONF_append = " --bindir=${bindir}/${PN} --without-ensurepip ac_cv_func_getentropy=no"
EXTRA_OEMAKE = '\
LIBC="" \
@@ -80,6 +81,7 @@ PYTHONLSBOPTS = ""
do_configure_append() {
autoreconf --verbose --install --force --exclude=autopoint ../Python-${PV}/Modules/_ctypes/libffi
+ sed -i -e 's,#define HAVE_GETRANDOM 1,/\* #undef HAVE_GETRANDOM \*/,' ${B}/pyconfig.h
}
do_install() {
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/0001-virtio-zero-vq-inuse-in-virtio_reset.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/0001-virtio-zero-vq-inuse-in-virtio_reset.patch
new file mode 100644
index 000000000..86955d043
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/0001-virtio-zero-vq-inuse-in-virtio_reset.patch
@@ -0,0 +1,57 @@
+Upstream-Status: Backport
+
+Supplementary fix of CVE-2016-5403 which is backported from:
+
+http://git.qemu.org/?p=qemu.git;a=commit;h=4b7f91e
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+---
+From 4b7f91ed0270a371e1933efa21ba600b6da23ab9 Mon Sep 17 00:00:00 2001
+From: Stefan Hajnoczi <stefanha@redhat.com>
+Date: Wed, 7 Sep 2016 11:51:25 -0400
+Subject: [PATCH] virtio: zero vq->inuse in virtio_reset()
+
+vq->inuse must be zeroed upon device reset like most other virtqueue
+fields.
+
+In theory, virtio_reset() just needs assert(vq->inuse == 0) since
+devices must clean up in-flight requests during reset (requests cannot
+not be leaked!).
+
+In practice, it is difficult to achieve vq->inuse == 0 across reset
+because balloon, blk, 9p, etc implement various different strategies for
+cleaning up requests. Most devices call g_free(elem) directly without
+telling virtio.c that the VirtQueueElement is cleaned up. Therefore
+vq->inuse is not decremented during reset.
+
+This patch zeroes vq->inuse and trusts that devices are not leaking
+VirtQueueElements across reset.
+
+I will send a follow-up series that refactors request life-cycle across
+all devices and converts vq->inuse = 0 into assert(vq->inuse == 0) but
+this more invasive approach is not appropriate for stable trees.
+
+Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
+Cc: qemu-stable <qemu-stable@nongnu.org>
+Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
+Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
+Reviewed-by: Ladi Prosek <lprosek@redhat.com>
+---
+ hw/virtio/virtio.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
+index 74c085c..e8a13a5 100644
+--- a/hw/virtio/virtio.c
++++ b/hw/virtio/virtio.c
+@@ -822,6 +822,7 @@ void virtio_reset(void *opaque)
+ vdev->vq[i].signalled_used_valid = false;
+ vdev->vq[i].notification = true;
+ vdev->vq[i].vring.num = vdev->vq[i].vring.num_default;
++ vdev->vq[i].inuse = 0;
+ }
+ }
+
+--
+2.9.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/0002-fix-CVE-2016-7423.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/0002-fix-CVE-2016-7423.patch
new file mode 100644
index 000000000..fdf58a3d6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/0002-fix-CVE-2016-7423.patch
@@ -0,0 +1,45 @@
+Upstream-Status: Backport
+
+Backport patch to fix CVE-2016-7423 from:
+
+http://git.qemu.org/?p=qemu.git;a=commit;h=670e56d3ed
+
+CVE: CVE-2016-7423
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+---
+From 670e56d3ed2918b3861d9216f2c0540d9e9ae0d5 Mon Sep 17 00:00:00 2001
+From: Li Qiang <liqiang6-s@360.cn>
+Date: Mon, 12 Sep 2016 18:14:11 +0530
+Subject: [PATCH] scsi: mptsas: use g_new0 to allocate MPTSASRequest object
+
+When processing IO request in mptsas, it uses g_new to allocate
+a 'req' object. If an error occurs before 'req->sreq' is
+allocated, It could lead to an OOB write in mptsas_free_request
+function. Use g_new0 to avoid it.
+
+Reported-by: Li Qiang <liqiang6-s@360.cn>
+Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
+Message-Id: <1473684251-17476-1-git-send-email-ppandit@redhat.com>
+Cc: qemu-stable@nongnu.org
+Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
+---
+ hw/scsi/mptsas.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/hw/scsi/mptsas.c b/hw/scsi/mptsas.c
+index 0e0a22f..eaae1bb 100644
+--- a/hw/scsi/mptsas.c
++++ b/hw/scsi/mptsas.c
+@@ -304,7 +304,7 @@ static int mptsas_process_scsi_io_request(MPTSASState *s,
+ goto bad;
+ }
+
+- req = g_new(MPTSASRequest, 1);
++ req = g_new0(MPTSASRequest, 1);
+ QTAILQ_INSERT_TAIL(&s->pending, req, next);
+ req->scsi_io = *scsi_io;
+ req->dev = s;
+--
+2.9.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/0003-fix-CVE-2016-7908.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/0003-fix-CVE-2016-7908.patch
new file mode 100644
index 000000000..05cc3d9d1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/0003-fix-CVE-2016-7908.patch
@@ -0,0 +1,62 @@
+Upstream-Status: Backport
+
+Backport patch to fix CVE-2016-7908 from:
+
+http://git.qemu.org/?p=qemu.git;a=commit;h=070c4b92b8c
+
+CVE: CVE-2016-7908
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+---
+From 070c4b92b8cd5390889716677a0b92444d6e087a Mon Sep 17 00:00:00 2001
+From: Prasad J Pandit <pjp@fedoraproject.org>
+Date: Thu, 22 Sep 2016 16:02:37 +0530
+Subject: [PATCH] net: mcf: limit buffer descriptor count
+
+ColdFire Fast Ethernet Controller uses buffer descriptors to manage
+data flow to/fro receive & transmit queues. While transmitting
+packets, it could continue to read buffer descriptors if a buffer
+descriptor has length of zero and has crafted values in bd.flags.
+Set upper limit to number of buffer descriptors.
+
+Reported-by: Li Qiang <liqiang6-s@360.cn>
+Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
+Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
+Signed-off-by: Jason Wang <jasowang@redhat.com>
+---
+ hw/net/mcf_fec.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/hw/net/mcf_fec.c b/hw/net/mcf_fec.c
+index 0ee8ad9..d31fea1 100644
+--- a/hw/net/mcf_fec.c
++++ b/hw/net/mcf_fec.c
+@@ -23,6 +23,7 @@ do { printf("mcf_fec: " fmt , ## __VA_ARGS__); } while (0)
+ #define DPRINTF(fmt, ...) do {} while(0)
+ #endif
+
++#define FEC_MAX_DESC 1024
+ #define FEC_MAX_FRAME_SIZE 2032
+
+ typedef struct {
+@@ -149,7 +150,7 @@ static void mcf_fec_do_tx(mcf_fec_state *s)
+ uint32_t addr;
+ mcf_fec_bd bd;
+ int frame_size;
+- int len;
++ int len, descnt = 0;
+ uint8_t frame[FEC_MAX_FRAME_SIZE];
+ uint8_t *ptr;
+
+@@ -157,7 +158,7 @@ static void mcf_fec_do_tx(mcf_fec_state *s)
+ ptr = frame;
+ frame_size = 0;
+ addr = s->tx_descriptor;
+- while (1) {
++ while (descnt++ < FEC_MAX_DESC) {
+ mcf_fec_read_bd(&bd, addr);
+ DPRINTF("tx_bd %x flags %04x len %d data %08x\n",
+ addr, bd.flags, bd.length, bd.data);
+--
+2.9.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/0004-fix-CVE-2016-7909.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/0004-fix-CVE-2016-7909.patch
new file mode 100644
index 000000000..e71bbf620
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/0004-fix-CVE-2016-7909.patch
@@ -0,0 +1,42 @@
+Upstream-Status: Backport [http://git.qemu.org/?p=qemu.git;a=commit;h=34e29ce]
+CVE: CVE-2016-7909
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+---
+From 34e29ce754c02bb6b3bdd244fbb85033460feaff Mon Sep 17 00:00:00 2001
+From: Prasad J Pandit <pjp@fedoraproject.org>
+Date: Fri, 30 Sep 2016 00:27:33 +0530
+Subject: [PATCH] net: pcnet: check rx/tx descriptor ring length
+
+The AMD PC-Net II emulator has set of control and status(CSR)
+registers. Of these, CSR76 and CSR78 hold receive and transmit
+descriptor ring length respectively. This ring length could range
+from 1 to 65535. Setting ring length to zero leads to an infinite
+loop in pcnet_rdra_addr() or pcnet_transmit(). Add check to avoid it.
+
+Reported-by: Li Qiang <liqiang6-s@360.cn>
+Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
+Signed-off-by: Jason Wang <jasowang@redhat.com>
+---
+ hw/net/pcnet.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/hw/net/pcnet.c b/hw/net/pcnet.c
+index 198a01f..3078de8 100644
+--- a/hw/net/pcnet.c
++++ b/hw/net/pcnet.c
+@@ -1429,8 +1429,11 @@ static void pcnet_csr_writew(PCNetState *s, uint32_t rap, uint32_t new_value)
+ case 47: /* POLLINT */
+ case 72:
+ case 74:
++ break;
+ case 76: /* RCVRL */
+ case 78: /* XMTRL */
++ val = (val > 0) ? val : 512;
++ break;
+ case 112:
+ if (CSR_STOP(s) || CSR_SPND(s))
+ break;
+--
+2.10.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/04b33e21866412689f18b7ad6daf0a54d8f959a7.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/04b33e21866412689f18b7ad6daf0a54d8f959a7.patch
new file mode 100644
index 000000000..d947e8cba
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/04b33e21866412689f18b7ad6daf0a54d8f959a7.patch
@@ -0,0 +1,282 @@
+From 04b33e21866412689f18b7ad6daf0a54d8f959a7 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 28 Jun 2017 13:44:52 -0700
+Subject: [PATCH] Replace 'struct ucontext' with 'ucontext_t' type
+
+glibc used to have:
+
+ typedef struct ucontext { ... } ucontext_t;
+
+glibc now has:
+
+ typedef struct ucontext_t { ... } ucontext_t;
+
+(See https://sourceware.org/bugzilla/show_bug.cgi?id=21457
+ for detail and rationale for the glibc change)
+
+However, QEMU used "struct ucontext" in declarations. This is a
+private name and compatibility cannot be guaranteed. Switch to
+only using the standardized type name.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Message-id: 20170628204452.41230-1-raj.khem@gmail.com
+Cc: Kamil Rytarowski <kamil@netbsd.org>
+Cc: Riku Voipio <riku.voipio@iki.fi>
+Cc: Laurent Vivier <laurent@vivier.eu>
+Cc: Paolo Bonzini <pbonzini@redhat.com>
+Reviewed-by: Eric Blake <eblake@redhat.com>
+[PMM: Rewrote commit message, based mostly on the one from
+ Nathaniel McCallum]
+Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
+
+Upstream-Status: Backport
+RP 2017/9/6
+---
+ linux-user/host/aarch64/hostdep.h | 2 +-
+ linux-user/host/arm/hostdep.h | 2 +-
+ linux-user/host/i386/hostdep.h | 2 +-
+ linux-user/host/ppc64/hostdep.h | 2 +-
+ linux-user/host/s390x/hostdep.h | 2 +-
+ linux-user/host/x86_64/hostdep.h | 2 +-
+ linux-user/signal.c | 10 +++++-----
+ tests/tcg/test-i386.c | 4 ++--
+ user-exec.c | 18 +++++++++---------
+ 9 files changed, 22 insertions(+), 22 deletions(-)
+
+diff --git a/linux-user/host/aarch64/hostdep.h b/linux-user/host/aarch64/hostdep.h
+index 64f75ce..a8d41a2 100644
+--- a/linux-user/host/aarch64/hostdep.h
++++ b/linux-user/host/aarch64/hostdep.h
+@@ -24,7 +24,7 @@ extern char safe_syscall_end[];
+ /* Adjust the signal context to rewind out of safe-syscall if we're in it */
+ static inline void rewind_if_in_safe_syscall(void *puc)
+ {
+- struct ucontext *uc = puc;
++ ucontext_t *uc = puc;
+ __u64 *pcreg = &uc->uc_mcontext.pc;
+
+ if (*pcreg > (uintptr_t)safe_syscall_start
+diff --git a/linux-user/host/arm/hostdep.h b/linux-user/host/arm/hostdep.h
+index 5c1ae60..9276fe6 100644
+--- a/linux-user/host/arm/hostdep.h
++++ b/linux-user/host/arm/hostdep.h
+@@ -24,7 +24,7 @@ extern char safe_syscall_end[];
+ /* Adjust the signal context to rewind out of safe-syscall if we're in it */
+ static inline void rewind_if_in_safe_syscall(void *puc)
+ {
+- struct ucontext *uc = puc;
++ ucontext_t *uc = puc;
+ unsigned long *pcreg = &uc->uc_mcontext.arm_pc;
+
+ if (*pcreg > (uintptr_t)safe_syscall_start
+diff --git a/linux-user/host/i386/hostdep.h b/linux-user/host/i386/hostdep.h
+index d834bd8..073be74 100644
+--- a/linux-user/host/i386/hostdep.h
++++ b/linux-user/host/i386/hostdep.h
+@@ -24,7 +24,7 @@ extern char safe_syscall_end[];
+ /* Adjust the signal context to rewind out of safe-syscall if we're in it */
+ static inline void rewind_if_in_safe_syscall(void *puc)
+ {
+- struct ucontext *uc = puc;
++ ucontext_t *uc = puc;
+ greg_t *pcreg = &uc->uc_mcontext.gregs[REG_EIP];
+
+ if (*pcreg > (uintptr_t)safe_syscall_start
+diff --git a/linux-user/host/ppc64/hostdep.h b/linux-user/host/ppc64/hostdep.h
+index 0b0f5f7..98979ad 100644
+--- a/linux-user/host/ppc64/hostdep.h
++++ b/linux-user/host/ppc64/hostdep.h
+@@ -24,7 +24,7 @@ extern char safe_syscall_end[];
+ /* Adjust the signal context to rewind out of safe-syscall if we're in it */
+ static inline void rewind_if_in_safe_syscall(void *puc)
+ {
+- struct ucontext *uc = puc;
++ ucontext_t *uc = puc;
+ unsigned long *pcreg = &uc->uc_mcontext.gp_regs[PT_NIP];
+
+ if (*pcreg > (uintptr_t)safe_syscall_start
+diff --git a/linux-user/host/s390x/hostdep.h b/linux-user/host/s390x/hostdep.h
+index 6f9da9c..4f0171f 100644
+--- a/linux-user/host/s390x/hostdep.h
++++ b/linux-user/host/s390x/hostdep.h
+@@ -24,7 +24,7 @@ extern char safe_syscall_end[];
+ /* Adjust the signal context to rewind out of safe-syscall if we're in it */
+ static inline void rewind_if_in_safe_syscall(void *puc)
+ {
+- struct ucontext *uc = puc;
++ ucontext_t *uc = puc;
+ unsigned long *pcreg = &uc->uc_mcontext.psw.addr;
+
+ if (*pcreg > (uintptr_t)safe_syscall_start
+diff --git a/linux-user/host/x86_64/hostdep.h b/linux-user/host/x86_64/hostdep.h
+index 3b42596..a4fefb5 100644
+--- a/linux-user/host/x86_64/hostdep.h
++++ b/linux-user/host/x86_64/hostdep.h
+@@ -24,7 +24,7 @@ extern char safe_syscall_end[];
+ /* Adjust the signal context to rewind out of safe-syscall if we're in it */
+ static inline void rewind_if_in_safe_syscall(void *puc)
+ {
+- struct ucontext *uc = puc;
++ ucontext_t *uc = puc;
+ greg_t *pcreg = &uc->uc_mcontext.gregs[REG_RIP];
+
+ if (*pcreg > (uintptr_t)safe_syscall_start
+diff --git a/linux-user/signal.c b/linux-user/signal.c
+index d68bd26..cc0c3fc 100644
+--- a/linux-user/signal.c
++++ b/linux-user/signal.c
+@@ -3346,7 +3346,7 @@ static void setup_rt_frame(int sig, struct target_sigaction *ka,
+ *
+ * a0 = signal number
+ * a1 = pointer to siginfo_t
+- * a2 = pointer to struct ucontext
++ * a2 = pointer to ucontext_t
+ *
+ * $25 and PC point to the signal handler, $29 points to the
+ * struct sigframe.
+@@ -3764,7 +3764,7 @@ struct target_signal_frame {
+
+ struct rt_signal_frame {
+ siginfo_t info;
+- struct ucontext uc;
++ ucontext_t uc;
+ uint32_t tramp[2];
+ };
+
+@@ -3980,7 +3980,7 @@ struct rt_signal_frame {
+ siginfo_t *pinfo;
+ void *puc;
+ siginfo_t info;
+- struct ucontext uc;
++ ucontext_t uc;
+ uint16_t retcode[4]; /* Trampoline code. */
+ };
+
+@@ -4515,7 +4515,7 @@ static void setup_rt_frame(int sig, struct target_sigaction *ka,
+ tswap_siginfo(&frame->info, info);
+ }
+
+- /*err |= __clear_user(&frame->uc, offsetof(struct ucontext, uc_mcontext));*/
++ /*err |= __clear_user(&frame->uc, offsetof(ucontext_t, uc_mcontext));*/
+ __put_user(0, &frame->uc.tuc_flags);
+ __put_user(0, &frame->uc.tuc_link);
+ __put_user(target_sigaltstack_used.ss_sp,
+@@ -5007,7 +5007,7 @@ enum {
+
+ struct target_ucontext {
+ target_ulong tuc_flags;
+- target_ulong tuc_link; /* struct ucontext __user * */
++ target_ulong tuc_link; /* ucontext_t __user * */
+ struct target_sigaltstack tuc_stack;
+ #if !defined(TARGET_PPC64)
+ int32_t tuc_pad[7];
+diff --git a/tests/tcg/test-i386.c b/tests/tcg/test-i386.c
+index 0f7b943..9599204 100644
+--- a/tests/tcg/test-i386.c
++++ b/tests/tcg/test-i386.c
+@@ -1720,7 +1720,7 @@ int tab[2];
+
+ void sig_handler(int sig, siginfo_t *info, void *puc)
+ {
+- struct ucontext *uc = puc;
++ ucontext_t *uc = puc;
+
+ printf("si_signo=%d si_errno=%d si_code=%d",
+ info->si_signo, info->si_errno, info->si_code);
+@@ -1912,7 +1912,7 @@ void test_exceptions(void)
+ /* specific precise single step test */
+ void sig_trap_handler(int sig, siginfo_t *info, void *puc)
+ {
+- struct ucontext *uc = puc;
++ ucontext_t *uc = puc;
+ printf("EIP=" FMTLX "\n", (long)uc->uc_mcontext.gregs[REG_EIP]);
+ }
+
+diff --git a/user-exec.c b/user-exec.c
+index a8f95fa..2a975ea 100644
+--- a/user-exec.c
++++ b/user-exec.c
+@@ -167,7 +167,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
+ #elif defined(__OpenBSD__)
+ struct sigcontext *uc = puc;
+ #else
+- struct ucontext *uc = puc;
++ ucontext_t *uc = puc;
+ #endif
+ unsigned long pc;
+ int trapno;
+@@ -222,7 +222,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
+ #elif defined(__OpenBSD__)
+ struct sigcontext *uc = puc;
+ #else
+- struct ucontext *uc = puc;
++ ucontext_t *uc = puc;
+ #endif
+
+ pc = PC_sig(uc);
+@@ -289,7 +289,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
+ #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ ucontext_t *uc = puc;
+ #else
+- struct ucontext *uc = puc;
++ ucontext_t *uc = puc;
+ #endif
+ unsigned long pc;
+ int is_write;
+@@ -316,7 +316,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
+ void *puc)
+ {
+ siginfo_t *info = pinfo;
+- struct ucontext *uc = puc;
++ ucontext_t *uc = puc;
+ uint32_t *pc = uc->uc_mcontext.sc_pc;
+ uint32_t insn = *pc;
+ int is_write = 0;
+@@ -414,7 +414,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
+ #if defined(__NetBSD__)
+ ucontext_t *uc = puc;
+ #else
+- struct ucontext *uc = puc;
++ ucontext_t *uc = puc;
+ #endif
+ unsigned long pc;
+ int is_write;
+@@ -441,7 +441,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
+ int cpu_signal_handler(int host_signum, void *pinfo, void *puc)
+ {
+ siginfo_t *info = pinfo;
+- struct ucontext *uc = puc;
++ ucontext_t *uc = puc;
+ uintptr_t pc = uc->uc_mcontext.pc;
+ uint32_t insn = *(uint32_t *)pc;
+ bool is_write;
+@@ -474,7 +474,7 @@ int cpu_signal_handler(int host_signum, void *pinfo, void *puc)
+ int cpu_signal_handler(int host_signum, void *pinfo, void *puc)
+ {
+ siginfo_t *info = pinfo;
+- struct ucontext *uc = puc;
++ ucontext_t *uc = puc;
+ unsigned long ip;
+ int is_write = 0;
+
+@@ -505,7 +505,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
+ void *puc)
+ {
+ siginfo_t *info = pinfo;
+- struct ucontext *uc = puc;
++ ucontext_t *uc = puc;
+ unsigned long pc;
+ uint16_t *pinsn;
+ int is_write = 0;
+@@ -558,7 +558,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
+ void *puc)
+ {
+ siginfo_t *info = pinfo;
+- struct ucontext *uc = puc;
++ ucontext_t *uc = puc;
+ greg_t pc = uc->uc_mcontext.pc;
+ int is_write;
+
+--
+1.8.3.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/run-ptest b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/run-ptest
index f4b8e97e1..2206b3192 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/run-ptest
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/run-ptest
@@ -1,8 +1,10 @@
#!/bin/sh
#
#This script is used to run qemu test suites
-ptestdir=$(pwd)
-cd tests
+#
+ptestdir=$(dirname "$(readlink -f "$0")")
export SRC_PATH=$ptestdir
-make -k runtest-TESTS | sed '/: OK/ s/^/PASS: /g'
+
+cd $ptestdir/tests
+make -f Makefile.include -k runtest-TESTS | sed '/: OK/ s/^/PASS: /g'
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu_2.7.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu_2.7.0.bb
index 619b8ed44..85aadecf0 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu_2.7.0.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu_2.7.0.bb
@@ -9,6 +9,11 @@ SRC_URI += "file://configure-fix-Darwin-target-detection.patch \
file://no-valgrind.patch \
file://pathlimit.patch \
file://qemu-2.5.0-cflags.patch \
+ file://0001-virtio-zero-vq-inuse-in-virtio_reset.patch \
+ file://0002-fix-CVE-2016-7423.patch \
+ file://0003-fix-CVE-2016-7908.patch \
+ file://0004-fix-CVE-2016-7909.patch \
+ file://04b33e21866412689f18b7ad6daf0a54d8f959a7.patch \
"
SRC_URI_prepend = "http://wiki.qemu-project.org/download/${BP}.tar.bz2"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/0001-macros-add-_gpg_sign_cmd_extra_args.patch b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/0001-macros-add-_gpg_sign_cmd_extra_args.patch
new file mode 100644
index 000000000..eb43a8734
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm/0001-macros-add-_gpg_sign_cmd_extra_args.patch
@@ -0,0 +1,43 @@
+From fa9726ff69f86d6a87c4c4bd7e3d2881999a872a Mon Sep 17 00:00:00 2001
+From: Markus Lehtonen <markus.lehtonen@linux.intel.com>
+Date: Thu, 23 Feb 2017 11:14:20 +0200
+Subject: [PATCH] macros: add %_gpg_sign_cmd_extra_args
+
+Similar to what rpm4 has. This macro can be used to customize the
+gpg command line options when signing packages. This is needed for
+gpg 2.1 which requires "--pinentry-mode loopback" to allow
+non-interactive signing.
+
+Upstream-Status: Pending
+
+Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
+---
+ macros/macros.in | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/macros/macros.in b/macros/macros.in
+index 8bc5840..fda3c66 100644
+--- a/macros/macros.in
++++ b/macros/macros.in
+@@ -524,7 +524,9 @@ $_arbitrary_tags_tests Foo:Bar
+ %_gpg_passphrase_way %{?_gpg_passphrase:--passphrase "%{_gpg_passphrase}"}%{!?_gpg_passphrase:--passphrase-fd 3}
+
+ %__gpg_check_password_cmd %{__gpg} \
+- gpg --batch --no-verbose %{_gpg_passphrase_way} -u "%{_gpg_name}" -so -
++ gpg --batch --no-verbose %{_gpg_passphrase_way} \
++ %{?_gpg_sign_cmd_extra_args:%{_gpg_sign_cmd_extra_args}} \
++ -u "%{_gpg_name}" -so -
+ #%__pgp_check_password_cmd %{__pgp} \
+ # pgp +batchmode=on +verbose=0 "%{_pgp_name}" -sf
+ #%__pgp5_check_password_cmd %{__pgp} \
+@@ -532,6 +534,7 @@ $_arbitrary_tags_tests Foo:Bar
+
+ %__gpg_sign_cmd %{__gpg} \
+ gpg --batch --no-verbose --no-armor %{_gpg_passphrase_way} --no-secmem-warning \
++ %{?_gpg_sign_cmd_extra_args:%{_gpg_sign_cmd_extra_args}} \
+ -u "%{_gpg_name}" -sbo %{__signature_filename} %{__plaintext_filename}
+ #%__pgp_sign_cmd %{__pgp} \
+ # pgp +batchmode=on +verbose=0 +armor=off \
+--
+2.10.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm_5.4.16.bb b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm_5.4.16.bb
index 133239712..497af8e05 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm_5.4.16.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/rpm/rpm_5.4.16.bb
@@ -119,6 +119,7 @@ SRC_URI += " \
file://gcc6-stdlib.patch \
file://0001-system.h-query.c-support-nosignature.patch \
file://rpm-ensure-rpm2cpio-call-rpm-relocation-code.patch \
+ file://0001-macros-add-_gpg_sign_cmd_extra_args.patch \
"
# OE specific changes
@@ -384,10 +385,10 @@ FILES_${PN} = "${bindir}/rpm \
${localstatedir}/lib/wdj \
${bindir}/rpm.real \
${bindir}/rpmconstant.real \
- ${bindir}/rpm2cpio.real \
"
FILES_${PN}-common = "${bindir}/rpm2cpio \
+ ${bindir}/rpm2cpio.real \
${bindir}/gendiff \
${sysconfdir}/rpm \
${localstatedir}/spool/repackage \
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/sgml-common/sgml-common_0.6.3.bb b/import-layers/yocto-poky/meta/recipes-devtools/sgml-common/sgml-common_0.6.3.bb
index 6098673a3..64a6b92c6 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/sgml-common/sgml-common_0.6.3.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/sgml-common/sgml-common_0.6.3.bb
@@ -15,7 +15,7 @@ SECTION = "base"
PR = "r1"
-SRC_URI = "ftp://sources.redhat.com/pub/docbook-tools/new-trials/SOURCES/sgml-common-${PV}.tgz \
+SRC_URI = "https://ftp.osuosl.org/pub/blfs/conglomeration/sgml-common/sgml-common-${PV}.tgz \
file://autohell.patch \
file://license.patch"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/subversion/subversion/0001-fix-svnadmin-create-fail-on-x86.patch b/import-layers/yocto-poky/meta/recipes-devtools/subversion/subversion/0001-fix-svnadmin-create-fail-on-x86.patch
new file mode 100644
index 000000000..d4405287b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/subversion/subversion/0001-fix-svnadmin-create-fail-on-x86.patch
@@ -0,0 +1,56 @@
+From 09475e0befca8d120c957177ce8568fa2209a1a9 Mon Sep 17 00:00:00 2001
+From: Dengke Du <dengke.du@windriver.com>
+Date: Wed, 2 Nov 2016 11:09:44 +0800
+Subject: [PATCH] fix "svnadmin create" fail on x86
+
+When run the following command on x86:
+
+ svnadmin create /var/test_repo
+
+It cause segmentation fault error like the following:
+
+ [16499.751837] svnadmin[21117]: segfault at 83 ip 00000000f74bf7f6 sp 00000000ffdd9b34 error 4 in libc-2.24.so[f7441000+1af000]
+ Segmentation fault (core dumped)
+
+This is because in source code ./subversion/libsvn_fs_fs/low_level.c,
+function svn_fs_fs__unparse_footer, when:
+
+ target arch: x86
+ apr_off_t: 4 bytes
+
+if the "APR_OFF_T_FMT" is "lld", it still use type "apr_off_t" to pass
+data to apr, but in apr source code file apr_snprintf.c the function
+apr_vformatter meet "lld", it would use the:
+
+ i_quad = va_arg(ap, apr_int64_t);
+
+It uses the apr_int64_t to deal data, it read 8 bytes, so the follow-up
+data may be error.
+
+Upstream-Status: Pending
+
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
+---
+ subversion/libsvn_fs_fs/low_level.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/subversion/libsvn_fs_fs/low_level.c b/subversion/libsvn_fs_fs/low_level.c
+index a27bbcc..6ddbe28 100644
+--- a/subversion/libsvn_fs_fs/low_level.c
++++ b/subversion/libsvn_fs_fs/low_level.c
+@@ -250,10 +250,10 @@ svn_fs_fs__unparse_footer(apr_off_t l2p_offset,
+ {
+ return svn_stringbuf_createf(result_pool,
+ "%" APR_OFF_T_FMT " %s %" APR_OFF_T_FMT " %s",
+- l2p_offset,
++ (APR_OFF_T_FMT=="lld") ? (apr_int64_t)l2p_offset : l2p_offset,
+ svn_checksum_to_cstring(l2p_checksum,
+ scratch_pool),
+- p2l_offset,
++ (APR_OFF_T_FMT=="lld") ? (apr_int64_t)p2l_offset : p2l_offset,
+ svn_checksum_to_cstring(p2l_checksum,
+ scratch_pool));
+ }
+--
+2.7.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/subversion/subversion/serfmacro.patch b/import-layers/yocto-poky/meta/recipes-devtools/subversion/subversion/serfmacro.patch
new file mode 100644
index 000000000..9a45cb9a0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/subversion/subversion/serfmacro.patch
@@ -0,0 +1,22 @@
+The existing sed expression can match expressions like
+--sysroot=/some/path/xxx-linux/ which clearly isn't intended and
+injects incorrect paths into LDFLAGS.
+
+Fix this in the same way we address the problem in CFLAGS.
+
+RP 2016/12/7
+Upstream-Status: Pending
+
+Index: subversion-1.9.4/build/ac-macros/serf.m4
+===================================================================
+--- subversion-1.9.4.orig/build/ac-macros/serf.m4
++++ subversion-1.9.4/build/ac-macros/serf.m4
+@@ -171,7 +171,7 @@ AC_DEFUN(SVN_SERF_PKG_CONFIG,
+ SVN_SERF_INCLUDES=[`$PKG_CONFIG $serf_pc_arg --cflags | $SED -e 's/ -D[^ ]*//g' -e 's/^-D[^ ]*//g'`]
+ SVN_SERF_LIBS=`$PKG_CONFIG $serf_pc_arg --libs-only-l`
+ dnl don't use --libs-only-L because then we might miss some options
+- LDFLAGS=["$LDFLAGS `$PKG_CONFIG $serf_pc_arg --libs | $SED -e 's/-l[^ ]*//g'`"]
++ LDFLAGS=["$LDFLAGS `$PKG_CONFIG $serf_pc_arg --libs | $SED -e 's/ -l[^ ]*//g' -e 's/^-l[^ ]*//g'`"]
+ break
+ else
+ AC_MSG_RESULT([no])
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/subversion/subversion_1.9.4.bb b/import-layers/yocto-poky/meta/recipes-devtools/subversion/subversion_1.9.4.bb
index 3ce83c1da..3e3594075 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/subversion/subversion_1.9.4.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/subversion/subversion_1.9.4.bb
@@ -14,6 +14,8 @@ SRC_URI = "${APACHE_MIRROR}/${BPN}/${BPN}-${PV}.tar.bz2 \
file://disable_macos.patch \
file://serf.m4-Regex-modified-to-allow-D-in-paths.patch \
file://0001-Fix-libtool-name-in-configure.ac.patch \
+ file://0001-fix-svnadmin-create-fail-on-x86.patch \
+ file://serfmacro.patch \
"
SRC_URI[md5sum] = "29121a038f87641055a8183f49e9739f"
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/11_mips-link-tool.patch b/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/11_mips-link-tool.patch
deleted file mode 100644
index ecb33b8cb..000000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/11_mips-link-tool.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-Debian fix for MIPS: mmap(0x400000, 32768) failed in UME with error 22 (Invalid argument)
-
- https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=777704
-
-Upstream-Status: Pending
-
-Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
-
-
-Description: Disable the MIPS linker workarounds when using -Ttext-section
-Origin: vendor
-Bug-Debian: http://bugs.debian.org/777704
-Author: James Cowgill <james410@cowgill.org.uk>
-Last-Update: 2015-04-25
-
---- a/coregrind/link_tool_exe_linux.in
-+++ b/coregrind/link_tool_exe_linux.in
-@@ -76,12 +76,13 @@
- my $arch = substr($x, 0, index($x, "'"));
-
- my $extra_args;
--if (($arch eq 'mips') || ($arch eq 'mipsel')
-- || ($arch eq 'mipsisa32r2el')) {
-- $extra_args = "-static -Wl,--section-start=.reginfo=$ala";
--} elsif (($arch eq 'mips64') || ($arch eq 'mips64el') ||
-- ($arch eq 'mipsisa64el')) {
-- $extra_args = "-static -Wl,--section-start=.MIPS.options=$ala";
-+if ($arch =~ /^mips/ && "@FLAG_T_TEXT@" eq '-Ttext') {
-+ # We only need to use the special mips options when using -Ttext
-+ if ($arch =~ /^mips(64|isa64)/) {
-+ $extra_args = "-static -Wl,--section-start=.MIPS.options=$ala";
-+ } else {
-+ $extra_args = "-static -Wl,--section-start=.reginfo=$ala";
-+ }
- } else {
- $extra_args = "-static -Wl,@FLAG_T_TEXT@=$ala";
- }
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/gcc5-port.patch b/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/gcc5-port.patch
deleted file mode 100644
index 76bc82187..000000000
--- a/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/gcc5-port.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-backport fix from upstream to fix build errors with gcc 6
-
-http://valgrind.10908.n7.nabble.com/Valgrind-r15773-in-trunk-configure-ac-drd-tests-std-thread-cpp-drd-tests-std-thread2-cpp-td56109.html
-
-../../../valgrind-3.11.0/drd/tests/std_thread.cpp:30:3: error: '_Impl_base' is not a member of 'std::thread'
- std::thread::_Impl_base* __t = static_cast<std::thread::_Impl_base*>(__p);
- ^~~
-../../../valgrind-3.11.0/drd/tests/std_thread.cpp:30:28: error: '__t' was not declared in this scope
- std::thread::_Impl_base* __t = static_cast<std::thread::_Impl_base*>(__p);
- ^~~
-../../../valgrind-3.11.0/drd/tests/std_thread.cpp:30:59: error: '_Impl_base' in 'class std::thread' does not name a type
- std::thread::_Impl_base* __t = static_cast<std::thread::_Impl_base*>(__p);
- ^~~~~~~~~~
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-Upstream-Status: Backport
-
-Index: configure.ac
-===================================================================
---- a/configure.ac (revision 15772)
-+++ b/configure.ac (revision 15773)
-@@ -160,7 +160,7 @@
- icc-1[[3-9]].*)
- AC_MSG_RESULT([ok (ICC version ${gcc_version})])
- ;;
-- notclang-[[3-9]].*|notclang-[[1-9][0-9]]*)
-+ notclang-[[3-9]]|notclang-[[3-9]].*|notclang-[[1-9][0-9]]*)
- AC_MSG_RESULT([ok (${gcc_version})])
- ;;
- clang-2.9|clang-[[3-9]].*|clang-[[1-9][0-9]]*)
-Index: drd/tests/std_thread2.cpp
-===================================================================
---- a/drd/tests/std_thread2.cpp (revision 15772)
-+++ b/drd/tests/std_thread2.cpp (revision 15773)
-@@ -26,6 +26,7 @@
- return 0;
- }
-
-+#if defined(__GNUC__) && __GNUC__ -0 < 6
- //
- // From libstdc++-v3/src/c++11/thread.cc
- //
-@@ -70,3 +71,4 @@
- }
- }
- }
-+#endif
-Index: drd/tests/std_thread.cpp
-===================================================================
---- a/drd/tests/std_thread.cpp (revision 15772)
-+++ b/drd/tests/std_thread.cpp (revision 15773)
-@@ -21,6 +21,7 @@
- return 0;
- }
-
-+#if defined(__GNUC__) && __GNUC__ -0 < 6
- //
- // From libstdc++-v3/src/c++11/thread.cc
- //
-@@ -65,3 +66,4 @@
- }
- }
- }
-+#endif
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/valgrind-make-ld-XXX.so-strlen-intercept-optional.patch b/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/valgrind-make-ld-XXX.so-strlen-intercept-optional.patch
new file mode 100644
index 000000000..d04297dca
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind/valgrind-make-ld-XXX.so-strlen-intercept-optional.patch
@@ -0,0 +1,45 @@
+From 005bd11809a1ce65e9f2c28e884354a4741650b9 Mon Sep 17 00:00:00 2001
+From: Andre McCurdy <armccurdy@gmail.com>
+Date: Tue, 13 Dec 2016 11:29:55 +0800
+Subject: [PATCH] make ld-XXX.so strlen intercept optional
+
+Hack: Depending on how glibc was compiled (e.g. optimised for size or
+built with _FORTIFY_SOURCE enabled) the strlen symbol might not be
+found in ld-XXX.so. Therefore although we should still try to
+intercept it, don't make it mandatory to do so.
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ coregrind/m_redir.c | 13 ++++++++++++-
+ 1 file changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/coregrind/m_redir.c b/coregrind/m_redir.c
+index ff35009..d7d6816 100644
+--- a/coregrind/m_redir.c
++++ b/coregrind/m_redir.c
+@@ -1275,7 +1275,18 @@ static void add_hardwired_spec (const HChar* sopatt, const HChar* fnpatt,
+ spec->to_addr = to_addr;
+ spec->isWrap = False;
+ spec->isGlobal = False;
+- spec->mandatory = mandatory;
++
++ /* Hack: Depending on how glibc was compiled (e.g. optimised for size or
++ built with _FORTIFY_SOURCE enabled) the strlen symbol might not be found.
++ Therefore although we should still try to intercept it, don't make it
++ mandatory to do so. We over-ride "mandatory" here to avoid the need to
++ patch the many different architecture specific callers to
++ add_hardwired_spec(). */
++ if (0==VG_(strcmp)("strlen", fnpatt))
++ spec->mandatory = NULL;
++ else
++ spec->mandatory = mandatory;
++
+ /* VARIABLE PARTS */
+ spec->mark = False; /* not significant */
+ spec->done = False; /* not significant */
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind_3.11.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind_3.12.0.bb
index 42fd27f53..d82541b84 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind_3.11.0.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/valgrind/valgrind_3.12.0.bb
@@ -16,20 +16,19 @@ SRC_URI = "http://www.valgrind.org/downloads/valgrind-${PV}.tar.bz2 \
file://fixed-perl-path.patch \
file://Added-support-for-PPC-instructions-mfatbu-mfatbl.patch \
file://run-ptest \
- file://11_mips-link-tool.patch \
file://0002-remove-rpath.patch \
file://0004-Fix-out-of-tree-builds.patch \
file://0005-Modify-vg_test-wrapper-to-support-PTEST-formats.patch \
file://0001-Remove-tests-that-fail-to-build-on-some-PPC32-config.patch \
file://use-appropriate-march-mcpu-mfpu-for-ARM-test-apps.patch \
file://avoid-neon-for-targets-which-don-t-support-it.patch \
- file://gcc5-port.patch \
+ file://valgrind-make-ld-XXX.so-strlen-intercept-optional.patch \
"
SRC_URI_append_libc-musl = "\
file://0001-fix-build-for-musl-targets.patch \
"
-SRC_URI[md5sum] = "4ea62074da73ae82e0162d6550d3f129"
-SRC_URI[sha256sum] = "6c396271a8c1ddd5a6fb9abe714ea1e8a86fce85b30ab26b4266aeb4c2413b42"
+SRC_URI[md5sum] = "6eb03c0c10ea917013a7622e483d61bb"
+SRC_URI[sha256sum] = "67ca4395b2527247780f36148b084f5743a68ab0c850cb43e4a5b4b012cf76a1"
COMPATIBLE_HOST = '(i.86|x86_64|arm|aarch64|mips|powerpc|powerpc64).*-linux'
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/xmlto/xmlto_0.0.28.bb b/import-layers/yocto-poky/meta/recipes-devtools/xmlto/xmlto_0.0.28.bb
index aaaeb6eb2..6072a7b1b 100644
--- a/import-layers/yocto-poky/meta/recipes-devtools/xmlto/xmlto_0.0.28.bb
+++ b/import-layers/yocto-poky/meta/recipes-devtools/xmlto/xmlto_0.0.28.bb
@@ -1,11 +1,11 @@
SUMMARY = "A shell-script tool for converting XML files to various formats"
-HOMEPAGE = "https://fedorahosted.org/xmlto/"
+HOMEPAGE = "https://releases.pagure.org/xmlto/"
SECTION = "docs/xmlto"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
-SRC_URI = "https://fedorahosted.org/releases/x/m/xmlto/xmlto-${PV}.tar.gz \
+SRC_URI = "https://releases.pagure.org/xmlto/xmlto-${PV}.tar.gz \
file://configure.in-drop-the-test-of-xmllint-and-xsltproc.patch \
file://catalog.xml \
"