summaryrefslogtreecommitdiffstats
path: root/external/poky/meta/recipes-devtools/valgrind/valgrind
diff options
context:
space:
mode:
authorToshikazuOhiwa <toshikazu_ohiwa@mail.toyota.co.jp>2020-03-30 09:24:26 +0900
committerToshikazuOhiwa <toshikazu_ohiwa@mail.toyota.co.jp>2020-03-30 09:24:26 +0900
commit5b80bfd7bffd4c20d80b7c70a7130529e9a755dd (patch)
treeb4bb18dcd1487dbf1ea8127e5671b7bb2eded033 /external/poky/meta/recipes-devtools/valgrind/valgrind
parent706ad73eb02caf8532deaf5d38995bd258725cb8 (diff)
agl-basesystem
Diffstat (limited to 'external/poky/meta/recipes-devtools/valgrind/valgrind')
-rw-r--r--external/poky/meta/recipes-devtools/valgrind/valgrind/0001-Guard-against-__GLIBC_PREREQ-for-musl-libc.patch36
-rw-r--r--external/poky/meta/recipes-devtools/valgrind/valgrind/0001-Make-local-functions-static-to-avoid-assembler-error.patch182
-rw-r--r--external/poky/meta/recipes-devtools/valgrind/valgrind/0001-Remove-tests-that-fail-to-build-on-some-PPC32-config.patch51
-rw-r--r--external/poky/meta/recipes-devtools/valgrind/valgrind/0001-fix-opcode-not-supported-on-mips32-linux.patch82
-rw-r--r--external/poky/meta/recipes-devtools/valgrind/valgrind/0001-makefiles-Drop-setting-mcpu-to-cortex-a8-on-arm-arch.patch108
-rw-r--r--external/poky/meta/recipes-devtools/valgrind/valgrind/0001-memcheck-arm64-Define-__THROW-if-not-already-defined.patch32
-rw-r--r--external/poky/meta/recipes-devtools/valgrind/valgrind/0001-sigqueue-Rename-_sifields-to-__si_fields-on-musl.patch31
-rw-r--r--external/poky/meta/recipes-devtools/valgrind/valgrind/0001-str_tester.c-Limit-rawmemchr-test-to-glibc.patch39
-rw-r--r--external/poky/meta/recipes-devtools/valgrind/valgrind/0002-context-APIs-are-not-available-on-musl.patch52
-rw-r--r--external/poky/meta/recipes-devtools/valgrind/valgrind/0002-memcheck-x86-Define-__THROW-if-not-defined.patch32
-rw-r--r--external/poky/meta/recipes-devtools/valgrind/valgrind/0003-correct-include-directive-path-for-config.h.patch45
-rw-r--r--external/poky/meta/recipes-devtools/valgrind/valgrind/0003-tests-seg_override-Replace-__modify_ldt-with-syscall.patch68
-rw-r--r--external/poky/meta/recipes-devtools/valgrind/valgrind/0004-Fix-out-of-tree-builds.patch188
-rw-r--r--external/poky/meta/recipes-devtools/valgrind/valgrind/0004-pth_atfork1.c-Define-error-API-for-musl.patch37
-rw-r--r--external/poky/meta/recipes-devtools/valgrind/valgrind/0005-Modify-vg_test-wrapper-to-support-PTEST-formats.patch252
-rw-r--r--external/poky/meta/recipes-devtools/valgrind/valgrind/0005-tc20_verifywrap.c-Fake-__GLIBC_PREREQ-with-musl.patch30
-rw-r--r--external/poky/meta/recipes-devtools/valgrind/valgrind/0006-pth_detached3.c-Dereference-pthread_t-before-adding-.patch32
-rw-r--r--external/poky/meta/recipes-devtools/valgrind/valgrind/Added-support-for-PPC-instructions-mfatbu-mfatbl.patch96
-rw-r--r--external/poky/meta/recipes-devtools/valgrind/valgrind/avoid-neon-for-targets-which-don-t-support-it.patch33
-rw-r--r--external/poky/meta/recipes-devtools/valgrind/valgrind/fixed-perl-path.patch78
-rwxr-xr-xexternal/poky/meta/recipes-devtools/valgrind/valgrind/run-ptest25
-rw-r--r--external/poky/meta/recipes-devtools/valgrind/valgrind/use-appropriate-march-mcpu-mfpu-for-ARM-test-apps.patch44
-rw-r--r--external/poky/meta/recipes-devtools/valgrind/valgrind/valgrind-make-ld-XXX.so-strlen-intercept-optional.patch45
23 files changed, 1618 insertions, 0 deletions
diff --git a/external/poky/meta/recipes-devtools/valgrind/valgrind/0001-Guard-against-__GLIBC_PREREQ-for-musl-libc.patch b/external/poky/meta/recipes-devtools/valgrind/valgrind/0001-Guard-against-__GLIBC_PREREQ-for-musl-libc.patch
new file mode 100644
index 00000000..3efe65a9
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/valgrind/valgrind/0001-Guard-against-__GLIBC_PREREQ-for-musl-libc.patch
@@ -0,0 +1,36 @@
+From 1b5b6f827ac1153a41fc93e78bf34ccdf5720b9b Mon Sep 17 00:00:00 2001
+From: Randy MacLeod <Randy.MacLeod@windriver.com>
+Date: Fri, 19 Oct 2018 10:31:12 -0400
+Subject: [PATCH] Guard against __GLIBC_PREREQ for musl libc
+
+Upstream-Status: Pending
+
+Signed-off-by: Randy MacLeod <Randy.MacLeod@windriver.com>
+---
+ memcheck/tests/linux/sys-statx.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/memcheck/tests/linux/sys-statx.c b/memcheck/tests/linux/sys-statx.c
+index fe9f9ba45..473c2cd7f 100644
+--- a/memcheck/tests/linux/sys-statx.c
++++ b/memcheck/tests/linux/sys-statx.c
+@@ -7,11 +7,16 @@
+ #include <assert.h>
+ #include <string.h>
+ #include <sys/syscall.h>
++
++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
+ #if __GLIBC_PREREQ(2,28)
+ /* struct statx provided in sys/stat.h */
+ #else
+ #include <linux/stat.h>
+ #endif
++#else
++#include <linux/stat.h>
++#endif
+ #include <errno.h>
+
+ int check_stat2;
+--
+2.17.0
+
diff --git a/external/poky/meta/recipes-devtools/valgrind/valgrind/0001-Make-local-functions-static-to-avoid-assembler-error.patch b/external/poky/meta/recipes-devtools/valgrind/valgrind/0001-Make-local-functions-static-to-avoid-assembler-error.patch
new file mode 100644
index 00000000..45e5ea3e
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/valgrind/valgrind/0001-Make-local-functions-static-to-avoid-assembler-error.patch
@@ -0,0 +1,182 @@
+From 2155c1b2cf00e744e280c493eb74bf457dfcc3b1 Mon Sep 17 00:00:00 2001
+From: Randy MacLeod <Randy.MacLeod@windriver.com>
+Date: Sun, 21 Oct 2018 15:09:31 -0400
+Subject: [PATCH] Make local functions static to avoid assembler error
+
+Avoid mips32 x-compiler warnings such as:
+
+| ../../../valgrind-3.14.0/helgrind/tests/annotate_hbefore.c:360:6: warning: no previous prototype for 'do_signal' [-Wmissing-prototypes]
+| void do_signal ( UWord* w )
+| ^~~~~~~~~
+
+by making functions and global variables that are file scope be static
+and more importantly also avoid an assembler error:
+
+/tmp/cce22iiw.s: Assembler messages:
+/tmp/cce22iiw.s:446: Error: symbol `exit_0' is already defined
+/tmp/cce22iiw.s:448: Error: symbol `exit' is already defined
+/tmp/cce22iiw.s:915: Error: symbol `exit_0' is already defined
+/tmp/cce22iiw.s:917: Error: symbol `exit' is already defined
+
+Upstream-Status: Pending
+
+Signed-off-by: Randy MacLeod <Randy.MacLeod@windriver.com>
+---
+ helgrind/tests/annotate_hbefore.c | 34 +++++++++++++++----------------
+ 1 file changed, 17 insertions(+), 17 deletions(-)
+
+diff --git a/helgrind/tests/annotate_hbefore.c b/helgrind/tests/annotate_hbefore.c
+index e311714f7..f55514e45 100644
+--- a/helgrind/tests/annotate_hbefore.c
++++ b/helgrind/tests/annotate_hbefore.c
+@@ -24,7 +24,7 @@ typedef unsigned long int UWord;
+
+ // ppc64
+ /* return 1 if success, 0 if failure */
+-UWord do_acasW ( UWord* addr, UWord expected, UWord nyu )
++static UWord do_acasW ( UWord* addr, UWord expected, UWord nyu )
+ {
+ UWord old, success;
+
+@@ -57,7 +57,7 @@ UWord do_acasW ( UWord* addr, UWord expected, UWord nyu )
+
+ // ppc32
+ /* return 1 if success, 0 if failure */
+-UWord do_acasW ( UWord* addr, UWord expected, UWord nyu )
++static UWord do_acasW ( UWord* addr, UWord expected, UWord nyu )
+ {
+ UWord old, success;
+
+@@ -90,7 +90,7 @@ UWord do_acasW ( UWord* addr, UWord expected, UWord nyu )
+
+ // amd64
+ /* return 1 if success, 0 if failure */
+-UWord do_acasW ( UWord* addr, UWord expected, UWord nyu )
++static UWord do_acasW ( UWord* addr, UWord expected, UWord nyu )
+ {
+ UWord block[4] = { (UWord)addr, expected, nyu, 2 };
+ __asm__ __volatile__(
+@@ -113,7 +113,7 @@ UWord do_acasW ( UWord* addr, UWord expected, UWord nyu )
+
+ // x86
+ /* return 1 if success, 0 if failure */
+-UWord do_acasW ( UWord* addr, UWord expected, UWord nyu )
++static UWord do_acasW ( UWord* addr, UWord expected, UWord nyu )
+ {
+ UWord block[4] = { (UWord)addr, expected, nyu, 2 };
+ __asm__ __volatile__(
+@@ -138,7 +138,7 @@ UWord do_acasW ( UWord* addr, UWord expected, UWord nyu )
+
+ // arm
+ /* return 1 if success, 0 if failure */
+-UWord do_acasW ( UWord* addr, UWord expected, UWord nyu )
++static UWord do_acasW ( UWord* addr, UWord expected, UWord nyu )
+ {
+ UWord old, success;
+ UWord block[2] = { (UWord)addr, nyu };
+@@ -171,7 +171,7 @@ UWord do_acasW ( UWord* addr, UWord expected, UWord nyu )
+
+ // arm64
+ /* return 1 if success, 0 if failure */
+-UWord do_acasW ( UWord* addr, UWord expected, UWord nyu )
++static UWord do_acasW ( UWord* addr, UWord expected, UWord nyu )
+ {
+ UWord old, success;
+ UWord block[2] = { (UWord)addr, nyu };
+@@ -204,7 +204,7 @@ UWord do_acasW ( UWord* addr, UWord expected, UWord nyu )
+
+ // s390x
+ /* return 1 if success, 0 if failure */
+-UWord do_acasW(UWord* addr, UWord expected, UWord nyu )
++static UWord do_acasW(UWord* addr, UWord expected, UWord nyu )
+ {
+ int cc;
+
+@@ -223,7 +223,7 @@ UWord do_acasW(UWord* addr, UWord expected, UWord nyu )
+
+ // mips32
+ /* return 1 if success, 0 if failure */
+-UWord do_acasW ( UWord* addr, UWord expected, UWord nyu )
++static UWord do_acasW ( UWord* addr, UWord expected, UWord nyu )
+ {
+ UWord success;
+ UWord block[3] = { (UWord)addr, nyu, expected};
+@@ -256,7 +256,7 @@ UWord do_acasW ( UWord* addr, UWord expected, UWord nyu )
+
+ // mips64
+ /* return 1 if success, 0 if failure */
+-UWord do_acasW ( UWord* addr, UWord expected, UWord nyu )
++static UWord do_acasW ( UWord* addr, UWord expected, UWord nyu )
+ {
+ UWord success;
+ UWord block[3] = { (UWord)addr, nyu, expected};
+@@ -287,7 +287,7 @@ UWord do_acasW ( UWord* addr, UWord expected, UWord nyu )
+
+ #endif
+
+-void atomic_incW ( UWord* w )
++static void atomic_incW ( UWord* w )
+ {
+ while (1) {
+ UWord old = *w;
+@@ -301,7 +301,7 @@ void atomic_incW ( UWord* w )
+
+ #define NNN 1000000
+
+-void* thread_fn ( void* arg )
++static void* thread_fn ( void* arg )
+ {
+ UWord* w = (UWord*)arg;
+ int i;
+@@ -331,10 +331,10 @@ int main ( void )
+
+ #endif
+
+-int shared_var = 0; // is not raced upon
++static int shared_var = 0; // is not raced upon
+
+
+-void delayXms ( int i )
++static void delayXms ( int i )
+ {
+ struct timespec ts = { 0, 1 * 1000 * 1000 };
+ // We do the sleep in small pieces to have scheduling
+@@ -348,7 +348,7 @@ void delayXms ( int i )
+ }
+ }
+
+-void do_wait ( UWord* w )
++static void do_wait ( UWord* w )
+ {
+ UWord w0 = *w;
+ UWord volatile * wV = w;
+@@ -357,7 +357,7 @@ void do_wait ( UWord* w )
+ ANNOTATE_HAPPENS_AFTER(w);
+ }
+
+-void do_signal ( UWord* w )
++static void do_signal ( UWord* w )
+ {
+ ANNOTATE_HAPPENS_BEFORE(w);
+ atomic_incW(w);
+@@ -365,7 +365,7 @@ void do_signal ( UWord* w )
+
+
+
+-void* thread_fn1 ( void* arg )
++static void* thread_fn1 ( void* arg )
+ {
+ UWord* w = (UWord*)arg;
+ delayXms(500); // ensure t2 gets to its wait first
+@@ -376,7 +376,7 @@ void* thread_fn1 ( void* arg )
+ return NULL;
+ }
+
+-void* thread_fn2 ( void* arg )
++static void* thread_fn2 ( void* arg )
+ {
+ UWord* w = (UWord*)arg;
+ do_wait(w); // wait for h-b edge from first thread
+--
+2.17.0
+
diff --git a/external/poky/meta/recipes-devtools/valgrind/valgrind/0001-Remove-tests-that-fail-to-build-on-some-PPC32-config.patch b/external/poky/meta/recipes-devtools/valgrind/valgrind/0001-Remove-tests-that-fail-to-build-on-some-PPC32-config.patch
new file mode 100644
index 00000000..a78e1953
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/valgrind/valgrind/0001-Remove-tests-that-fail-to-build-on-some-PPC32-config.patch
@@ -0,0 +1,51 @@
+From 9762fd23e1f1db66d4b977c694a17d3bca3fe99a Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 8 Jan 2016 16:36:29 +0200
+Subject: [PATCH] Remove tests that fail to build on some PPC32 configurations
+
+Failures are documented here:
+http://errors.yoctoproject.org/Errors/Search/?items=10&query=862d702fbb99e484631315aa44b9e46f8fc567da&filter=valgrind&type=recipe
+
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+Upstream-Status: Pending
+---
+ memcheck/tests/ppc32/Makefile.am | 2 +-
+ none/tests/ppc32/Makefile.am | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/memcheck/tests/ppc32/Makefile.am b/memcheck/tests/ppc32/Makefile.am
+index 26b95a2..8f05743 100644
+--- a/memcheck/tests/ppc32/Makefile.am
++++ b/memcheck/tests/ppc32/Makefile.am
+@@ -10,7 +10,7 @@ EXTRA_DIST = $(noinst_SCRIPTS) \
+ power_ISA2_07.stderr.exp power_ISA2_07.vgtest
+
+ check_PROGRAMS = \
+- power_ISA2_05 power_ISA2_07
++ power_ISA2_07
+
+ power_ISA2_05_CFLAGS = $(AM_CFLAGS) $(WERROR) -Winline -Wall -Wshadow -g \
+ -I$(top_srcdir)/include @FLAG_M32@
+diff --git a/none/tests/ppc32/Makefile.am b/none/tests/ppc32/Makefile.am
+index 196239e..0fe3425 100644
+--- a/none/tests/ppc32/Makefile.am
++++ b/none/tests/ppc32/Makefile.am
+@@ -50,13 +50,13 @@ EXTRA_DIST = \
+
+ check_PROGRAMS = \
+ allexec \
+- lsw jm-insns round \
++ lsw \
+ test_isa_2_06_part1 test_isa_2_06_part2 test_isa_2_06_part3 \
+ test_dfp1 test_dfp2 test_dfp3 test_dfp4 test_dfp5 \
+ test_isa_2_07_part1 test_isa_2_07_part2 \
+ test_tm test_touch_tm ldst_multiple data-cache-instructions \
+ test_fx test_gx \
+- testVMX twi tw xlc_dbl_u32 power5+_round power6_bcmp \
++ twi tw xlc_dbl_u32 power6_bcmp \
+ bug129390-ppc32 bug139050-ppc32 \
+ ldstrev mftocrf mcrfs
+
+--
+2.6.4
+
diff --git a/external/poky/meta/recipes-devtools/valgrind/valgrind/0001-fix-opcode-not-supported-on-mips32-linux.patch b/external/poky/meta/recipes-devtools/valgrind/valgrind/0001-fix-opcode-not-supported-on-mips32-linux.patch
new file mode 100644
index 00000000..39b624d9
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/valgrind/valgrind/0001-fix-opcode-not-supported-on-mips32-linux.patch
@@ -0,0 +1,82 @@
+From fb5362f205b37c5060fcd764a7ed393abe4f2f3d Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Fri, 27 Jul 2018 17:39:37 +0800
+Subject: [PATCH 1/2] fix opcode not supported on mips32-linux
+
+While build tests(`make check') on mips32-linux, there are
+serial failures such as:
+[snip]
+| mips-wrsmllib32-linux-gcc -meb -mabi=32 -mhard-float -c
+-o atomic_incs-atomic_incs.o `test -f 'atomic_incs.c' || echo
+'../../../valgrind-3.13.0/memcheck/tests/'`atomic_incs.c
+| /tmp/ccqrmINN.s: Assembler messages:
+| /tmp/ccqrmINN.s:247: Error: opcode not supported on this
+processor: mips1 (mips1) `ll $t3,0($t1)'
+| /tmp/ccqrmINN.s:249: Error: opcode not supported on this
+processor: mips1 (mips1) `sc $t3,0($t1)'
+[snip]
+
+Since the following commit applied, it defines CLFAGS for mips32,
+but missed to pass them to tests which caused the above failure
+...
+3e344c57f Merge in a port for mips32-linux
+...
+
+Upstream-Status: Submitted [https://bugs.kde.org/show_bug.cgi?id=396905]
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ helgrind/tests/Makefile.am | 5 +++++
+ memcheck/tests/Makefile.am | 5 +++++
+ none/tests/mips32/Makefile.am | 4 ++++
+ 3 files changed, 14 insertions(+)
+
+diff --git a/helgrind/tests/Makefile.am b/helgrind/tests/Makefile.am
+index ad1af191a..6209d35a7 100644
+--- a/helgrind/tests/Makefile.am
++++ b/helgrind/tests/Makefile.am
+@@ -214,6 +214,11 @@ check_PROGRAMS += annotate_rwlock
+ endif
+
+ AM_CFLAGS += $(AM_FLAG_M3264_PRI)
++
++if VGCONF_PLATFORMS_INCLUDE_MIPS32_LINUX
++AM_CFLAGS += $(AM_CFLAGS_MIPS32_LINUX)
++endif
++
+ AM_CXXFLAGS += $(AM_FLAG_M3264_PRI)
+
+ LDADD = -lpthread
+diff --git a/memcheck/tests/Makefile.am b/memcheck/tests/Makefile.am
+index 84e49405f..aff861a32 100644
+--- a/memcheck/tests/Makefile.am
++++ b/memcheck/tests/Makefile.am
+@@ -443,6 +443,11 @@ check_PROGRAMS += reach_thread_register
+ endif
+
+ AM_CFLAGS += $(AM_FLAG_M3264_PRI)
++
++if VGCONF_PLATFORMS_INCLUDE_MIPS32_LINUX
++AM_CFLAGS += $(AM_CFLAGS_MIPS32_LINUX)
++endif
++
+ AM_CXXFLAGS += $(AM_FLAG_M3264_PRI)
+
+ if VGCONF_PLATFORMS_INCLUDE_ARM_LINUX
+diff --git a/none/tests/mips32/Makefile.am b/none/tests/mips32/Makefile.am
+index d11591d45..602cd26f6 100644
+--- a/none/tests/mips32/Makefile.am
++++ b/none/tests/mips32/Makefile.am
+@@ -99,6 +99,10 @@ check_PROGRAMS = \
+ round_fpu64 \
+ fpu_branches
+
++if VGCONF_PLATFORMS_INCLUDE_MIPS32_LINUX
++AM_CFLAGS += $(AM_CFLAGS_MIPS32_LINUX)
++endif
++
+ AM_CFLAGS += @FLAG_M32@
+ AM_CXXFLAGS += @FLAG_M32@
+ AM_CCASFLAGS += @FLAG_M32@
+--
+2.17.1
+
diff --git a/external/poky/meta/recipes-devtools/valgrind/valgrind/0001-makefiles-Drop-setting-mcpu-to-cortex-a8-on-arm-arch.patch b/external/poky/meta/recipes-devtools/valgrind/valgrind/0001-makefiles-Drop-setting-mcpu-to-cortex-a8-on-arm-arch.patch
new file mode 100644
index 00000000..9f1da7ba
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/valgrind/valgrind/0001-makefiles-Drop-setting-mcpu-to-cortex-a8-on-arm-arch.patch
@@ -0,0 +1,108 @@
+From 715cf122388f3527afa5649cebf9f1522c240693 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 20 Apr 2017 10:11:16 -0700
+Subject: [PATCH] makefiles: Drop setting -mcpu to cortex-a8 on arm
+ architecture
+
+We can not assume that all arches armv7+ are cortex-a8 only
+it fails to build for rpi which is armv7ve based (cortex-a8) cpu
+implementation.
+Fixes
+| cc1: warning: switch -mcpu=cortex-a8 conflicts with -march=armv7ve switch
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Makefile.all.am | 6 +++---
+ helgrind/tests/Makefile.am | 6 +++---
+ none/tests/arm/Makefile.am | 18 +++++++++---------
+ 3 files changed, 15 insertions(+), 15 deletions(-)
+
+diff --git a/Makefile.all.am b/Makefile.all.am
+index 02059a3..c7c4700 100644
+--- a/Makefile.all.am
++++ b/Makefile.all.am
+@@ -197,11 +197,11 @@ AM_CCASFLAGS_PPC64LE_LINUX = @FLAG_M64@ -g
+
+ AM_FLAG_M3264_ARM_LINUX = @FLAG_M32@
+ AM_CFLAGS_ARM_LINUX = @FLAG_M32@ \
+- $(AM_CFLAGS_BASE) -marm -mcpu=cortex-a8
++ $(AM_CFLAGS_BASE) -marm
+ AM_CFLAGS_PSO_ARM_LINUX = @FLAG_M32@ $(AM_CFLAGS_BASE) \
+- -marm -mcpu=cortex-a8 $(AM_CFLAGS_PSO_BASE)
++ -marm $(AM_CFLAGS_PSO_BASE)
+ AM_CCASFLAGS_ARM_LINUX = @FLAG_M32@ \
+- -marm -mcpu=cortex-a8 -g
++ -marm -g
+
+ AM_FLAG_M3264_ARM64_LINUX = @FLAG_M64@
+ AM_CFLAGS_ARM64_LINUX = @FLAG_M64@ $(AM_CFLAGS_BASE)
+diff --git a/helgrind/tests/Makefile.am b/helgrind/tests/Makefile.am
+index df82169..07eb66a 100644
+--- a/helgrind/tests/Makefile.am
++++ b/helgrind/tests/Makefile.am
+@@ -189,9 +189,9 @@ if ! VGCONF_PLATFORMS_INCLUDE_X86_DARWIN
+ endif
+
+ if VGCONF_PLATFORMS_INCLUDE_ARM_LINUX
+-annotate_hbefore_CFLAGS = $(AM_CFLAGS) -mcpu=cortex-a8
+-tc07_hbl1_CFLAGS = $(AM_CFLAGS) -mcpu=cortex-a8
+-tc08_hbl2_CFLAGS = $(AM_CFLAGS) -mcpu=cortex-a8
++annotate_hbefore_CFLAGS = $(AM_CFLAGS)
++tc07_hbl1_CFLAGS = $(AM_CFLAGS)
++tc08_hbl2_CFLAGS = $(AM_CFLAGS)
+ else
+ annotate_hbefore_CFLAGS = $(AM_CFLAGS)
+ tc07_hbl1_CFLAGS = $(AM_CFLAGS)
+diff --git a/none/tests/arm/Makefile.am b/none/tests/arm/Makefile.am
+index 024eb6d..ccecb90 100644
+--- a/none/tests/arm/Makefile.am
++++ b/none/tests/arm/Makefile.am
+@@ -52,10 +52,10 @@ allexec_CFLAGS = $(AM_CFLAGS) @FLAG_W_NO_NONNULL@
+ # need special helping w.r.t -mfpu and -mfloat-abi, though.
+ # Also force -O0 since -O takes hundreds of MB of memory
+ # for v6intThumb.c.
+-v6intARM_CFLAGS = $(AM_CFLAGS) -g -O0 -mcpu=cortex-a8 -marm
+-v6intThumb_CFLAGS = $(AM_CFLAGS) -g -O0 -mcpu=cortex-a8 -mthumb
++v6intARM_CFLAGS = $(AM_CFLAGS) -g -O0 -marm
++v6intThumb_CFLAGS = $(AM_CFLAGS) -g -O0 -mthumb
+
+-v6media_CFLAGS = $(AM_CFLAGS) -g -O0 -mcpu=cortex-a8 -mthumb
++v6media_CFLAGS = $(AM_CFLAGS) -g -O0 -mthumb
+
+ v8crypto_a_CFLAGS = $(AM_CFLAGS) -g -O0 -mfpu=crypto-neon-fp-armv8 -marm
+ v8crypto_t_CFLAGS = $(AM_CFLAGS) -g -O0 -mfpu=crypto-neon-fp-armv8 -mthumb
+@@ -65,23 +65,23 @@ v8memory_a_CFLAGS = $(AM_CFLAGS) -g -O0 \
+ v8memory_t_CFLAGS = $(AM_CFLAGS) -g -O0 \
+ -march=armv8-a -mfpu=crypto-neon-fp-armv8 -mthumb
+
+-vfp_CFLAGS = $(AM_CFLAGS) -g -O0 -mcpu=cortex-a8 \
++vfp_CFLAGS = $(AM_CFLAGS) -g -O0 \
+ -mfpu=neon \
+ -mthumb
+
+
+-neon128_CFLAGS = $(AM_CFLAGS) -g -O0 -mcpu=cortex-a8 \
++neon128_CFLAGS = $(AM_CFLAGS) -g -O0 \
+ -mfpu=neon \
+ -mthumb
+
+-neon64_CFLAGS = $(AM_CFLAGS) -g -O0 -mcpu=cortex-a8 \
++neon64_CFLAGS = $(AM_CFLAGS) -g -O0 \
+ -mfpu=neon \
+ -mthumb
+
+ intdiv_CFLAGS = $(AM_CFLAGS) -g -march=armv7ve -mcpu=cortex-a15 -mthumb
+-ldrt_CFLAGS = $(AM_CFLAGS) -g -mcpu=cortex-a8 -mthumb
+-ldrt_arm_CFLAGS = $(AM_CFLAGS) -g -mcpu=cortex-a8 -marm
++ldrt_CFLAGS = $(AM_CFLAGS) -g -mthumb
++ldrt_arm_CFLAGS = $(AM_CFLAGS) -g -marm
+
+-vcvt_fixed_float_VFP_CFLAGS = $(AM_CFLAGS) -g -mcpu=cortex-a8 -mfpu=vfpv3
++vcvt_fixed_float_VFP_CFLAGS = $(AM_CFLAGS) -g -mfpu=vfpv3
+
+ vfpv4_fma_CFLAGS = $(AM_CFLAGS) -g -O0 -march=armv7ve -mcpu=cortex-a15 -mfpu=vfpv4 -marm
+--
+2.12.2
+
diff --git a/external/poky/meta/recipes-devtools/valgrind/valgrind/0001-memcheck-arm64-Define-__THROW-if-not-already-defined.patch b/external/poky/meta/recipes-devtools/valgrind/valgrind/0001-memcheck-arm64-Define-__THROW-if-not-already-defined.patch
new file mode 100644
index 00000000..a48d7db0
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/valgrind/valgrind/0001-memcheck-arm64-Define-__THROW-if-not-already-defined.patch
@@ -0,0 +1,32 @@
+From 3409dc35c15bb14c8a525239806322648e079ab1 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 5 Jul 2017 17:12:43 -0700
+Subject: [PATCH 1/3] memcheck/arm64: Define __THROW if not already defined
+
+Helps compiling with musl where __THROW is not available
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted
+
+ memcheck/tests/arm64-linux/scalar.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/memcheck/tests/arm64-linux/scalar.h b/memcheck/tests/arm64-linux/scalar.h
+index 9008816..8ef050f 100644
+--- a/memcheck/tests/arm64-linux/scalar.h
++++ b/memcheck/tests/arm64-linux/scalar.h
+@@ -12,6 +12,10 @@
+ #include <sys/types.h>
+ #include <sys/mman.h>
+
++#ifndef __THROW
++#define __THROW
++#endif
++
+ // Since we use vki_unistd.h, we can't include <unistd.h>. So we have to
+ // declare this ourselves.
+ extern long int syscall (long int __sysno, ...) __THROW;
+--
+2.13.2
+
diff --git a/external/poky/meta/recipes-devtools/valgrind/valgrind/0001-sigqueue-Rename-_sifields-to-__si_fields-on-musl.patch b/external/poky/meta/recipes-devtools/valgrind/valgrind/0001-sigqueue-Rename-_sifields-to-__si_fields-on-musl.patch
new file mode 100644
index 00000000..27366153
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/valgrind/valgrind/0001-sigqueue-Rename-_sifields-to-__si_fields-on-musl.patch
@@ -0,0 +1,31 @@
+From 64ad2744acfb4fa40b1c114633a053f87125a203 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 10 Jun 2017 00:46:39 -0700
+Subject: [PATCH 1/6] sigqueue: Rename _sifields to __si_fields on musl
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ memcheck/tests/linux/sigqueue.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/memcheck/tests/linux/sigqueue.c b/memcheck/tests/linux/sigqueue.c
+index d18bd72..acb7cba 100644
+--- a/memcheck/tests/linux/sigqueue.c
++++ b/memcheck/tests/linux/sigqueue.c
+@@ -8,6 +8,11 @@
+ #include <syscall.h>
+ #include <unistd.h>
+
++/* musl libc defines siginfo_t __si_fields instead of _sifields */
++#if defined(__linux__) && !defined(__GLIBC__)
++#define _sifields __si_fields
++#endif
++
+ int main(int argc, char **argv)
+ {
+ siginfo_t *si;
+--
+2.13.1
+
diff --git a/external/poky/meta/recipes-devtools/valgrind/valgrind/0001-str_tester.c-Limit-rawmemchr-test-to-glibc.patch b/external/poky/meta/recipes-devtools/valgrind/valgrind/0001-str_tester.c-Limit-rawmemchr-test-to-glibc.patch
new file mode 100644
index 00000000..185b8f9e
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/valgrind/valgrind/0001-str_tester.c-Limit-rawmemchr-test-to-glibc.patch
@@ -0,0 +1,39 @@
+From de692e359801a1f0488c76267e4f904dd2efe754 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 10 Jun 2017 00:39:07 -0700
+Subject: [PATCH] str_tester.c: Limit rawmemchr() test to glibc
+
+rawmemchr() is a GNU extention therefore mark it so
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ memcheck/tests/str_tester.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/memcheck/tests/str_tester.c b/memcheck/tests/str_tester.c
+index 9f7790a..47e4b4a 100644
+--- a/memcheck/tests/str_tester.c
++++ b/memcheck/tests/str_tester.c
+@@ -504,7 +504,7 @@ test_strchrnul (void)
+ #endif
+
+ // DDD: better done by testing for the function.
+-#if !defined(__APPLE__) && !defined(__sun)
++#if !defined(__APPLE__) && !defined(__sun) && defined(__GLIBC__)
+ static void
+ test_rawmemchr (void)
+ {
+@@ -1442,7 +1442,7 @@ main (void)
+ test_strchrnul ();
+ # endif
+
+-# if !defined(__APPLE__) && !defined(__sun)
++# if !defined(__APPLE__) && !defined(__sun) && defined(__GLIBC__)
+ /* rawmemchr. */
+ test_rawmemchr ();
+ # endif
+--
+2.13.1
+
diff --git a/external/poky/meta/recipes-devtools/valgrind/valgrind/0002-context-APIs-are-not-available-on-musl.patch b/external/poky/meta/recipes-devtools/valgrind/valgrind/0002-context-APIs-are-not-available-on-musl.patch
new file mode 100644
index 00000000..480fe332
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/valgrind/valgrind/0002-context-APIs-are-not-available-on-musl.patch
@@ -0,0 +1,52 @@
+From bd4e926e7e14747b3cd4d7b2a1bd5410b22f3ea2 Mon Sep 17 00:00:00 2001
+From: Randy MacLeod <Randy.MacLeod@windriver.com>
+Date: Tue, 16 Oct 2018 21:27:46 -0400
+Subject: [PATCH] context APIs are not available on musl
+
+Upstream-Status: Pending
+
+Updated patch for valgrind-3.14
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Randy MacLeod <Randy.MacLeod@windriver.com>
+---
+ memcheck/tests/linux/stack_changes.c | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/memcheck/tests/linux/stack_changes.c b/memcheck/tests/linux/stack_changes.c
+index 7f97b90a5..a26cb4ae6 100644
+--- a/memcheck/tests/linux/stack_changes.c
++++ b/memcheck/tests/linux/stack_changes.c
+@@ -10,6 +10,7 @@
+ // This test is checking the libc context calls (setcontext, etc.) and
+ // checks that Valgrind notices their stack changes properly.
+
++#ifdef __GLIBC__
+ typedef ucontext_t mycontext;
+
+ mycontext ctx1, ctx2, oldc;
+@@ -51,9 +52,11 @@ int init_context(mycontext *uc)
+
+ return ret;
+ }
++#endif
+
+ int main(int argc, char **argv)
+ {
++#ifdef __GLIBC__
+ int c1 = init_context(&ctx1);
+ int c2 = init_context(&ctx2);
+
+@@ -66,6 +69,8 @@ int main(int argc, char **argv)
+ //free(ctx1.uc_stack.ss_sp);
+ VALGRIND_STACK_DEREGISTER(c2);
+ //free(ctx2.uc_stack.ss_sp);
+-
++#else
++ printf("libc context call APIs e.g. getcontext() are deprecated by posix\n");
++#endif
+ return 0;
+ }
+--
+2.17.0
+
diff --git a/external/poky/meta/recipes-devtools/valgrind/valgrind/0002-memcheck-x86-Define-__THROW-if-not-defined.patch b/external/poky/meta/recipes-devtools/valgrind/valgrind/0002-memcheck-x86-Define-__THROW-if-not-defined.patch
new file mode 100644
index 00000000..54334722
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/valgrind/valgrind/0002-memcheck-x86-Define-__THROW-if-not-defined.patch
@@ -0,0 +1,32 @@
+From 67d199dbdcbb3feff5f8928f87725fc64c0307d7 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 5 Jul 2017 17:36:42 -0700
+Subject: [PATCH 2/3] memcheck/x86: Define __THROW if not defined
+
+musl does not have __THROW, therefore make it null
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted
+
+ memcheck/tests/x86-linux/scalar.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/memcheck/tests/x86-linux/scalar.h b/memcheck/tests/x86-linux/scalar.h
+index ef28b03..52f742e 100644
+--- a/memcheck/tests/x86-linux/scalar.h
++++ b/memcheck/tests/x86-linux/scalar.h
+@@ -11,6 +11,10 @@
+ #include <sys/types.h>
+ #include <sys/mman.h>
+
++#ifndef __THROW
++#define __THROW
++#endif
++
+ // Since we use vki_unistd.h, we can't include <unistd.h>. So we have to
+ // declare this ourselves.
+ extern long int syscall (long int __sysno, ...) __THROW;
+--
+2.13.2
+
diff --git a/external/poky/meta/recipes-devtools/valgrind/valgrind/0003-correct-include-directive-path-for-config.h.patch b/external/poky/meta/recipes-devtools/valgrind/valgrind/0003-correct-include-directive-path-for-config.h.patch
new file mode 100644
index 00000000..c2965c40
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/valgrind/valgrind/0003-correct-include-directive-path-for-config.h.patch
@@ -0,0 +1,45 @@
+From ecbdea7bd8b08205f1bc3f6b72d4b4a80f313fcb Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 10 Jun 2017 01:03:17 -0700
+Subject: [PATCH 3/6] correct include directive path for config.h
+
+when building out of source tree, it can not find
+the generated config.h otherwise
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ memcheck/tests/linux/syscalls-2007.c | 2 +-
+ memcheck/tests/linux/syslog-syscall.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/memcheck/tests/linux/syscalls-2007.c b/memcheck/tests/linux/syscalls-2007.c
+index b61c6d5..cc3fd62 100644
+--- a/memcheck/tests/linux/syscalls-2007.c
++++ b/memcheck/tests/linux/syscalls-2007.c
+@@ -10,7 +10,7 @@
+
+ #define _GNU_SOURCE
+
+-#include "../../config.h"
++#include "config.h"
+ #include <fcntl.h>
+ #include <signal.h>
+ #include <stdint.h>
+diff --git a/memcheck/tests/linux/syslog-syscall.c b/memcheck/tests/linux/syslog-syscall.c
+index 1143722..21e758b 100644
+--- a/memcheck/tests/linux/syslog-syscall.c
++++ b/memcheck/tests/linux/syslog-syscall.c
+@@ -6,7 +6,7 @@
+ * klogctl().
+ */
+
+-#include "../../config.h"
++#include "config.h"
+ #include <stdio.h>
+ #if defined(HAVE_SYS_KLOG_H)
+ #include <sys/klog.h>
+--
+2.13.1
+
diff --git a/external/poky/meta/recipes-devtools/valgrind/valgrind/0003-tests-seg_override-Replace-__modify_ldt-with-syscall.patch b/external/poky/meta/recipes-devtools/valgrind/valgrind/0003-tests-seg_override-Replace-__modify_ldt-with-syscall.patch
new file mode 100644
index 00000000..fa1344c8
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/valgrind/valgrind/0003-tests-seg_override-Replace-__modify_ldt-with-syscall.patch
@@ -0,0 +1,68 @@
+From d103475875858ab8a2e6b53ce178bb2f63883d4c Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 5 Jul 2017 17:37:56 -0700
+Subject: [PATCH 3/3] tests/seg_override: Replace __modify_ldt() with syscall()
+
+__modify_ldt() is specific to glibc, replacing it with syscall()
+makes it more portable.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted
+
+ none/tests/x86-linux/seg_override.c | 15 ++++++---------
+ 1 file changed, 6 insertions(+), 9 deletions(-)
+
+diff --git a/none/tests/x86-linux/seg_override.c b/none/tests/x86-linux/seg_override.c
+index b7619c9..c89874b 100644
+--- a/none/tests/x86-linux/seg_override.c
++++ b/none/tests/x86-linux/seg_override.c
+@@ -2,6 +2,8 @@
+ #include <stdio.h>
+ #include <errno.h>
+ #include <string.h>
++#include <unistd.h>
++#include <syscall.h>
+
+ /* Stuff from Wine. */
+
+@@ -52,14 +54,11 @@ inline static unsigned int wine_ldt_get_limit( const LDT_ENTRY *ent )
+ /* our copy of the ldt */
+ LDT_ENTRY ldt_copy[8192];
+
+-/* System call to set LDT entry. */
+-//extern int __modify_ldt (int, struct modify_ldt_ldt_s *, size_t);
+-extern int __modify_ldt (int, void *, size_t);
+-
+ void print_ldt ( void )
+ {
+ int res;
+- res = __modify_ldt( 0, ldt_copy, 8192*sizeof(LDT_ENTRY) );
++ /* System call to set LDT entry. */
++ res = syscall(SYS_modify_ldt, 0, ldt_copy, 8192*sizeof(LDT_ENTRY) );
+ printf("got %d bytes\n", res );
+ perror("error is");
+ }
+@@ -83,9 +82,6 @@ struct modify_ldt_ldt_s
+ unsigned int empty:25;
+ };
+
+-/* System call to set LDT entry. */
+-//extern int __modify_ldt (int, struct modify_ldt_ldt_s *, size_t);
+-
+ void set_ldt1 ( void* base )
+ {
+ int stat;
+@@ -102,7 +98,8 @@ void set_ldt1 ( void* base )
+ ldt_entry.read_exec_only = 0;
+ ldt_entry.limit_in_pages = 0;
+ ldt_entry.seg_not_present = 0;
+- stat = __modify_ldt (1, &ldt_entry, sizeof (ldt_entry));
++ /* System call to set LDT entry. */
++ stat = syscall(SYS_modify_ldt, 1, &ldt_entry, sizeof (ldt_entry));
+ printf("stat = %d\n", stat);
+ }
+
+--
+2.13.2
+
diff --git a/external/poky/meta/recipes-devtools/valgrind/valgrind/0004-Fix-out-of-tree-builds.patch b/external/poky/meta/recipes-devtools/valgrind/valgrind/0004-Fix-out-of-tree-builds.patch
new file mode 100644
index 00000000..75bb0aa7
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/valgrind/valgrind/0004-Fix-out-of-tree-builds.patch
@@ -0,0 +1,188 @@
+From 8f916dcb395fe5a2429f2867ba4daf8ef3af073a Mon Sep 17 00:00:00 2001
+From: Randy MacLeod <Randy.MacLeod@windriver.com>
+Date: Tue, 16 Oct 2018 21:01:04 -0400
+Subject: [PATCH] Fix out of tree builds.
+
+The paths to these files need to be fully specified in
+the out of tree build case. glibc-2.X.supp is a generated file so the full path
+is deliberately not specified in that case.
+
+RP 2013/03/23
+
+Patch refreshed for valgrind-3.14.0.
+
+Upstream-Status: Pending
+
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+Signed-off-by: Randy MacLeod <Randy.MacLeod@windriver.com>
+---
+ configure.ac | 68 ++++++++++++++++++++++++++--------------------------
+ 1 file changed, 34 insertions(+), 34 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index c18ae5f2a..99667ce57 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -392,50 +392,50 @@ case "${host_os}" in
+ 9.*)
+ AC_MSG_RESULT([Darwin 9.x (${kernel}) / Mac OS X 10.5 Leopard])
+ AC_DEFINE([DARWIN_VERS], DARWIN_10_5, [Darwin / Mac OS X version])
+- DEFAULT_SUPP="darwin9.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="darwin9-drd.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/darwin9.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/darwin9-drd.supp ${DEFAULT_SUPP}"
+ ;;
+ 10.*)
+ AC_MSG_RESULT([Darwin 10.x (${kernel}) / Mac OS X 10.6 Snow Leopard])
+ AC_DEFINE([DARWIN_VERS], DARWIN_10_6, [Darwin / Mac OS X version])
+- DEFAULT_SUPP="darwin10.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/darwin10.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
+ ;;
+ 11.*)
+ AC_MSG_RESULT([Darwin 11.x (${kernel}) / Mac OS X 10.7 Lion])
+ AC_DEFINE([DARWIN_VERS], DARWIN_10_7, [Darwin / Mac OS X version])
+- DEFAULT_SUPP="darwin11.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/darwin11.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
+ ;;
+ 12.*)
+ AC_MSG_RESULT([Darwin 12.x (${kernel}) / Mac OS X 10.8 Mountain Lion])
+ AC_DEFINE([DARWIN_VERS], DARWIN_10_8, [Darwin / Mac OS X version])
+- DEFAULT_SUPP="darwin12.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/darwin12.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
+ ;;
+ 13.*)
+ AC_MSG_RESULT([Darwin 13.x (${kernel}) / Mac OS X 10.9 Mavericks])
+ AC_DEFINE([DARWIN_VERS], DARWIN_10_9, [Darwin / Mac OS X version])
+- DEFAULT_SUPP="darwin13.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/darwin13.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
+ ;;
+ 14.*)
+ AC_MSG_RESULT([Darwin 14.x (${kernel}) / Mac OS X 10.10 Yosemite])
+ AC_DEFINE([DARWIN_VERS], DARWIN_10_10, [Darwin / Mac OS X version])
+- DEFAULT_SUPP="darwin14.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/darwin14.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
+ ;;
+ 15.*)
+ AC_MSG_RESULT([Darwin 15.x (${kernel}) / Mac OS X 10.11 El Capitan])
+ AC_DEFINE([DARWIN_VERS], DARWIN_10_11, [Darwin / Mac OS X version])
+- DEFAULT_SUPP="darwin15.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/darwin15.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
+ ;;
+ 16.*)
+ AC_MSG_RESULT([Darwin 16.x (${kernel}) / macOS 10.12 Sierra])
+ AC_DEFINE([DARWIN_VERS], DARWIN_10_12, [Darwin / Mac OS X version])
+- DEFAULT_SUPP="darwin16.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/darwin16.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
+ ;;
+ 17.*)
+ AC_MSG_RESULT([Darwin 17.x (${kernel}) / macOS 10.13 High Sierra])
+@@ -460,7 +460,7 @@ case "${host_os}" in
+ DEFAULT_SUPP="solaris12.supp ${DEFAULT_SUPP}"
+ ;;
+ *)
+- DEFAULT_SUPP="solaris11.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/solaris11.supp ${DEFAULT_SUPP}"
+ ;;
+ esac
+ ;;
+@@ -468,7 +468,7 @@ case "${host_os}" in
+ solaris2.12*)
+ AC_MSG_RESULT([ok (${host_os})])
+ VGCONF_OS="solaris"
+- DEFAULT_SUPP="solaris12.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/solaris12.supp ${DEFAULT_SUPP}"
+ ;;
+
+ *)
+@@ -1051,29 +1051,29 @@ AC_MSG_CHECKING([the glibc version])
+ case "${GLIBC_VERSION}" in
+ 2.2)
+ AC_MSG_RESULT(${GLIBC_VERSION} family)
+- DEFAULT_SUPP="glibc-2.2.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="glibc-2.2-LinuxThreads-helgrind.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/glibc-2.2.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/glibc-2.2-LinuxThreads-helgrind.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/glibc-2.X-drd.supp ${DEFAULT_SUPP}"
+ ;;
+ 2.[[3-6]])
+ AC_MSG_RESULT(${GLIBC_VERSION} family)
+- DEFAULT_SUPP="glibc-${GLIBC_VERSION}.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/glibc-${GLIBC_VERSION}.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/glibc-2.X-drd.supp ${DEFAULT_SUPP}"
+ ;;
+ 2.[[7-9]])
+ AC_MSG_RESULT(${GLIBC_VERSION} family)
+ DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/glibc-2.X-drd.supp ${DEFAULT_SUPP}"
+ ;;
+ 2.10|2.11)
+ AC_MSG_RESULT(${GLIBC_VERSION} family)
+ AC_DEFINE([GLIBC_MANDATORY_STRLEN_REDIRECT], 1,
+ [Define to 1 if strlen() has been optimized heavily (amd64 glibc >= 2.10)])
+ DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/glibc-2.X-drd.supp ${DEFAULT_SUPP}"
+ ;;
+ 2.*)
+ AC_MSG_RESULT(${GLIBC_VERSION} family)
+@@ -1082,8 +1082,8 @@ case "${GLIBC_VERSION}" in
+ AC_DEFINE([GLIBC_MANDATORY_INDEX_AND_STRLEN_REDIRECT], 1,
+ [Define to 1 if index() and strlen() have been optimized heavily (x86 glibc >= 2.12)])
+ DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/glibc-2.X-drd.supp ${DEFAULT_SUPP}"
+ ;;
+ darwin)
+ AC_MSG_RESULT(Darwin)
+@@ -1093,7 +1093,7 @@ case "${GLIBC_VERSION}" in
+ bionic)
+ AC_MSG_RESULT(Bionic)
+ AC_DEFINE([BIONIC_LIBC], 1, [Define to 1 if you're using Bionic])
+- DEFAULT_SUPP="bionic.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/bionic.supp ${DEFAULT_SUPP}"
+ ;;
+ solaris)
+ AC_MSG_RESULT(Solaris)
+@@ -1120,11 +1120,11 @@ if test "$VGCONF_OS" != "solaris"; then
+ # attempt to detect whether such libraries are installed on the
+ # build machine (or even if any X facilities are present); just
+ # add the suppressions antidisirregardless.
+- DEFAULT_SUPP="xfree-4.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="xfree-3.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/xfree-4.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/xfree-3.supp ${DEFAULT_SUPP}"
+
+ # Add glibc and X11 suppressions for exp-sgcheck
+- DEFAULT_SUPP="exp-sgcheck.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/exp-sgcheck.supp ${DEFAULT_SUPP}"
+ fi
+
+
+--
+2.17.0
+
diff --git a/external/poky/meta/recipes-devtools/valgrind/valgrind/0004-pth_atfork1.c-Define-error-API-for-musl.patch b/external/poky/meta/recipes-devtools/valgrind/valgrind/0004-pth_atfork1.c-Define-error-API-for-musl.patch
new file mode 100644
index 00000000..1cb70625
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/valgrind/valgrind/0004-pth_atfork1.c-Define-error-API-for-musl.patch
@@ -0,0 +1,37 @@
+From fb77fef4f866dac7bcc6d1ae025da60564869f84 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 10 Jun 2017 01:06:11 -0700
+Subject: [PATCH 4/6] pth_atfork1.c: Define error() API for musl
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ none/tests/pth_atfork1.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/none/tests/pth_atfork1.c b/none/tests/pth_atfork1.c
+index 34201ef..b7f5f2d 100644
+--- a/none/tests/pth_atfork1.c
++++ b/none/tests/pth_atfork1.c
+@@ -18,7 +18,7 @@
+ Boston, MA 02111-1307, USA. */
+
+ #include <errno.h>
+-#if !defined(__APPLE__) && !defined(__sun)
++#if !defined(__APPLE__) && !defined(__sun) && defined(__GLIBC__)
+ # include <error.h>
+ #endif
+ #include <stdlib.h>
+@@ -27,7 +27,7 @@
+ #include <sys/wait.h>
+ #include <stdio.h>
+
+-#if defined(__APPLE__) || defined(__sun)
++#if defined(__APPLE__) || defined(__sun) || (defined(__linux__) && !defined(__GLIBC__))
+ #include <string.h> /* strerror */
+ static void error (int status, int errnum, char* msg)
+ {
+--
+2.13.1
+
diff --git a/external/poky/meta/recipes-devtools/valgrind/valgrind/0005-Modify-vg_test-wrapper-to-support-PTEST-formats.patch b/external/poky/meta/recipes-devtools/valgrind/valgrind/0005-Modify-vg_test-wrapper-to-support-PTEST-formats.patch
new file mode 100644
index 00000000..7985308e
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/valgrind/valgrind/0005-Modify-vg_test-wrapper-to-support-PTEST-formats.patch
@@ -0,0 +1,252 @@
+From f49f27f1bc67d07440b0ac9a7d767a8ea1589bfe Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Tue, 15 Dec 2015 15:50:44 +0200
+Subject: [PATCH 5/5] Modify vg_test wrapper to support PTEST formats
+
+Change the valgrind regression test script vg_regtest to
+support the yocto ptest stdout reporting format. The commit adds
+'--yocto-ptest' as an optional argument to vg_regtest, which alters
+the output to use the ptest infrastructure reporting format:
+ "[PASS|SKIP|FAIL]: testname"
+instead of valgrind's internal test reporting format. Without the added
+option, --yocto-ptest, the valgrind regression test output is unchanged.
+
+Enforce 30 seconds limit for the test.
+This resume execution of the remaining tests when valgrind hangs.
+
+Upstream-Status: Pending
+
+Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
+Signed-off-by: Tudor Florea <tudor.florea@enea.com>
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ tests/vg_regtest.in | 75 +++++++++++++++++++++++++++++++++++++++--------------
+ 1 file changed, 55 insertions(+), 20 deletions(-)
+
+diff --git a/tests/vg_regtest.in b/tests/vg_regtest.in
+index a441f42..cb05b52 100755
+--- a/tests/vg_regtest.in
++++ b/tests/vg_regtest.in
+@@ -47,6 +47,7 @@
+ # --loop-till-fail: loops on the test(s) till one fail, then exit
+ # This is useful to obtain detailed trace or --keep-unfiltered
+ # output of a non deterministic test failure
++# --yocto-ptest: output in yocto ptest format
+ #
+ # The easiest way is to run all tests in valgrind/ with (assuming you installed
+ # in $PREFIX):
+@@ -139,7 +140,7 @@ my $usage="\n"
+ . "Usage:\n"
+ . " vg_regtest [--all, --valgrind, --valgrind-lib, --keep-unfiltered\n"
+ . " --outer-valgrind, --outer-tool, --outer-args\n"
+- . " --loop-till-fail]\n"
++ . " --loop-till-fail, --yocto-ptest]\n"
+ . " Use EXTRA_REGTEST_OPTS to supply extra args for all tests\n"
+ . "\n";
+
+@@ -186,6 +187,7 @@ my $outer_args;
+ my $valgrind_lib = "$tests_dir/.in_place";
+ my $keepunfiltered = 0;
+ my $looptillfail = 0;
++my $yoctoptest = 0;
+
+ # default filter is the one named "filter_stderr" in the test's directory
+ my $default_stderr_filter = "filter_stderr";
+@@ -244,6 +246,8 @@ sub process_command_line()
+ $keepunfiltered = 1;
+ } elsif ($arg =~ /^--loop-till-fail$/) {
+ $looptillfail = 1;
++ } elsif ($arg =~ /^--yocto-ptest$/) {
++ $yoctoptest = 1;
+ } else {
+ die $usage;
+ }
+@@ -365,13 +369,28 @@ sub read_vgtest_file($)
+ #----------------------------------------------------------------------------
+ # Since most of the program time is spent in system() calls, need this to
+ # propagate a Ctrl-C enabling us to quit.
+-sub mysystem($)
++# Enforce 30 seconds limit for the test.
++# This resume execution of the remaining tests if valgrind hangs.
++sub mysystem($)
+ {
+- my $exit_code = system($_[0]);
+- ($exit_code == 2) and exit 1; # 2 is SIGINT
+- return $exit_code;
++ my $exit_code=0;
++ eval {
++ local $SIG{'ALRM'} = sub { die "timed out\n" };
++ alarm(30);
++ $exit_code = system($_[0]);
++ alarm (0);
++ ($exit_code == 2) and die "SIGINT\n"; # 2 is SIGINT
++ };
++ if ($@) {
++ if ($@ eq "timed out\n") {
++ print "timed out\n";
++ return 1;
++ }
++ if ($@ eq "SIGINT\n") {
++ exit 1;
++ }
++ }
+ }
+-
+ # if $keepunfiltered, copies $1 to $1.unfiltered.out
+ # renames $0 tp $1
+ sub filtered_rename($$)
+@@ -419,23 +438,25 @@ sub do_diffs($$$$)
+ # A match; remove .out and any previously created .diff files.
+ unlink("$name.$mid.out");
+ unlink(<$name.$mid.diff*>);
+- return;
++ return 0;
+ }
+ }
+ }
+ # If we reach here, none of the .exp files matched.
+- print "*** $name failed ($mid) ***\n";
++ print "*** $name failed ($mid) ***\n" if ($yoctoptest == 0) ;
+ push(@failures, sprintf("%-40s ($mid)", "$fullname"));
+ $num_failures{$mid}++;
+ if ($looptillfail == 1) {
+ print "Failure encountered, stopping to loop\n";
+ exit 1
+ }
++ return 1;
+ }
+
+ sub do_one_test($$)
+ {
+ my ($dir, $vgtest) = @_;
++ my $diffStatus = 0;
+ $vgtest =~ /^(.*)\.vgtest/;
+ my $name = $1;
+ my $fullname = "$dir/$name";
+@@ -454,7 +475,11 @@ sub do_one_test($$)
+ } elsif (256 == $prereq_res) {
+ # Nb: weird Perl-ism -- exit code of '1' is seen by Perl as 256...
+ # Prereq failed, skip.
+- printf("%-16s (skipping, prereq failed: $prereq)\n", "$name:");
++ if ($yoctoptest == 0) {
++ printf("%-16s (skipping, prereq failed: $prereq)\n", "$name:");
++ } else {
++ printf("SKIP: $fullname\n");
++ }
+ return;
+ } else {
+ # Bad prereq; abort.
+@@ -472,7 +497,7 @@ sub do_one_test($$)
+ }
+ # If there is a progB, let's start it in background:
+ printf("%-16s valgrind $extraopts $vgopts $prog $args (progB: $progB $argsB)\n",
+- "$name:");
++ "$name:") if ($yoctoptest == 0);
+ # progB.done used to detect child has finished. See below.
+ # Note: redirection of stdout and stderr is before $progB to allow argsB
+ # to e.g. redirect stdoutB to stderrB
+@@ -488,7 +513,8 @@ sub do_one_test($$)
+ . "touch progB.done) &");
+ }
+ } else {
+- printf("%-16s valgrind $extraopts $vgopts $prog $args\n", "$name:");
++ printf("%-16s valgrind $extraopts $vgopts $prog $args\n", "$name:")
++ if ($yoctoptest == 0);
+ }
+
+ # Collect environment variables, if any.
+@@ -529,7 +555,7 @@ sub do_one_test($$)
+ # Find all the .stdout.exp files. If none, use /dev/null.
+ my @stdout_exps = <$name.stdout.exp*>;
+ @stdout_exps = ( "/dev/null" ) if (0 == scalar @stdout_exps);
+- do_diffs($fullname, $name, "stdout", \@stdout_exps);
++ $diffStatus |= do_diffs($fullname, $name, "stdout", \@stdout_exps);
+
+ # Filter stderr
+ $stderr_filter_args = $name if (! defined $stderr_filter_args);
+@@ -538,7 +564,7 @@ sub do_one_test($$)
+ # Find all the .stderr.exp files. At least one must exist.
+ my @stderr_exps = <$name.stderr.exp*>;
+ (0 != scalar @stderr_exps) or die "Could not find `$name.stderr.exp*'\n";
+- do_diffs($fullname, $name, "stderr", \@stderr_exps);
++ $diffStatus |= do_diffs($fullname, $name, "stderr", \@stderr_exps);
+
+ if (defined $progB) {
+ # wait for the child to be finished
+@@ -562,7 +588,7 @@ sub do_one_test($$)
+ # Find all the .stdoutB.exp files. If none, use /dev/null.
+ my @stdoutB_exps = <$name.stdoutB.exp*>;
+ @stdoutB_exps = ( "/dev/null" ) if (0 == scalar @stdoutB_exps);
+- do_diffs($fullname, $name, "stdoutB", \@stdoutB_exps);
++ $diffStatus |= do_diffs($fullname, $name, "stdoutB", \@stdoutB_exps);
+
+ # Filter stderr
+ $stderrB_filter_args = $name if (! defined $stderrB_filter_args);
+@@ -571,7 +597,7 @@ sub do_one_test($$)
+ # Find all the .stderrB.exp files. At least one must exist.
+ my @stderrB_exps = <$name.stderrB.exp*>;
+ (0 != scalar @stderrB_exps) or die "Could not find `$name.stderrB.exp*'\n";
+- do_diffs($fullname, $name, "stderrB", \@stderrB_exps);
++ $diffStatus |= do_diffs($fullname, $name, "stderrB", \@stderrB_exps);
+ }
+
+ # Maybe do post-test check
+@@ -583,7 +609,7 @@ sub do_one_test($$)
+ # Find all the .post.exp files. If none, use /dev/null.
+ my @post_exps = <$name.post.exp*>;
+ @post_exps = ( "/dev/null" ) if (0 == scalar @post_exps);
+- do_diffs($fullname, $name, "post", \@post_exps);
++ $diffStatus |= do_diffs($fullname, $name, "post", \@post_exps);
+ }
+ }
+
+@@ -592,6 +618,13 @@ sub do_one_test($$)
+ print("(cleanup operation failed: $cleanup)\n");
+ }
+
++ if ($yoctoptest == 1) {
++ if ($diffStatus == 0) {
++ print("PASS: $fullname\n");
++ } else {
++ print("FAIL: $fullname\n");
++ }
++ }
+ $num_tests_done++;
+ }
+
+@@ -631,7 +664,7 @@ sub test_one_dir($$)
+ my $found_tests = (0 != (grep { $_ =~ /\.vgtest$/ } @fs));
+
+ if ($found_tests) {
+- print "-- Running tests in $full_dir $dashes\n";
++ print "-- Running tests in $full_dir $dashes\n" if ($yoctoptest == 0);
+ }
+ foreach my $f (@fs) {
+ if (-d $f) {
+@@ -641,7 +674,7 @@ sub test_one_dir($$)
+ }
+ }
+ if ($found_tests) {
+- print "-- Finished tests in $full_dir $dashes\n";
++ print "-- Finished tests in $full_dir $dashes\n" if ($yoctoptest == 0);
+ }
+
+ chdir("..");
+@@ -667,10 +700,12 @@ sub summarise_results
+ $num_failures{"stdout"}, plural($num_failures{"stdout"}),
+ $num_failures{"stderrB"}, plural($num_failures{"stderrB"}),
+ $num_failures{"stdoutB"}, plural($num_failures{"stdoutB"}),
+- $num_failures{"post"}, plural($num_failures{"post"}));
++ $num_failures{"post"}, plural($num_failures{"post"}))
++ if ($yoctoptest == 0);
+
+ foreach my $failure (@failures) {
+- print "$failure\n";
++ print "$failure\n"
++ if ($yoctoptest == 0);
+ }
+ print "\n";
+ }
+--
+2.6.2
+
diff --git a/external/poky/meta/recipes-devtools/valgrind/valgrind/0005-tc20_verifywrap.c-Fake-__GLIBC_PREREQ-with-musl.patch b/external/poky/meta/recipes-devtools/valgrind/valgrind/0005-tc20_verifywrap.c-Fake-__GLIBC_PREREQ-with-musl.patch
new file mode 100644
index 00000000..6176640e
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/valgrind/valgrind/0005-tc20_verifywrap.c-Fake-__GLIBC_PREREQ-with-musl.patch
@@ -0,0 +1,30 @@
+From b4b9f072c22f96844e02cb9d68f7ff2408680817 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 10 Jun 2017 01:07:59 -0700
+Subject: [PATCH 5/6] tc20_verifywrap.c: Fake __GLIBC_PREREQ with musl
+
+similar to sun
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ helgrind/tests/tc20_verifywrap.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/helgrind/tests/tc20_verifywrap.c b/helgrind/tests/tc20_verifywrap.c
+index c110000..a311a49 100644
+--- a/helgrind/tests/tc20_verifywrap.c
++++ b/helgrind/tests/tc20_verifywrap.c
+@@ -20,7 +20,7 @@
+
+ #if !defined(__APPLE__)
+
+-#if defined(__sun__)
++#if defined(__sun__) || (defined(__linux__) && !defined(__GLIBC__))
+ /* Fake __GLIBC_PREREQ on Solaris. Pretend glibc >= 2.4. */
+ # define __GLIBC_PREREQ
+ #else
+--
+2.13.1
+
diff --git a/external/poky/meta/recipes-devtools/valgrind/valgrind/0006-pth_detached3.c-Dereference-pthread_t-before-adding-.patch b/external/poky/meta/recipes-devtools/valgrind/valgrind/0006-pth_detached3.c-Dereference-pthread_t-before-adding-.patch
new file mode 100644
index 00000000..05886c74
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/valgrind/valgrind/0006-pth_detached3.c-Dereference-pthread_t-before-adding-.patch
@@ -0,0 +1,32 @@
+From a6547fc17c120dbd95b852f50b0c4bdee4fedb9a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 10 Jun 2017 01:20:32 -0700
+Subject: [PATCH 6/6] pth_detached3.c: Dereference pthread_t before adding
+ offset to it
+
+Fixes
+error: invalid use of undefined type 'struct __pthread'
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ drd/tests/pth_detached3.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drd/tests/pth_detached3.c b/drd/tests/pth_detached3.c
+index c02eef1..35d43a6 100644
+--- a/drd/tests/pth_detached3.c
++++ b/drd/tests/pth_detached3.c
+@@ -21,7 +21,7 @@ int main(int argc, char** argv)
+ pthread_detach(thread);
+
+ /* Invoke pthread_detach() with an invalid thread ID. */
+- pthread_detach(thread + 8);
++ pthread_detach((pthread_t*)(&thread + 8));
+
+ fprintf(stderr, "Finished.\n");
+
+--
+2.13.1
+
diff --git a/external/poky/meta/recipes-devtools/valgrind/valgrind/Added-support-for-PPC-instructions-mfatbu-mfatbl.patch b/external/poky/meta/recipes-devtools/valgrind/valgrind/Added-support-for-PPC-instructions-mfatbu-mfatbl.patch
new file mode 100644
index 00000000..07774f38
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/valgrind/valgrind/Added-support-for-PPC-instructions-mfatbu-mfatbl.patch
@@ -0,0 +1,96 @@
+From 0bf4b0ac18d1ea41b32ad781d214b295ca1998f3 Mon Sep 17 00:00:00 2001
+From: Aneesh Bansal <aneesh.bansal@freescale.com>
+Date: Mon, 21 Nov 2011 17:31:39 +0530
+Subject: [PATCH] Added support for PPC instructions mfatbu, mfatbl.
+
+Upstream-Status: Pending
+
+Signed-off-by: Aneesh Bansal <aneesh.bansal@freescale.com>
+---
+Currently Valgrind 3.7.0 does not have support for PPC instructions mfatbu and mfatbl. When we run a USDPAA application with VALGRIND, the following error is given by valgrind :
+dis_proc_ctl(ppc)(mfspr,SPR)(0x20F)
+disInstr(ppc): unhandled instruction: 0x7C0F82A6
+
+
+ VEX/priv/guest_ppc_defs.h | 2 ++
+ VEX/priv/guest_ppc_helpers.c | 18 ++++++++++++++++++
+ VEX/priv/guest_ppc_toIR.c | 22 ++++++++++++++++++++++
+ 3 files changed, 42 insertions(+), 0 deletions(-)
+
+diff --git a/VEX/priv/guest_ppc_defs.h b/VEX/priv/guest_ppc_defs.h
+index dd3c62e..11a34aa 100644
+--- a/VEX/priv/guest_ppc_defs.h
++++ b/VEX/priv/guest_ppc_defs.h
+@@ -146,6 +146,8 @@ extern UInt ppc32g_dirtyhelper_MFSPR_268_269 ( UInt );
+
+ extern UInt ppc32g_dirtyhelper_MFSPR_287 ( void );
+
++extern UInt ppc32g_dirtyhelper_MFSPR_526_527 ( UInt );
++
+ extern void ppc32g_dirtyhelper_LVS ( VexGuestPPC32State* gst,
+ UInt vD_idx, UInt sh,
+ UInt shift_right );
+diff --git a/VEX/priv/guest_ppc_helpers.c b/VEX/priv/guest_ppc_helpers.c
+index 11aa428..b49ea3f 100644
+--- a/VEX/priv/guest_ppc_helpers.c
++++ b/VEX/priv/guest_ppc_helpers.c
+@@ -119,6 +119,24 @@ UInt ppc32g_dirtyhelper_MFSPR_287 ( void )
+ # endif
+ }
+
++/* CALLED FROM GENERATED CODE */
++/* DIRTY HELPER (non-referentially transparent) */
++UInt ppc32g_dirtyhelper_MFSPR_526_527 ( UInt r527 )
++{
++# if defined(__powerpc__) || defined(_AIX)
++ UInt spr;
++ if (r527) {
++ __asm__ __volatile__("mfspr %0,527" : "=b"(spr));
++ } else {
++ __asm__ __volatile__("mfspr %0,526" : "=b"(spr));
++ }
++ return spr;
++# else
++ return 0;
++# endif
++}
++
++
+
+ /* CALLED FROM GENERATED CODE */
+ /* DIRTY HELPER (reads guest state, writes guest mem) */
+diff --git a/VEX/priv/guest_ppc_toIR.c b/VEX/priv/guest_ppc_toIR.c
+index f8d220d..37c8974 100644
+--- a/VEX/priv/guest_ppc_toIR.c
++++ b/VEX/priv/guest_ppc_toIR.c
+@@ -5657,6 +5657,28 @@ static Bool dis_proc_ctl ( VexAbiInfo* vbi, UInt theInstr )
+ break;
+ }
+
++
++ case 526 /* 0x20E */:
++ case 527 /* 0x20F */: {
++ UInt arg = SPR==526 ? 0 : 1;
++ IRTemp val = newTemp(Ity_I32);
++ IRExpr** args = mkIRExprVec_1( mkU32(arg) );
++ IRDirty* d = unsafeIRDirty_1_N(
++ val,
++ 0/*regparms*/,
++ "ppc32g_dirtyhelper_MFSPR_526_527",
++ fnptr_to_fnentry
++ (vbi, &ppc32g_dirtyhelper_MFSPR_526_527),
++ args
++ );
++ /* execute the dirty call, dumping the result in val. */
++ stmt( IRStmt_Dirty(d) );
++ putIReg( rD_addr,
++ mkWidenFrom32(ty, mkexpr(val), False/*unsigned*/) );
++ DIP("mfspr r%u,%u", rD_addr, (UInt)SPR);
++ break;
++ }
++
+ default:
+ vex_printf("dis_proc_ctl(ppc)(mfspr,SPR)(0x%x)\n", SPR);
+ return False;
+--
+1.7.0.4
diff --git a/external/poky/meta/recipes-devtools/valgrind/valgrind/avoid-neon-for-targets-which-don-t-support-it.patch b/external/poky/meta/recipes-devtools/valgrind/valgrind/avoid-neon-for-targets-which-don-t-support-it.patch
new file mode 100644
index 00000000..5fcfec00
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/valgrind/valgrind/avoid-neon-for-targets-which-don-t-support-it.patch
@@ -0,0 +1,33 @@
+From 8facc29c3c56e6cf9cfef70986cf73876044a3fb Mon Sep 17 00:00:00 2001
+From: Andre McCurdy <armccurdy@gmail.com>
+Date: Tue, 19 Jan 2016 16:42:36 -0800
+Subject: [PATCH] avoid neon for targets which don't support it
+
+The sh-mem-random.c test app tries to use neon loads and stores to
+test 64-bit float copies when building for ARM. Allow it to do so if
+possible, but fallback to C when building for ARM targets which don't
+support neon.
+
+Upstream-Status: Pending
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+---
+ memcheck/tests/sh-mem-random.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/memcheck/tests/sh-mem-random.c b/memcheck/tests/sh-mem-random.c
+index ae82248..816e139 100644
+--- a/memcheck/tests/sh-mem-random.c
++++ b/memcheck/tests/sh-mem-random.c
+@@ -191,7 +191,7 @@ void do_test_at ( U1* arr )
+ "emms"
+ : : "r"(arr+dst), "r"(arr+src) : "memory"
+ );
+-#elif defined(__linux__) && defined(__arm__) && !defined(__aarch64__)
++#elif defined(__linux__) && defined(__arm__) && defined(__ARM_NEON__) && !defined(__aarch64__)
+ /* On arm32, many compilers generate a 64-bit float move
+ using two 32 bit integer registers, which completely
+ defeats this test. Hence force a 64-bit NEON load and
+--
+1.9.1
+
diff --git a/external/poky/meta/recipes-devtools/valgrind/valgrind/fixed-perl-path.patch b/external/poky/meta/recipes-devtools/valgrind/valgrind/fixed-perl-path.patch
new file mode 100644
index 00000000..b431d335
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/valgrind/valgrind/fixed-perl-path.patch
@@ -0,0 +1,78 @@
+From 67e7a690107efb16d6d5aebfe420b64a552accdf Mon Sep 17 00:00:00 2001
+From: Qing He <qing.he@intel.com>
+Date: Tue, 31 Aug 2010 22:51:58 +0800
+Subject: [PATCH] valgrind: fix perl scripts
+
+this is a temporary patch to workaround cross compilation.
+otherwise @PERL@ will be replaced to perl-native binary,
+this creates unusable scripts and fails FILERDEPENDS mechanism
+(esp. rpm)
+
+a better fix would need:
+ 1. configure.ac should differentiate PERL and HOSTPERL
+ 2. optionally remove ${STAGING_DIR} in #! line before do_install
+
+8/31/2010 - created by Qing He <qing.he@intel.com>
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+ cachegrind/cg_annotate.in | 2 +-
+ cachegrind/cg_diff.in | 2 +-
+ massif/ms_print.in | 2 +-
+ perf/vg_perf.in | 2 +-
+ 4 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/cachegrind/cg_annotate.in b/cachegrind/cg_annotate.in
+index 69365e8..978265d 100644
+--- a/cachegrind/cg_annotate.in
++++ b/cachegrind/cg_annotate.in
+@@ -1,4 +1,4 @@
+-#! @PERL@
++#! /usr/bin/perl
+
+ ##--------------------------------------------------------------------##
+ ##--- Cachegrind's annotator. cg_annotate.in ---##
+diff --git a/cachegrind/cg_diff.in b/cachegrind/cg_diff.in
+index 395460b..05873cc 100755
+--- a/cachegrind/cg_diff.in
++++ b/cachegrind/cg_diff.in
+@@ -1,4 +1,4 @@
+-#! @PERL@
++#! /usr/bin/perl
+
+ ##--------------------------------------------------------------------##
+ ##--- Cachegrind's differencer. cg_diff.in ---##
+diff --git a/massif/ms_print.in b/massif/ms_print.in
+index e6fae89..3b85b40 100755
+--- a/massif/ms_print.in
++++ b/massif/ms_print.in
+@@ -1,4 +1,4 @@
+-#! @PERL@
++#! /usr/bin/perl
+
+ ##--------------------------------------------------------------------##
+ ##--- Massif's results printer ms_print.in ---##
+diff --git a/perf/vg_perf.in b/perf/vg_perf.in
+index 7a80cb0..28f6156 100644
+--- a/perf/vg_perf.in
++++ b/perf/vg_perf.in
+@@ -1,4 +1,4 @@
+-#! @PERL@
++#! /usr/bin/perl
+ ##--------------------------------------------------------------------##
+ ##--- Valgrind performance testing script vg_perf ---##
+ ##--------------------------------------------------------------------##
+diff --git a/tests/vg_regtest.in b/tests/vg_regtest.in
+index cb05b52..032e947 100755
+--- a/tests/vg_regtest.in
++++ b/tests/vg_regtest.in
+@@ -1,4 +1,4 @@
+-#! @PERL@
++#! /usr/bin/perl
+ ##--------------------------------------------------------------------##
+ ##--- Valgrind regression testing script vg_regtest ---##
+ ##--------------------------------------------------------------------##
+---
+2.4.0
diff --git a/external/poky/meta/recipes-devtools/valgrind/valgrind/run-ptest b/external/poky/meta/recipes-devtools/valgrind/valgrind/run-ptest
new file mode 100755
index 00000000..447d33c8
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/valgrind/valgrind/run-ptest
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+# run-ptest - 'ptest' test infrastructure shell script that
+# wraps the valgrind regression script vg_regtest.
+#
+# Dave Lerner <dave.lerner@windriver.com>
+###############################################################
+VALGRINDLIB=@libdir@/valgrind
+LOG="${VALGRINDLIB}/ptest/valgrind_ptest_$(date +%Y%m%d-%H%M%S).log"
+
+cd ${VALGRINDLIB}/ptest && ./tests/vg_regtest --all \
+ --valgrind=/usr/bin/valgrind --valgrind-lib=$VALGRINDLIB \
+ --yocto-ptest 2>&1|tee ${LOG}
+
+passed=`grep PASS: ${LOG}|wc -l`
+failed=`grep FAIL: ${LOG}|wc -l`
+skipped=`grep SKIP: ${LOG}|wc -l`
+all=$((passed + failed + skipped))
+
+( echo "=== Test Summary ==="
+ echo "TOTAL: ${all}"
+ echo "PASSED: ${passed}"
+ echo "FAILED: ${failed}"
+ echo "SKIPPED: ${skipped}"
+) | tee -a /${LOG}
diff --git a/external/poky/meta/recipes-devtools/valgrind/valgrind/use-appropriate-march-mcpu-mfpu-for-ARM-test-apps.patch b/external/poky/meta/recipes-devtools/valgrind/valgrind/use-appropriate-march-mcpu-mfpu-for-ARM-test-apps.patch
new file mode 100644
index 00000000..adea4052
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/valgrind/valgrind/use-appropriate-march-mcpu-mfpu-for-ARM-test-apps.patch
@@ -0,0 +1,44 @@
+From d134dafc2f11e0d247420a0ba360bcdef77b4093 Mon Sep 17 00:00:00 2001
+From: Andre McCurdy <armccurdy@gmail.com>
+Date: Tue, 19 Jan 2016 16:00:00 -0800
+Subject: [PATCH] use appropriate -march/-mcpu/-mfpu for ARM test apps
+
+Ensure that test apps in none/tests/arm are compiled with appropriate
+-march/-mcpu/-mfpu flags to support the instructions being tested.
+The aim is to build all tests, even ones which may not run correctly
+on all target CPUs.
+
+For tests requiring armv7ve instructions, ensure that we set both
+-march=armv7ve and -mcpu=cortex-a15 (since some TUNE_CCARGS may set
+-march=armv7-a and adding -mcpu=cortex-a15 alone is not enough to
+over-ride that).
+
+See similar cases in none/tests/arm/Makefile.am
+
+Upstream-Status: Pending
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+---
+ none/tests/arm/Makefile.am | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/none/tests/arm/Makefile.am b/none/tests/arm/Makefile.am
+index 4507a20..825290f 100644
+--- a/none/tests/arm/Makefile.am
++++ b/none/tests/arm/Makefile.am
+@@ -62,8 +62,10 @@ neon64_CFLAGS = $(AM_CFLAGS) -g -O0 -mcpu=cortex-a8 \
+ -mfpu=neon \
+ -mthumb
+
+-intdiv_CFLAGS = $(AM_CFLAGS) -g -mcpu=cortex-a15 -mthumb
++intdiv_CFLAGS = $(AM_CFLAGS) -g -march=armv7ve -mcpu=cortex-a15 -mthumb
+ ldrt_CFLAGS = $(AM_CFLAGS) -g -mcpu=cortex-a8 -mthumb
+ ldrt_arm_CFLAGS = $(AM_CFLAGS) -g -mcpu=cortex-a8 -marm
+
+-vfpv4_fma_CFLAGS = $(AM_CFLAGS) -g -O0 -mcpu=cortex-a15 -mfpu=vfpv4 -marm
++vcvt_fixed_float_VFP_CFLAGS = $(AM_CFLAGS) -g -mcpu=cortex-a8 -mfpu=vfpv3
++
++vfpv4_fma_CFLAGS = $(AM_CFLAGS) -g -O0 -march=armv7ve -mcpu=cortex-a15 -mfpu=vfpv4 -marm
+--
+1.9.1
+
diff --git a/external/poky/meta/recipes-devtools/valgrind/valgrind/valgrind-make-ld-XXX.so-strlen-intercept-optional.patch b/external/poky/meta/recipes-devtools/valgrind/valgrind/valgrind-make-ld-XXX.so-strlen-intercept-optional.patch
new file mode 100644
index 00000000..d04297dc
--- /dev/null
+++ b/external/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
+