diff options
Diffstat (limited to 'meta/recipes-devtools/valgrind/valgrind')
33 files changed, 739 insertions, 1480 deletions
diff --git a/meta/recipes-devtools/valgrind/valgrind/0001-Fix-nlcontrolc.vgtest-hanging-on-newer-glibc-and-or-.patch b/meta/recipes-devtools/valgrind/valgrind/0001-Fix-nlcontrolc.vgtest-hanging-on-newer-glibc-and-or-.patch deleted file mode 100644 index 98cbcd132c..0000000000 --- a/meta/recipes-devtools/valgrind/valgrind/0001-Fix-nlcontrolc.vgtest-hanging-on-newer-glibc-and-or-.patch +++ /dev/null @@ -1,200 +0,0 @@ -From 83c24e31df6932a6d4fced179050c6d8d8c6f3b5 Mon Sep 17 00:00:00 2001 -From: Philippe Waroquiers <philippe.waroquiers@skynet.be> -Date: Sun, 7 Mar 2021 22:29:27 +0100 -Subject: [PATCH] Fix nlcontrolc.vgtest hanging on newer glibc and/or arm64 - -This test verifies that GDB can interrupt a process with all threads -blocked in a long select syscall. -The test used to terminate by having GDB modifying the select argument. -However, modifying the select argument works only for specific arch -and/or specific versions of glibc. -The test then blocks on other architectures/glibc versions. - -The previous version of the test was: - * first launching sleepers so as to have all threads blocked in long select - * interrupting these threads - * changing the select time arg so that the threads burn cpu - * and then change variables to have the program exit. - -The new version does: - * first launches sleepers so that all threads are burning cpu. - * interrupting these threads - * change the local variables of sleepers so that the threads will - block in a long select syscall - * interrupt these threads - * kill the program. - -With this new version, we still check the behaviour of gdb+vgdbserver -for both burning and sleep threads, but without having the termination -depending on modifying select syscall argument. - -Tested on debian amd64 and on ubuntu arm64 (to check the test does not hang -on an arm64 platform). - -Upstream-Status: Backport - -From commit on master: -c79180a3afcf65902e578646c3b716cc749db406 - -Signed-off-by: Yi Fan Yu <yifan.yu@windriver.com> ---- - gdbserver_tests/nlcontrolc.stderr.exp | 4 +- - gdbserver_tests/nlcontrolc.stdinB.gdb | 57 +++++++++++++++----------- - gdbserver_tests/nlcontrolc.stdoutB.exp | 25 ++++++----- - gdbserver_tests/nlcontrolc.vgtest | 12 +++--- - 4 files changed, 56 insertions(+), 42 deletions(-) - -diff --git a/gdbserver_tests/nlcontrolc.stderr.exp b/gdbserver_tests/nlcontrolc.stderr.exp -index ac75bb3da..b63a9a988 100644 ---- a/gdbserver_tests/nlcontrolc.stderr.exp -+++ b/gdbserver_tests/nlcontrolc.stderr.exp -@@ -3,9 +3,9 @@ Nulgrind, the minimal Valgrind tool - (action at startup) vgdb me ... - - --loops/sleep_ms/burn/threads_spec/affinity: 1000000000 1000000000 1000000000 BSBSBSBS 1 -+loops/sleep_ms/burn/threads_spec/affinity: 1000000000 0 100000 BSBSBSBS 1 - Brussels ready to sleep and/or burn - London ready to sleep and/or burn - Petaouchnok ready to sleep and/or burn - main ready to sleep and/or burn -- -+Gdb request to kill this process -diff --git a/gdbserver_tests/nlcontrolc.stdinB.gdb b/gdbserver_tests/nlcontrolc.stdinB.gdb -index 667ece18d..ea4fcd530 100644 ---- a/gdbserver_tests/nlcontrolc.stdinB.gdb -+++ b/gdbserver_tests/nlcontrolc.stdinB.gdb -@@ -9,32 +9,43 @@ shell ./simulate_control_c --vgdb-prefix=./vgdb-prefix-nlcontrolc 1 grep main nl - # - continue - # --# Here, all tasks should be blocked in a loooonnnng select, all in WaitSys --info threads --# We will unblock them by changing their timeout argument --# To avoid going into the frame where the timeval arg is, --# it has been defined as global variables, as the nr --# of calls on the stack differs between 32bits and 64bits, --# and/or between OS. --# ensure select finishes in a few milliseconds max: --p t[0].tv_sec = 0 --p t[1].tv_sec = 0 --p t[2].tv_sec = 0 --p t[3].tv_sec = 0 --# --# We will change the burning parameters in a few seconds -+# Threads are burning cpu now -+# We would like to fully test info threads here, but which thread are Runnable -+# or Yielding is unpredictable. With a recent enough gdb, check the nr of -+# threads by state using pipe commands and grep/wc. -+init-if-undefined $_gdb_major = 0 -+init-if-undefined $_gdb_minor = 0 -+if $_gdb_major >= 9 -+ | info threads | grep VgTs_Runnable | wc -l -+ | info threads | grep VgTs_Yielding | wc -l -+else -+ echo 1\n -+ echo 3\n -+end -+# We change the variables so that all the threads are blocked in a syscall -+p burn = 0 -+p sleepms = 1000000 -+# -+# - shell ./simulate_control_c --vgdb-prefix=./vgdb-prefix-nlcontrolc 1 grep changed nlcontrolc.stdoutB.out - # --echo changed burning parameters\n -+echo changed burning parameters to sleeping parameters\n - continue -+# Here, all tasks should be blocked in a loooonnnng select, all in WaitSys -+info threads -+# We reset the sleepms to 0. The threads should still be blocked in the syscall -+p sleepms = 0 -+shell ./simulate_control_c --vgdb-prefix=./vgdb-prefix-nlcontrolc 1 grep reset nlcontrolc.stdoutB.out - # --# Threads are burning cpu now --# We would like to test info threads here, but which thread are Runnable or Yielding --# is unpredictable. --# info threads --p burn = 0 --p loops = 0 --p report_finished = 0 -+echo reset to sleeping parameters\n - continue --# and the process should stop very quickly now -+# threads should still be blocked in a loooonnnng select, all in WaitSys -+info threads -+if $_gdb_major >= 9 -+ | info threads | grep VgTs_WaitSys | wc -l -+else -+ echo 4\n -+end -+# Make the process die. -+kill - quit -diff --git a/gdbserver_tests/nlcontrolc.stdoutB.exp b/gdbserver_tests/nlcontrolc.stdoutB.exp -index e8a5ff8ba..2e8dc8498 100644 ---- a/gdbserver_tests/nlcontrolc.stdoutB.exp -+++ b/gdbserver_tests/nlcontrolc.stdoutB.exp -@@ -1,18 +1,21 @@ - Continuing. - Program received signal SIGTRAP, Trace/breakpoint trap. -+do_burn () at sleepers.c:41 -+41 for (i = 0; i < burn; i++) loopnr++; -+ > > > > > >1 -+3 -+$1 = 0 -+$2 = 1000000 -+changed burning parameters to sleeping parameters -+Continuing. -+Program received signal SIGTRAP, Trace/breakpoint trap. - 0x........ in syscall ... - * 1 Thread .... (tid 1 VgTs_WaitSys) 0x........ in syscall ... --$1 = 0 --$2 = 0 - $3 = 0 --$4 = 0 --changed burning parameters -+reset to sleeping parameters - Continuing. - Program received signal SIGTRAP, Trace/breakpoint trap. --do_burn () at sleepers.c:41 --41 for (i = 0; i < burn; i++) loopnr++; --$5 = 0 --$6 = 0 --$7 = 0 --Continuing. --Program exited normally. -+0x........ in syscall ... -+* 1 Thread .... (tid 1 VgTs_WaitSys) 0x........ in syscall ... -+ > > > >4 -+Kill the program being debugged? (y or n) [answered Y; input not from terminal] -diff --git a/gdbserver_tests/nlcontrolc.vgtest b/gdbserver_tests/nlcontrolc.vgtest -index bb5308403..09edfcaba 100644 ---- a/gdbserver_tests/nlcontrolc.vgtest -+++ b/gdbserver_tests/nlcontrolc.vgtest -@@ -4,16 +4,16 @@ - # and modify some variables - # the user can control-c an process with all threads in Running/Yielding - # and modify some variables --# sleepers is started with argument so that it will compute during ages. --# The variable modifications means it will exit in a reasonable time. --# This test is disabled on Solaris because modifying select/poll/ppoll timeout --# has no effect if a thread is already blocked in that syscall. -+# sleepers is started so that it burns CPU. -+# We then interrupt the process. -+# We modify variables so that instead of burning cpu, sleepers blocks -+# all threads in a select syscall. - prog: sleepers --args: 1000000000 1000000000 1000000000 BSBSBSBS 1 -+args: 1000000000 0 100000 BSBSBSBS 1 - vgopts: --tool=none --vgdb=yes --vgdb-error=0 --vgdb-prefix=./vgdb-prefix-nlcontrolc - stderr_filter: filter_stderr - # Bug 338633 nlcontrol hangs on arm64 currently. --prereq: test -e gdb -a -f vgdb.invoker && ! ../tests/arch_test arm64 && ! ../tests/os_test solaris -+prereq: test -e gdb -a -f vgdb.invoker && ! ../tests/os_test solaris - progB: gdb - argsB: --quiet -l 60 --nx ./sleepers - stdinB: nlcontrolc.stdinB.gdb --- -2.29.2 - diff --git a/meta/recipes-devtools/valgrind/valgrind/0001-Guard-against-__GLIBC_PREREQ-for-musl-libc.patch b/meta/recipes-devtools/valgrind/valgrind/0001-Guard-against-__GLIBC_PREREQ-for-musl-libc.patch deleted file mode 100644 index 81ab29f3be..0000000000 --- a/meta/recipes-devtools/valgrind/valgrind/0001-Guard-against-__GLIBC_PREREQ-for-musl-libc.patch +++ /dev/null @@ -1,36 +0,0 @@ -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: Submitted https://bugs.kde.org/show_bug.cgi?id=400162 - -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/meta/recipes-devtools/valgrind/valgrind/0001-Make-local-functions-static-to-avoid-assembler-error.patch b/meta/recipes-devtools/valgrind/valgrind/0001-Make-local-functions-static-to-avoid-assembler-error.patch deleted file mode 100644 index 8d2ca5733e..0000000000 --- a/meta/recipes-devtools/valgrind/valgrind/0001-Make-local-functions-static-to-avoid-assembler-error.patch +++ /dev/null @@ -1,182 +0,0 @@ -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: Submitted https://bugs.kde.org/show_bug.cgi?id=400164 - -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/meta/recipes-devtools/valgrind/valgrind/0001-Remove-tests-that-fail-to-build-on-some-PPC32-config.patch b/meta/recipes-devtools/valgrind/valgrind/0001-Remove-tests-that-fail-to-build-on-some-PPC32-config.patch deleted file mode 100644 index a78e1953ff..0000000000 --- a/meta/recipes-devtools/valgrind/valgrind/0001-Remove-tests-that-fail-to-build-on-some-PPC32-config.patch +++ /dev/null @@ -1,51 +0,0 @@ -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/meta/recipes-devtools/valgrind/valgrind/0001-docs-Disable-manual-validation.patch b/meta/recipes-devtools/valgrind/valgrind/0001-docs-Disable-manual-validation.patch new file mode 100644 index 0000000000..256ddb0c34 --- /dev/null +++ b/meta/recipes-devtools/valgrind/valgrind/0001-docs-Disable-manual-validation.patch @@ -0,0 +1,36 @@ +From 99fc6fe9b66becac3c94068129e84217330a71a6 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Thu, 13 Jan 2022 18:26:02 -0800 +Subject: [PATCH] docs: Disable manual validation + +validating manual and manpages, this task involves calling xmllint which +accesses network and --nonet option also does not disable this, +therefore disable it. + +Fixes +| error : Resource temporarily unavailable +| ../callgrind/docs/cl-manual.xml:4: warning: failed to load external entity "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" +| <!ENTITY % vg-entities SYSTEM "../../docs/xml/vg-entities.xml"> %vg-entities; ] + +Upstream-Status: Inappropriate [OE-Specific] +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + docs/Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/docs/Makefile.am b/docs/Makefile.am +index d4250e8..c500306 100644 +--- a/docs/Makefile.am ++++ b/docs/Makefile.am +@@ -192,7 +192,7 @@ valid-manpages: $(MANPAGES_XML_FILES) + touch $@; \ + fi + +-check-local: valid-manual valid-manpages ++check-local: + + # The text version of the FAQ. + FAQ.txt: +-- +2.34.1 + diff --git a/meta/recipes-devtools/valgrind/valgrind/0001-drd-Port-to-Fedora-33.patch b/meta/recipes-devtools/valgrind/valgrind/0001-drd-Port-to-Fedora-33.patch deleted file mode 100644 index 37f6ea667d..0000000000 --- a/meta/recipes-devtools/valgrind/valgrind/0001-drd-Port-to-Fedora-33.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 15330adf7c2471fbaa6a0818db07078d81dbff97 Mon Sep 17 00:00:00 2001 -From: Bart Van Assche <bvanassche@acm.org> -Date: Sat, 19 Sep 2020 08:08:59 -0700 -Subject: [PATCH] drd: Port to Fedora 33 - -Apparently on Fedora 33 the POSIX thread functions exist in both libc and -libpthread. Hence this patch that intercepts the pthread functions in -libc. See also https://bugs.kde.org/show_bug.cgi?id=426144 . - -Signed-off-by: Bart Van Assche <bvanassche@acm.org> - -This patch was imported from the valgrind sourceware server -(https://sourceware.org/git/?p=valgrind.git;a=commit;h=15330adf7c2471fbaa6a0818db07078d81dbff97) -It was modified to remove the changes to the valgrind NEWS file, -as these are difficult to maintain and don't impact the valgrind -code itself. - -Upstream-Status: Backport - -Signed-off-by: Stacy Gaikovaia <stacy.gaikovaia@windriver.com> ---- - drd/drd_pthread_intercepts.c | 9 +++++++++ - 1 file changed, 10 insertions(+) - -diff --git a/drd/drd_pthread_intercepts.c b/drd/drd_pthread_intercepts.c -index 58c45aaec..c2882e5ab 100644 ---- a/drd/drd_pthread_intercepts.c -+++ b/drd/drd_pthread_intercepts.c -@@ -174,7 +174,16 @@ static int never_true; - ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBC_SONAME,zf) argl_decl \ - { return implf argl; } - #else -+/* -+ * On Linux, intercept both the libc and the libpthread functions. At -+ * least glibc 2.32.9000 (Fedora 34) has an implementation of all pthread -+ * functions in both libc and libpthread. Older glibc versions only have an -+ * implementation of the pthread functions in libpthread. -+ */ - #define PTH_FUNC(ret_ty, zf, implf, argl_decl, argl) \ -+ ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBC_SONAME,zf) argl_decl; \ -+ ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBC_SONAME,zf) argl_decl \ -+ { return implf argl; } \ - ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBPTHREAD_SONAME,zf) argl_decl; \ - ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBPTHREAD_SONAME,zf) argl_decl \ - { return implf argl; } --- -2.25.1 - diff --git a/meta/recipes-devtools/valgrind/valgrind/0001-drd-musl-fix.patch b/meta/recipes-devtools/valgrind/valgrind/0001-drd-musl-fix.patch deleted file mode 100644 index e96bf3c611..0000000000 --- a/meta/recipes-devtools/valgrind/valgrind/0001-drd-musl-fix.patch +++ /dev/null @@ -1,31 +0,0 @@ -The changes in 0001-drd-Port-to-Fedora-33.patch break builds on musl. These -need a __GLIBC__ guard to ensure musl builds continue to work. - -Upstream-Status: Pending -Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> - -Index: valgrind-3.16.1/drd/drd_pthread_intercepts.c -=================================================================== ---- valgrind-3.16.1.orig/drd/drd_pthread_intercepts.c -+++ valgrind-3.16.1/drd/drd_pthread_intercepts.c -@@ -180,6 +180,7 @@ static int never_true; - * functions in both libc and libpthread. Older glibc versions only have an - * implementation of the pthread functions in libpthread. - */ -+#ifdef __GLIBC__ - #define PTH_FUNC(ret_ty, zf, implf, argl_decl, argl) \ - ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBC_SONAME,zf) argl_decl; \ - ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBC_SONAME,zf) argl_decl \ -@@ -187,6 +188,12 @@ static int never_true; - ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBPTHREAD_SONAME,zf) argl_decl; \ - ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBPTHREAD_SONAME,zf) argl_decl \ - { return implf argl; } -+#else -+#define PTH_FUNC(ret_ty, zf, implf, argl_decl, argl) \ -+ ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBPTHREAD_SONAME,zf) argl_decl; \ -+ ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBPTHREAD_SONAME,zf) argl_decl \ -+ { return implf argl; } -+#endif - #endif - - /** diff --git a/meta/recipes-devtools/valgrind/valgrind/0001-fix-opcode-not-supported-on-mips32-linux.patch b/meta/recipes-devtools/valgrind/valgrind/0001-fix-opcode-not-supported-on-mips32-linux.patch deleted file mode 100644 index 39b624d9f6..0000000000 --- a/meta/recipes-devtools/valgrind/valgrind/0001-fix-opcode-not-supported-on-mips32-linux.patch +++ /dev/null @@ -1,82 +0,0 @@ -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/meta/recipes-devtools/valgrind/valgrind/0001-helgrind-Intercept-libc-functions.patch b/meta/recipes-devtools/valgrind/valgrind/0001-helgrind-Intercept-libc-functions.patch deleted file mode 100644 index f66df3d2d2..0000000000 --- a/meta/recipes-devtools/valgrind/valgrind/0001-helgrind-Intercept-libc-functions.patch +++ /dev/null @@ -1,54 +0,0 @@ -From cdec010444df5a4328e90d07a2024fdeefcc74b5 Mon Sep 17 00:00:00 2001 -From: Paul Floyd <paulf@free.fr> -Date: Wed, 18 Nov 2020 12:49:20 -0400 -Subject: [PATCH] helgrind: Intercept libc functions - -PTH_FUNC definition needs to be modified in order to -intercept posix thread functions in both libc and -libpthread. In order to handle this in helgrind, weak alias -the pthread functions in glibc. - -Upstream-Status: Submitted - -Signed-off-by: Paul Floyd <paulf@free.fr> -Signed-off-by: Stacy Gaikovaia <stacy.gaikovaia@windriver.com> ---- - helgrind/hg_intercepts.c | 12 ++++++++++++ - 1 file changed, 12 insertions(+) - -diff --git a/helgrind/hg_intercepts.c b/helgrind/hg_intercepts.c -index a10c3a4a3..316140ca6 100644 ---- a/helgrind/hg_intercepts.c -+++ b/helgrind/hg_intercepts.c -@@ -77,6 +77,11 @@ - /*--- ---*/ - /*----------------------------------------------------------------*/ - -+#define hg_expand(tok) #tok -+#define hg_str(tok) hg_expand(tok) -+# define hg_weak_alias(name, aliasname) \ -+ extern __typeof (name) aliasname __attribute__ ((weak, alias(hg_str(name)))) -+ - #if defined(VGO_solaris) - /* On Solaris, libpthread is just a filter library on top of libc. - * Threading and synchronization functions in runtime linker are not -@@ -91,9 +96,16 @@ - #define CREQ_PTHREAD_T Word - #define SEM_ERROR ret - #else -+#ifdef MUSL_LIBC -+#define PTH_FUNC(ret_ty, f, args...) \ -+ ret_ty I_WRAP_SONAME_FNNAME_ZZ(VG_Z_LIBPTHREAD_SONAME,f)(args); \ -+ ret_ty I_WRAP_SONAME_FNNAME_ZZ(VG_Z_LIBPTHREAD_SONAME,f)(args) -+#else - #define PTH_FUNC(ret_ty, f, args...) \ - ret_ty I_WRAP_SONAME_FNNAME_ZZ(VG_Z_LIBPTHREAD_SONAME,f)(args); \ -+ hg_weak_alias(I_WRAP_SONAME_FNNAME_ZZ(VG_Z_LIBPTHREAD_SONAME,f), I_WRAP_SONAME_FNNAME_ZZ(VG_Z_LIBC_SONAME,f)); \ - ret_ty I_WRAP_SONAME_FNNAME_ZZ(VG_Z_LIBPTHREAD_SONAME,f)(args) -+#endif - #define CREQ_PTHREAD_T pthread_t - #define SEM_ERROR errno - #endif /* VGO_solaris */ --- -2.17.1 - diff --git a/meta/recipes-devtools/valgrind/valgrind/0001-lmw-lswi-and-related-PowerPC-insns-aren-t-allowed-on.patch b/meta/recipes-devtools/valgrind/valgrind/0001-lmw-lswi-and-related-PowerPC-insns-aren-t-allowed-on.patch deleted file mode 100644 index 7c62144978..0000000000 --- a/meta/recipes-devtools/valgrind/valgrind/0001-lmw-lswi-and-related-PowerPC-insns-aren-t-allowed-on.patch +++ /dev/null @@ -1,62 +0,0 @@ -From 0748ed5403a75c12ad9137b3fabf9d8397206ed8 Mon Sep 17 00:00:00 2001 -From: Mark Wielaard <mark@klomp.org> -Date: Tue, 1 Dec 2020 13:57:39 +0100 -Subject: [PATCH] lmw, lswi and related PowerPC insns aren't allowed on ppc64le - -lmw, lswi and related PowerPC insns aren't allowed on ppc64le - -Newer binutils produce an error when the assembly contains lmw, stmw, -lswi, lswx, stswi, or stswx instructions in little-endian mode. - -Only build and run the lsw and ldst_multiple testcases on ppc64[be]. - -https://bugs.kde.org/show_bug.cgi?id=427870 -Upstream-Status: Backport [https://sourceware.org/git/?p=valgrind.git;a=commit;h=74b74174d572fee4015b8f4e326db3cd949bcdc3] -Signed-off-by: Khem Raj <raj.khem@gmail.com> ---- - none/tests/ppc64/Makefile.am | 9 ++++++--- - none/tests/ppc64/ldst_multiple.vgtest | 1 + - 2 files changed, 7 insertions(+), 3 deletions(-) - -diff --git a/none/tests/ppc64/Makefile.am b/none/tests/ppc64/Makefile.am -index 9bc0d0a..9d1e8b7 100644 ---- a/none/tests/ppc64/Makefile.am -+++ b/none/tests/ppc64/Makefile.am -@@ -54,16 +54,20 @@ EXTRA_DIST = \ - - check_PROGRAMS = \ - allexec \ -- lsw jm-insns round \ -+ jm-insns round \ - 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_isa_3_0 \ - subnormal_test \ -- test_tm test_touch_tm ldst_multiple data-cache-instructions \ -+ test_tm test_touch_tm data-cache-instructions \ - power6_mf_gpr std_reg_imm \ - twi_tdi tw_td power6_bcmp - -+# lmw, stmw, lswi, lswx, stswi, stswx compile (and run) only on big endian. -+if VGCONF_PLATFORMS_INCLUDE_PPC64BE_LINUX -+check_PROGRAMS += lsw ldst_multiple -+endif - - AM_CFLAGS += @FLAG_M64@ - AM_CXXFLAGS += @FLAG_M64@ -@@ -175,4 +179,3 @@ test_isa_2_07_part2_LDADD = -lm - test_tm_LDADD = -lm - test_touch_tm_LDADD = -lm - test_isa_3_0_LDADD = -lm -- -diff --git a/none/tests/ppc64/ldst_multiple.vgtest b/none/tests/ppc64/ldst_multiple.vgtest -index 87e668e..22dd46c 100644 ---- a/none/tests/ppc64/ldst_multiple.vgtest -+++ b/none/tests/ppc64/ldst_multiple.vgtest -@@ -1 +1,2 @@ -+prereq: ../../../tests/is_ppc64_BE - prog: ldst_multiple --- -2.31.0 - diff --git a/meta/recipes-devtools/valgrind/valgrind/0001-makefiles-Drop-setting-mcpu-to-cortex-a8-on-arm-arch.patch b/meta/recipes-devtools/valgrind/valgrind/0001-makefiles-Drop-setting-mcpu-to-cortex-a8-on-arm-arch.patch index 9f1da7bac6..073713c139 100644 --- a/meta/recipes-devtools/valgrind/valgrind/0001-makefiles-Drop-setting-mcpu-to-cortex-a8-on-arm-arch.patch +++ b/meta/recipes-devtools/valgrind/valgrind/0001-makefiles-Drop-setting-mcpu-to-cortex-a8-on-arm-arch.patch @@ -10,7 +10,7 @@ implementation. Fixes | cc1: warning: switch -mcpu=cortex-a8 conflicts with -march=armv7ve switch -Upstream-Status: Pending +Upstream-Status: Submitted [https://bugs.kde.org/show_bug.cgi?id=454346] Signed-off-by: Khem Raj <raj.khem@gmail.com> --- diff --git a/meta/recipes-devtools/valgrind/valgrind/0001-memcheck-arm64-Define-__THROW-if-not-already-defined.patch b/meta/recipes-devtools/valgrind/valgrind/0001-memcheck-arm64-Define-__THROW-if-not-already-defined.patch deleted file mode 100644 index a48d7db070..0000000000 --- a/meta/recipes-devtools/valgrind/valgrind/0001-memcheck-arm64-Define-__THROW-if-not-already-defined.patch +++ /dev/null @@ -1,32 +0,0 @@ -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/meta/recipes-devtools/valgrind/valgrind/0001-none-tests-fdleak_cmsg.stderr.exp-adjust-tmp-paths.patch b/meta/recipes-devtools/valgrind/valgrind/0001-none-tests-fdleak_cmsg.stderr.exp-adjust-tmp-paths.patch index d641998d72..e421ac6c80 100644 --- a/meta/recipes-devtools/valgrind/valgrind/0001-none-tests-fdleak_cmsg.stderr.exp-adjust-tmp-paths.patch +++ b/meta/recipes-devtools/valgrind/valgrind/0001-none-tests-fdleak_cmsg.stderr.exp-adjust-tmp-paths.patch @@ -19,7 +19,7 @@ index 6e5a797b9..0ede1ab18 100644 @@ -25,10 +25,10 @@ Open file descriptor ...: /dev/null - FILE DESCRIPTORS: 6 open at exit. + FILE DESCRIPTORS: 6 open (3 std) at exit. -Open file descriptor ...: /tmp/data2 +Open file descriptor ...: ... ... diff --git a/meta/recipes-devtools/valgrind/valgrind/0001-str_tester.c-Limit-rawmemchr-test-to-glibc.patch b/meta/recipes-devtools/valgrind/valgrind/0001-str_tester.c-Limit-rawmemchr-test-to-glibc.patch deleted file mode 100644 index 185b8f9e60..0000000000 --- a/meta/recipes-devtools/valgrind/valgrind/0001-str_tester.c-Limit-rawmemchr-test-to-glibc.patch +++ /dev/null @@ -1,39 +0,0 @@ -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/meta/recipes-devtools/valgrind/valgrind/0001-valgrind-monitor.py-regular-expressions-should-use-r.patch b/meta/recipes-devtools/valgrind/valgrind/0001-valgrind-monitor.py-regular-expressions-should-use-r.patch new file mode 100644 index 0000000000..80a8e3a10b --- /dev/null +++ b/meta/recipes-devtools/valgrind/valgrind/0001-valgrind-monitor.py-regular-expressions-should-use-r.patch @@ -0,0 +1,64 @@ +From 027b649fdb831868e71be01cafdacc49a5f419ab Mon Sep 17 00:00:00 2001 +From: Mark Wielaard <mark@klomp.org> +Date: Fri, 17 Nov 2023 14:01:21 +0100 +Subject: [PATCH 1/4] valgrind-monitor.py regular expressions should use raw + strings + +With python 3.12 gdb will produce the following SyntaxWarning when +loading valgrind-monitor-def.py: + + /usr/share/gdb/auto-load/valgrind-monitor-def.py:214: + SyntaxWarning: invalid escape sequence '\[' + if re.fullmatch("^0x[0123456789ABCDEFabcdef]+\[[^\[\]]+\]$", arg_str): + +In a future python version this will become an SyntaxError. + +Use a raw strings for the regular expression. + +https://bugs.kde.org/show_bug.cgi?id=476708 +(cherry picked from commit 0fbfbe05028ad18efda786a256a2738d2c231ed4) + +Upstream-Status: Backport [https://sourceware.org/git/?p=valgrind.git;a=commit;h=027b649fdb831868e71be01cafdacc49a5f419ab] +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + NEWS | 13 +++++++++++++ + coregrind/m_gdbserver/valgrind-monitor-def.py | 2 +- + 2 files changed, 14 insertions(+), 1 deletion(-) + +diff --git a/NEWS b/NEWS +index f11da4be8..ee5b4ff11 100644 +--- a/NEWS ++++ b/NEWS +@@ -1,3 +1,16 @@ ++Branch 3.22 ++~~~~~~~~~~~ ++ ++* ==================== FIXED BUGS ==================== ++ ++The following bugs have been fixed or resolved on this branch. ++ ++476708 valgrind-monitor.py regular expressions should use raw strings ++ ++To see details of a given bug, visit ++ https://bugs.kde.org/show_bug.cgi?id=XXXXXX ++where XXXXXX is the bug number as listed above. ++ + Release 3.22.0 (31 Oct 2023) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +diff --git a/coregrind/m_gdbserver/valgrind-monitor-def.py b/coregrind/m_gdbserver/valgrind-monitor-def.py +index b4e7b992d..d74b1590c 100644 +--- a/coregrind/m_gdbserver/valgrind-monitor-def.py ++++ b/coregrind/m_gdbserver/valgrind-monitor-def.py +@@ -211,7 +211,7 @@ class Valgrind_ADDR_LEN_opt(Valgrind_Command): + For compatibility reason with the Valgrind gdbserver monitor command, + we detect and accept usages such as 0x1234ABCD[10].""" + def invoke(self, arg_str : str, from_tty : bool) -> None: +- if re.fullmatch("^0x[0123456789ABCDEFabcdef]+\[[^\[\]]+\]$", arg_str): ++ if re.fullmatch(r"^0x[0123456789ABCDEFabcdef]+\[[^\[\]]+\]$", arg_str): + arg_str = arg_str.replace("[", " ") + arg_str = arg_str.replace("]", " ") + eval_execute_2(self, arg_str, +-- +2.44.0 + diff --git a/meta/recipes-devtools/valgrind/valgrind/0002-Bug-476548-valgrind-3.22.0-fails-on-assertion-when-l.patch b/meta/recipes-devtools/valgrind/valgrind/0002-Bug-476548-valgrind-3.22.0-fails-on-assertion-when-l.patch new file mode 100644 index 0000000000..5759fa039a --- /dev/null +++ b/meta/recipes-devtools/valgrind/valgrind/0002-Bug-476548-valgrind-3.22.0-fails-on-assertion-when-l.patch @@ -0,0 +1,147 @@ +From 1d00e5ce0fb069911c4b525ec38289fb5d9021b0 Mon Sep 17 00:00:00 2001 +From: Paul Floyd <pjfloyd@wanadoo.fr> +Date: Sat, 18 Nov 2023 08:49:34 +0100 +Subject: [PATCH 2/4] Bug 476548 - valgrind 3.22.0 fails on assertion when + loading debuginfo file produced by mold + +(cherry picked from commit 9ea4ae66707a4dcc6f4328e11911652e4418c585) + +Upstream-Status: Backport [https://sourceware.org/git/?p=valgrind.git;a=commit;h=1d00e5ce0fb069911c4b525ec38289fb5d9021b0] +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + NEWS | 2 ++ + coregrind/m_debuginfo/image.c | 14 +++++++++ + coregrind/m_debuginfo/priv_image.h | 4 +++ + coregrind/m_debuginfo/readelf.c | 49 ++++++++++++++++++++++++++++-- + 4 files changed, 66 insertions(+), 3 deletions(-) + +diff --git a/NEWS b/NEWS +index ee5b4ff11..6cd13429a 100644 +--- a/NEWS ++++ b/NEWS +@@ -5,6 +5,8 @@ Branch 3.22 + + The following bugs have been fixed or resolved on this branch. + ++476548 valgrind 3.22.0 fails on assertion when loading debuginfo ++ file produced by mold + 476708 valgrind-monitor.py regular expressions should use raw strings + + To see details of a given bug, visit +diff --git a/coregrind/m_debuginfo/image.c b/coregrind/m_debuginfo/image.c +index 02e509071..445f95555 100644 +--- a/coregrind/m_debuginfo/image.c ++++ b/coregrind/m_debuginfo/image.c +@@ -1221,6 +1221,20 @@ Int ML_(img_strcmp_c)(DiImage* img, DiOffT off1, const HChar* str2) + } + } + ++Int ML_(img_strcmp_n)(DiImage* img, DiOffT off1, const HChar* str2, Word n) ++{ ++ ensure_valid(img, off1, 1, "ML_(img_strcmp_c)"); ++ while (n) { ++ UChar c1 = get(img, off1); ++ UChar c2 = *(const UChar*)str2; ++ if (c1 < c2) return -1; ++ if (c1 > c2) return 1; ++ if (c1 == 0) return 0; ++ off1++; str2++; --n; ++ } ++ return 0; ++} ++ + UChar ML_(img_get_UChar)(DiImage* img, DiOffT offset) + { + ensure_valid(img, offset, 1, "ML_(img_get_UChar)"); +diff --git a/coregrind/m_debuginfo/priv_image.h b/coregrind/m_debuginfo/priv_image.h +index a49846f14..c91e49f01 100644 +--- a/coregrind/m_debuginfo/priv_image.h ++++ b/coregrind/m_debuginfo/priv_image.h +@@ -115,6 +115,10 @@ Int ML_(img_strcmp)(DiImage* img, DiOffT off1, DiOffT off2); + cast to HChar before comparison. */ + Int ML_(img_strcmp_c)(DiImage* img, DiOffT off1, const HChar* str2); + ++/* Do strncmp of a C string in the image vs a normal one. Chars are ++ cast to HChar before comparison. */ ++Int ML_(img_strcmp_n)(DiImage* img, DiOffT off1, const HChar* str2, Word n); ++ + /* Do strlen of a C string in the image. */ + SizeT ML_(img_strlen)(DiImage* img, DiOffT off); + +diff --git a/coregrind/m_debuginfo/readelf.c b/coregrind/m_debuginfo/readelf.c +index fb64ed976..46f8c8343 100644 +--- a/coregrind/m_debuginfo/readelf.c ++++ b/coregrind/m_debuginfo/readelf.c +@@ -2501,8 +2501,7 @@ Bool ML_(read_elf_object) ( struct _DebugInfo* di ) + di->rodata_avma += inrw1->bias; + di->rodata_bias = inrw1->bias; + di->rodata_debug_bias = inrw1->bias; +- } +- else { ++ } else { + BAD(".rodata"); /* should not happen? */ + } + di->rodata_present = True; +@@ -2977,6 +2976,46 @@ Bool ML_(read_elf_object) ( struct _DebugInfo* di ) + return retval; + } + ++static void find_rodata(Word i, Word shnum, DiImage* dimg, struct _DebugInfo* di, DiOffT shdr_dioff, ++ UWord shdr_dent_szB, DiOffT shdr_strtab_dioff, PtrdiffT rw_dbias) ++{ ++ ElfXX_Shdr a_shdr; ++ ElfXX_Shdr a_extra_shdr; ++ ML_(img_get)(&a_shdr, dimg, ++ INDEX_BIS(shdr_dioff, i, shdr_dent_szB), ++ sizeof(a_shdr)); ++ if (di->rodata_present && ++ 0 == ML_(img_strcmp_c)(dimg, shdr_strtab_dioff ++ + a_shdr.sh_name, ".rodata")) { ++ Word sh_size = a_shdr.sh_size; ++ Word j; ++ Word next_addr = a_shdr.sh_addr + a_shdr.sh_size; ++ for (j = i + 1; j < shnum; ++j) { ++ ML_(img_get)(&a_extra_shdr, dimg, ++ INDEX_BIS(shdr_dioff, j, shdr_dent_szB), ++ sizeof(a_shdr)); ++ if (0 == ML_(img_strcmp_n)(dimg, shdr_strtab_dioff ++ + a_extra_shdr.sh_name, ".rodata", 7)) { ++ if (a_extra_shdr.sh_addr == ++ VG_ROUNDUP(next_addr, a_extra_shdr.sh_addralign)) { ++ sh_size = VG_ROUNDUP(sh_size, a_extra_shdr.sh_addralign) + a_extra_shdr.sh_size; ++ } ++ next_addr = a_extra_shdr.sh_addr + a_extra_shdr.sh_size; ++ } else { ++ break; ++ } ++ } ++ vg_assert(di->rodata_size == sh_size); ++ vg_assert(di->rodata_avma + a_shdr.sh_addr + rw_dbias); ++ di->rodata_debug_svma = a_shdr.sh_addr; ++ di->rodata_debug_bias = di->rodata_bias + ++ di->rodata_svma - di->rodata_debug_svma; ++ TRACE_SYMTAB("acquiring .rodata debug svma = %#lx .. %#lx\n", ++ di->rodata_debug_svma, ++ di->rodata_debug_svma + di->rodata_size - 1); ++ TRACE_SYMTAB("acquiring .rodata debug bias = %#lx\n", (UWord)di->rodata_debug_bias); ++ } ++} + Bool ML_(read_elf_debug) ( struct _DebugInfo* di ) + { + Word i, j; +@@ -3391,7 +3430,11 @@ Bool ML_(read_elf_debug) ( struct _DebugInfo* di ) + FIND(text, rx) + FIND(data, rw) + FIND(sdata, rw) +- FIND(rodata, rw) ++ // https://bugs.kde.org/show_bug.cgi?id=476548 ++ // special handling for rodata as adjacent ++ // rodata sections may have been merged in ML_(read_elf_object) ++ //FIND(rodata, rw) ++ find_rodata(i, ehdr_dimg.e_shnum, dimg, di, shdr_dioff, shdr_dent_szB, shdr_strtab_dioff, rw_dbias); + FIND(bss, rw) + FIND(sbss, rw) + +-- +2.44.0 + diff --git a/meta/recipes-devtools/valgrind/valgrind/0002-context-APIs-are-not-available-on-musl.patch b/meta/recipes-devtools/valgrind/valgrind/0002-context-APIs-are-not-available-on-musl.patch deleted file mode 100644 index 480fe33247..0000000000 --- a/meta/recipes-devtools/valgrind/valgrind/0002-context-APIs-are-not-available-on-musl.patch +++ /dev/null @@ -1,52 +0,0 @@ -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/meta/recipes-devtools/valgrind/valgrind/0002-memcheck-x86-Define-__THROW-if-not-defined.patch b/meta/recipes-devtools/valgrind/valgrind/0002-memcheck-x86-Define-__THROW-if-not-defined.patch deleted file mode 100644 index 5433472291..0000000000 --- a/meta/recipes-devtools/valgrind/valgrind/0002-memcheck-x86-Define-__THROW-if-not-defined.patch +++ /dev/null @@ -1,32 +0,0 @@ -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/meta/recipes-devtools/valgrind/valgrind/0003-Add-fchmodat2-syscall-on-linux.patch b/meta/recipes-devtools/valgrind/valgrind/0003-Add-fchmodat2-syscall-on-linux.patch new file mode 100644 index 0000000000..2a09ca52b7 --- /dev/null +++ b/meta/recipes-devtools/valgrind/valgrind/0003-Add-fchmodat2-syscall-on-linux.patch @@ -0,0 +1,221 @@ +From a43e62dddcf51ec6578a90c5988a41e856b44b05 Mon Sep 17 00:00:00 2001 +From: Mark Wielaard <mark@klomp.org> +Date: Sat, 18 Nov 2023 21:17:02 +0100 +Subject: [PATCH 3/4] Add fchmodat2 syscall on linux + +fchmodat2 is a new syscall on linux 6.6. It is a variant of fchmodat +that takes an extra flags argument. + +https://bugs.kde.org/show_bug.cgi?id=477198 + +(cherry picked from commit 372d09fd9a8d76847c81092ebff71c80fd6c145d) + +Upstream-Status: Backport [https://sourceware.org/git/?p=valgrind.git;a=commit;h=a43e62dddcf51ec6578a90c5988a41e856b44b05] +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + NEWS | 1 + + coregrind/m_syswrap/priv_syswrap-linux.h | 3 +++ + coregrind/m_syswrap/syswrap-amd64-linux.c | 2 ++ + coregrind/m_syswrap/syswrap-arm-linux.c | 2 ++ + coregrind/m_syswrap/syswrap-arm64-linux.c | 2 ++ + coregrind/m_syswrap/syswrap-linux.c | 11 +++++++++++ + coregrind/m_syswrap/syswrap-mips32-linux.c | 2 ++ + coregrind/m_syswrap/syswrap-mips64-linux.c | 1 + + coregrind/m_syswrap/syswrap-nanomips-linux.c | 1 + + coregrind/m_syswrap/syswrap-ppc32-linux.c | 2 ++ + coregrind/m_syswrap/syswrap-ppc64-linux.c | 2 ++ + coregrind/m_syswrap/syswrap-s390x-linux.c | 2 ++ + coregrind/m_syswrap/syswrap-x86-linux.c | 2 ++ + include/vki/vki-scnums-shared-linux.h | 2 ++ + 14 files changed, 35 insertions(+) + +diff --git a/NEWS b/NEWS +index 6cd13429a..da0f8c1aa 100644 +--- a/NEWS ++++ b/NEWS +@@ -8,6 +8,7 @@ The following bugs have been fixed or resolved on this branch. + 476548 valgrind 3.22.0 fails on assertion when loading debuginfo + file produced by mold + 476708 valgrind-monitor.py regular expressions should use raw strings ++477198 Add fchmodat2 syscall on linux + + To see details of a given bug, visit + https://bugs.kde.org/show_bug.cgi?id=XXXXXX +diff --git a/coregrind/m_syswrap/priv_syswrap-linux.h b/coregrind/m_syswrap/priv_syswrap-linux.h +index 7c9decf5a..798c456c9 100644 +--- a/coregrind/m_syswrap/priv_syswrap-linux.h ++++ b/coregrind/m_syswrap/priv_syswrap-linux.h +@@ -331,6 +331,9 @@ DECL_TEMPLATE(linux, sys_openat2); + // Linux-specific (new in Linux 5.14) + DECL_TEMPLATE(linux, sys_memfd_secret); + ++// Since Linux 6.6 ++DECL_TEMPLATE(linux, sys_fchmodat2); ++ + /* --------------------------------------------------------------------- + Wrappers for sockets and ipc-ery. These are split into standalone + procedures because x86-linux hides them inside multiplexors +diff --git a/coregrind/m_syswrap/syswrap-amd64-linux.c b/coregrind/m_syswrap/syswrap-amd64-linux.c +index 008600798..fe17d118b 100644 +--- a/coregrind/m_syswrap/syswrap-amd64-linux.c ++++ b/coregrind/m_syswrap/syswrap-amd64-linux.c +@@ -886,6 +886,8 @@ static SyscallTableEntry syscall_table[] = { + LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), // 441 + + LINXY(__NR_memfd_secret, sys_memfd_secret), // 447 ++ ++ LINX_(__NR_fchmodat2, sys_fchmodat2), // 452 + }; + + SyscallTableEntry* ML_(get_linux_syscall_entry) ( UInt sysno ) +diff --git a/coregrind/m_syswrap/syswrap-arm-linux.c b/coregrind/m_syswrap/syswrap-arm-linux.c +index 9a7a1e0d2..811931d3b 100644 +--- a/coregrind/m_syswrap/syswrap-arm-linux.c ++++ b/coregrind/m_syswrap/syswrap-arm-linux.c +@@ -1059,6 +1059,8 @@ static SyscallTableEntry syscall_main_table[] = { + LINX_(__NR_faccessat2, sys_faccessat2), // 439 + + LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), // 441 ++ ++ LINX_(__NR_fchmodat2, sys_fchmodat2), // 452 + }; + + +diff --git a/coregrind/m_syswrap/syswrap-arm64-linux.c b/coregrind/m_syswrap/syswrap-arm64-linux.c +index 6af7bab83..3307bc2ca 100644 +--- a/coregrind/m_syswrap/syswrap-arm64-linux.c ++++ b/coregrind/m_syswrap/syswrap-arm64-linux.c +@@ -840,6 +840,8 @@ static SyscallTableEntry syscall_main_table[] = { + LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), // 441 + + LINXY(__NR_memfd_secret, sys_memfd_secret), // 447 ++ ++ LINX_(__NR_fchmodat2, sys_fchmodat2), // 452 + }; + + +diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c +index d571fc327..efa47f2e6 100644 +--- a/coregrind/m_syswrap/syswrap-linux.c ++++ b/coregrind/m_syswrap/syswrap-linux.c +@@ -6059,6 +6059,17 @@ PRE(sys_fchmodat) + PRE_MEM_RASCIIZ( "fchmodat(path)", ARG2 ); + } + ++PRE(sys_fchmodat2) ++{ ++ PRINT("sys_fchmodat2 ( %ld, %#" FMT_REGWORD "x(%s), %" FMT_REGWORD "u, %" ++ FMT_REGWORD "u )", ++ SARG1, ARG2, (HChar*)(Addr)ARG2, ARG3, ARG4); ++ PRE_REG_READ4(long, "fchmodat2", ++ int, dfd, const char *, path, vki_mode_t, mode, ++ unsigned int, flags); ++ PRE_MEM_RASCIIZ( "fchmodat2(pathname)", ARG2 ); ++} ++ + PRE(sys_faccessat) + { + PRINT("sys_faccessat ( %ld, %#" FMT_REGWORD "x(%s), %ld )", +diff --git a/coregrind/m_syswrap/syswrap-mips32-linux.c b/coregrind/m_syswrap/syswrap-mips32-linux.c +index 6268a00dd..74a1f6eac 100644 +--- a/coregrind/m_syswrap/syswrap-mips32-linux.c ++++ b/coregrind/m_syswrap/syswrap-mips32-linux.c +@@ -1143,6 +1143,8 @@ static SyscallTableEntry syscall_main_table[] = { + LINX_ (__NR_faccessat2, sys_faccessat2), // 439 + + LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), // 441 ++ ++ LINX_(__NR_fchmodat2, sys_fchmodat2), // 452 + }; + + SyscallTableEntry* ML_(get_linux_syscall_entry) (UInt sysno) +diff --git a/coregrind/m_syswrap/syswrap-mips64-linux.c b/coregrind/m_syswrap/syswrap-mips64-linux.c +index 6cdf25893..4e8508b7a 100644 +--- a/coregrind/m_syswrap/syswrap-mips64-linux.c ++++ b/coregrind/m_syswrap/syswrap-mips64-linux.c +@@ -820,6 +820,7 @@ static SyscallTableEntry syscall_main_table[] = { + LINXY (__NR_close_range, sys_close_range), + LINX_ (__NR_faccessat2, sys_faccessat2), + LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), ++ LINX_ (__NR_fchmodat2, sys_fchmodat2), + }; + + SyscallTableEntry * ML_(get_linux_syscall_entry) ( UInt sysno ) +diff --git a/coregrind/m_syswrap/syswrap-nanomips-linux.c b/coregrind/m_syswrap/syswrap-nanomips-linux.c +index d724cde74..7859900c1 100644 +--- a/coregrind/m_syswrap/syswrap-nanomips-linux.c ++++ b/coregrind/m_syswrap/syswrap-nanomips-linux.c +@@ -829,6 +829,7 @@ static SyscallTableEntry syscall_main_table[] = { + LINXY (__NR_close_range, sys_close_range), + LINX_ (__NR_faccessat2, sys_faccessat2), + LINXY (__NR_epoll_pwait2, sys_epoll_pwait2), ++ LINX_ (__NR_fchmodat2, sys_fchmodat2), + }; + + SyscallTableEntry* ML_(get_linux_syscall_entry) (UInt sysno) +diff --git a/coregrind/m_syswrap/syswrap-ppc32-linux.c b/coregrind/m_syswrap/syswrap-ppc32-linux.c +index c0cfef235..1e19116ee 100644 +--- a/coregrind/m_syswrap/syswrap-ppc32-linux.c ++++ b/coregrind/m_syswrap/syswrap-ppc32-linux.c +@@ -1063,6 +1063,8 @@ static SyscallTableEntry syscall_table[] = { + LINX_(__NR_faccessat2, sys_faccessat2), // 439 + + LINXY (__NR_epoll_pwait2, sys_epoll_pwait2), // 441 ++ ++ LINX_ (__NR_fchmodat2, sys_fchmodat2), // 452 + }; + + SyscallTableEntry* ML_(get_linux_syscall_entry) ( UInt sysno ) +diff --git a/coregrind/m_syswrap/syswrap-ppc64-linux.c b/coregrind/m_syswrap/syswrap-ppc64-linux.c +index f5976f30c..1097212a4 100644 +--- a/coregrind/m_syswrap/syswrap-ppc64-linux.c ++++ b/coregrind/m_syswrap/syswrap-ppc64-linux.c +@@ -1032,6 +1032,8 @@ static SyscallTableEntry syscall_table[] = { + LINX_(__NR_faccessat2, sys_faccessat2), // 439 + + LINXY (__NR_epoll_pwait2, sys_epoll_pwait2), // 441 ++ ++ LINX_ (__NR_fchmodat2, sys_fchmodat2), // 452 + }; + + SyscallTableEntry* ML_(get_linux_syscall_entry) ( UInt sysno ) +diff --git a/coregrind/m_syswrap/syswrap-s390x-linux.c b/coregrind/m_syswrap/syswrap-s390x-linux.c +index afba154e7..3588672c7 100644 +--- a/coregrind/m_syswrap/syswrap-s390x-linux.c ++++ b/coregrind/m_syswrap/syswrap-s390x-linux.c +@@ -873,6 +873,8 @@ static SyscallTableEntry syscall_table[] = { + LINX_(__NR_faccessat2, sys_faccessat2), // 439 + + LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), // 441 ++ ++ LINX_ (__NR_fchmodat2, sys_fchmodat2), // 452 + }; + + SyscallTableEntry* ML_(get_linux_syscall_entry) ( UInt sysno ) +diff --git a/coregrind/m_syswrap/syswrap-x86-linux.c b/coregrind/m_syswrap/syswrap-x86-linux.c +index da4fd8fa2..58badc6b0 100644 +--- a/coregrind/m_syswrap/syswrap-x86-linux.c ++++ b/coregrind/m_syswrap/syswrap-x86-linux.c +@@ -1658,6 +1658,8 @@ static SyscallTableEntry syscall_table[] = { + LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), // 441 + + LINXY(__NR_memfd_secret, sys_memfd_secret), // 447 ++ ++ LINX_(__NR_fchmodat2, sys_fchmodat2), // 452 + }; + + SyscallTableEntry* ML_(get_linux_syscall_entry) ( UInt sysno ) +diff --git a/include/vki/vki-scnums-shared-linux.h b/include/vki/vki-scnums-shared-linux.h +index 542382b53..a4cd87149 100644 +--- a/include/vki/vki-scnums-shared-linux.h ++++ b/include/vki/vki-scnums-shared-linux.h +@@ -50,4 +50,6 @@ + + #define __NR_memfd_secret 447 + ++#define __NR_fchmodat2 452 ++ + #endif +-- +2.44.0 + diff --git a/meta/recipes-devtools/valgrind/valgrind/0003-tests-seg_override-Replace-__modify_ldt-with-syscall.patch b/meta/recipes-devtools/valgrind/valgrind/0003-tests-seg_override-Replace-__modify_ldt-with-syscall.patch deleted file mode 100644 index fa1344c853..0000000000 --- a/meta/recipes-devtools/valgrind/valgrind/0003-tests-seg_override-Replace-__modify_ldt-with-syscall.patch +++ /dev/null @@ -1,68 +0,0 @@ -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/meta/recipes-devtools/valgrind/valgrind/0004-Bug-478624-Valgrind-incompatibility-with-binutils-2..patch b/meta/recipes-devtools/valgrind/valgrind/0004-Bug-478624-Valgrind-incompatibility-with-binutils-2..patch new file mode 100644 index 0000000000..4e9185508a --- /dev/null +++ b/meta/recipes-devtools/valgrind/valgrind/0004-Bug-478624-Valgrind-incompatibility-with-binutils-2..patch @@ -0,0 +1,137 @@ +From 41ff9aa49f6c54c66d0e6b37f265fd9cb0176057 Mon Sep 17 00:00:00 2001 +From: Paul Floyd <pjfloyd@wanadoo.fr> +Date: Sun, 17 Dec 2023 14:18:51 +0100 +Subject: [PATCH 4/4] Bug 478624 - Valgrind incompatibility with binutils-2.42 + on x86 with new nop patterns (unhandled instruction bytes: 0x2E 0x8D 0xB4 + 0x26) + +It was a bit of a struggle to get the testcase to build +with both clang and gcc (oddly enough gcc was more difficult) so +I just resorted to using .byte arrays. + +(cherry picked from commit d35005cef8ad8207542738812705ceabf137d7e0) + +Upstream-Status: Backport [https://sourceware.org/git/?p=valgrind.git;a=commit;h=41ff9aa49f6c54c66d0e6b37f265fd9cb0176057] +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + .gitignore | 1 + + NEWS | 2 ++ + VEX/priv/guest_x86_toIR.c | 22 +++++++++++++- + none/tests/x86/Makefile.am | 2 ++ + none/tests/x86/gnu_binutils_nop.c | 34 ++++++++++++++++++++++ + none/tests/x86/gnu_binutils_nop.stderr.exp | 0 + none/tests/x86/gnu_binutils_nop.vgtest | 2 ++ + 7 files changed, 62 insertions(+), 1 deletion(-) + create mode 100644 none/tests/x86/gnu_binutils_nop.c + create mode 100644 none/tests/x86/gnu_binutils_nop.stderr.exp + create mode 100644 none/tests/x86/gnu_binutils_nop.vgtest + +--- a/NEWS ++++ b/NEWS +@@ -9,6 +9,8 @@ The following bugs have been fixed or re + file produced by mold + 476708 valgrind-monitor.py regular expressions should use raw strings + 477198 Add fchmodat2 syscall on linux ++478624 Valgrind incompatibility with binutils-2.42 on x86 with new nop patterns ++ (unhandled instruction bytes: 0x2E 0x8D 0xB4 0x26) + + To see details of a given bug, visit + https://bugs.kde.org/show_bug.cgi?id=XXXXXX +--- a/VEX/priv/guest_x86_toIR.c ++++ b/VEX/priv/guest_x86_toIR.c +@@ -8198,7 +8198,7 @@ DisResult disInstr_X86_WRK ( + delta += 5; + goto decode_success; + } +- /* Don't barf on recent binutils padding, ++ /* Don't barf on recent (2010) binutils padding, + all variants of which are: nopw %cs:0x0(%eax,%eax,1) + 66 2e 0f 1f 84 00 00 00 00 00 + 66 66 2e 0f 1f 84 00 00 00 00 00 +@@ -8222,6 +8222,26 @@ DisResult disInstr_X86_WRK ( + goto decode_success; + } + } ++ ++ /* bug478624 GNU binutils uses a leal of esi into itself with ++ a zero offset and CS prefix as an 8 byte no-op (Dec 2023). ++ Since the CS prefix is hardly ever used we don't do much ++ to decode it, just a few cases for conditional branches. ++ So add handling here with other pseudo-no-ops. ++ */ ++ if (code[0] == 0x2E && code[1] == 0x8D) { ++ if (code[2] == 0x74 && code[3] == 0x26 && code[4] == 0x00) { ++ DIP("leal %%cs:0(%%esi,%%eiz,1),%%esi\n"); ++ delta += 5; ++ goto decode_success; ++ } ++ if (code[2] == 0xB4 && code[3] == 0x26 && code[4] == 0x00 ++ && code[5] == 0x00 && code[6] == 0x00 && code[7] == 0x00) { ++ DIP("leal %%cs:0(%%esi,%%eiz,1),%%esi\n"); ++ delta += 8; ++ goto decode_success; ++ } ++ } + + // Intel CET requires the following opcodes to be treated as NOPs + // with any prefix and ModRM, SIB and disp combination: +--- a/none/tests/x86/Makefile.am ++++ b/none/tests/x86/Makefile.am +@@ -52,6 +52,7 @@ EXTRA_DIST = \ + fxtract.stdout.exp fxtract.stderr.exp fxtract.vgtest \ + fxtract.stdout.exp-older-glibc \ + getseg.stdout.exp getseg.stderr.exp getseg.vgtest \ ++ gnu_binutils_nop.stderr.exp gnu_binutils_nop.vgtest \ + incdec_alt.stdout.exp incdec_alt.stderr.exp incdec_alt.vgtest \ + int.stderr.exp int.stdout.exp int.disabled \ + $(addsuffix .stderr.exp,$(INSN_TESTS)) \ +@@ -100,6 +101,7 @@ check_PROGRAMS = \ + fpu_lazy_eflags \ + fxtract \ + getseg \ ++ gnu_binutils_nop \ + incdec_alt \ + $(INSN_TESTS) \ + int \ +--- /dev/null ++++ b/none/tests/x86/gnu_binutils_nop.c +@@ -0,0 +1,34 @@ ++int main(void) ++{ ++ // GNU binutils uses various opcodes as alternatives for nop ++ // the idea is that it is faster to execute one large opcode ++ // with no side-effects than multiple repetitions of the ++ // single byte 'nop'. This gives more choice when code ++ // needs to be padded. ++ ++ // the following is based on ++ // https://sourceware.org/cgit/binutils-gdb/tree/gas/config/tc-i386.c#n1256 ++ ++ // one byte ++ __asm__ __volatile__("nop"); ++ // two bytes ++ __asm__ __volatile__("xchg %ax,%ax"); ++ // three bytes ++ //__asm__ __volatile__("leal 0(%esi),%esi"); ++ __asm__ __volatile__(".byte 0x8d,0x76,0x00"); ++ // four bytes ++ //__asm__ __volatile__("leal 0(%esi,%eiz),%esi"); ++ __asm__ __volatile__(".byte 0x8d,0x74,0x26,0x00"); ++ // five bytes ++ //__asm__ __volatile__("leal %cs:0(%esi,%eiz),%esi"); ++ __asm__ __volatile__(".byte 0x2e,0x8d,0x74,0x26,0x00"); ++ // six bytes ++ //__asm__ __volatile__("leal 0L(%esi),%esi"); ++ __asm__ __volatile__(".byte 0x8d,0xb6,0x00,0x00,0x00,0x00"); ++ // seven bytes ++ //__asm__ __volatile__("leal 0L(%esi,%eiz),%esi"); ++ __asm__ __volatile__(".byte 0x8d,0xb4,0x26,0x00,0x00,0x00,0x00"); ++ // eight bytes ++ //__asm__ __volatile__("leal %cs:0L(%esi,%eiz),%esi"); ++ __asm__ __volatile__(".byte 0x2e,0x8d,0xb4,0x26,0x00,0x00,0x00,0x00"); ++} +--- /dev/null ++++ b/none/tests/x86/gnu_binutils_nop.vgtest +@@ -0,0 +1,2 @@ ++prog: gnu_binutils_nop ++vgopts: -q diff --git a/meta/recipes-devtools/valgrind/valgrind/0004-Fix-out-of-tree-builds.patch b/meta/recipes-devtools/valgrind/valgrind/0004-Fix-out-of-tree-builds.patch deleted file mode 100644 index 4570f63995..0000000000 --- a/meta/recipes-devtools/valgrind/valgrind/0004-Fix-out-of-tree-builds.patch +++ /dev/null @@ -1,185 +0,0 @@ -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 | 66 ++++++++++++++++++++++++++-------------------------- - 1 file changed, 33 insertions(+), 33 deletions(-) - -diff --git a/configure.ac b/configure.ac -index 524230d..54861c5 100755 ---- a/configure.ac -+++ b/configure.ac -@@ -396,50 +396,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]) -@@ -464,7 +464,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 - ;; -@@ -472,7 +472,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}" - ;; - - *) -@@ -1095,29 +1095,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) -@@ -1126,8 +1126,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) -@@ -1137,7 +1137,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) -@@ -1164,8 +1164,8 @@ 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}" - fi - - --- -2.17.1 - diff --git a/meta/recipes-devtools/valgrind/valgrind/0005-Modify-vg_test-wrapper-to-support-PTEST-formats.patch b/meta/recipes-devtools/valgrind/valgrind/0005-Modify-vg_test-wrapper-to-support-PTEST-formats.patch index 0c399ef52c..fea3b00f62 100644 --- a/meta/recipes-devtools/valgrind/valgrind/0005-Modify-vg_test-wrapper-to-support-PTEST-formats.patch +++ b/meta/recipes-devtools/valgrind/valgrind/0005-Modify-vg_test-wrapper-to-support-PTEST-formats.patch @@ -1,7 +1,7 @@ -From f49f27f1bc67d07440b0ac9a7d767a8ea1589bfe Mon Sep 17 00:00:00 2001 +From e244a72c6f8803550f37e81f72bbae039651013b 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 +Subject: [PATCH] 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 @@ -14,7 +14,7 @@ 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 +Upstream-Status: Inappropriate [oe-core specific] Signed-off-by: Dave Lerner <dave.lerner@windriver.com> Signed-off-by: Tudor Florea <tudor.florea@enea.com> @@ -25,11 +25,11 @@ Increase time limit to 90 s. Signed-off-by: Yi Fan Yu <yifan.yu@windriver.com> --- - tests/vg_regtest.in | 75 +++++++++++++++++++++++++++++++++++++++-------------- + 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 +index ad18800..e4bd8cb 100755 --- a/tests/vg_regtest.in +++ b/tests/vg_regtest.in @@ -47,6 +47,7 @@ @@ -49,7 +49,7 @@ index a441f42..cb05b52 100755 . " Use EXTRA_REGTEST_OPTS to supply extra args for all tests\n" . "\n"; -@@ -186,6 +187,7 @@ my $outer_args; +@@ -187,6 +188,7 @@ my $run_outer_args = ""; my $valgrind_lib = "$tests_dir/.in_place"; my $keepunfiltered = 0; my $looptillfail = 0; @@ -57,7 +57,7 @@ index a441f42..cb05b52 100755 # 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() +@@ -245,6 +247,8 @@ sub process_command_line() $keepunfiltered = 1; } elsif ($arg =~ /^--loop-till-fail$/) { $looptillfail = 1; @@ -66,7 +66,7 @@ index a441f42..cb05b52 100755 } else { die $usage; } -@@ -365,13 +369,28 @@ sub read_vgtest_file($) +@@ -376,13 +380,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. @@ -100,7 +100,7 @@ index a441f42..cb05b52 100755 # if $keepunfiltered, copies $1 to $1.unfiltered.out # renames $0 tp $1 sub filtered_rename($$) -@@ -419,23 +438,25 @@ sub do_diffs($$$$) +@@ -430,23 +449,25 @@ sub do_diffs($$$$) # A match; remove .out and any previously created .diff files. unlink("$name.$mid.out"); unlink(<$name.$mid.diff*>); @@ -128,7 +128,7 @@ index a441f42..cb05b52 100755 $vgtest =~ /^(.*)\.vgtest/; my $name = $1; my $fullname = "$dir/$name"; -@@ -454,7 +475,11 @@ sub do_one_test($$) +@@ -465,7 +486,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. @@ -141,7 +141,7 @@ index a441f42..cb05b52 100755 return; } else { # Bad prereq; abort. -@@ -472,7 +497,7 @@ sub do_one_test($$) +@@ -483,7 +508,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", @@ -150,7 +150,7 @@ index a441f42..cb05b52 100755 # 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($$) +@@ -499,7 +524,8 @@ sub do_one_test($$) . "touch progB.done) &"); } } else { @@ -160,7 +160,7 @@ index a441f42..cb05b52 100755 } # Collect environment variables, if any. -@@ -529,7 +555,7 @@ sub do_one_test($$) +@@ -540,7 +566,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); @@ -169,7 +169,7 @@ index a441f42..cb05b52 100755 # Filter stderr $stderr_filter_args = $name if (! defined $stderr_filter_args); -@@ -538,7 +564,7 @@ sub do_one_test($$) +@@ -549,7 +575,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"; @@ -178,7 +178,7 @@ index a441f42..cb05b52 100755 if (defined $progB) { # wait for the child to be finished -@@ -562,7 +588,7 @@ sub do_one_test($$) +@@ -573,7 +599,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); @@ -187,7 +187,7 @@ index a441f42..cb05b52 100755 # Filter stderr $stderrB_filter_args = $name if (! defined $stderrB_filter_args); -@@ -571,7 +597,7 @@ sub do_one_test($$) +@@ -582,7 +608,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"; @@ -196,7 +196,7 @@ index a441f42..cb05b52 100755 } # Maybe do post-test check -@@ -583,7 +609,7 @@ sub do_one_test($$) +@@ -594,7 +620,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); @@ -205,7 +205,7 @@ index a441f42..cb05b52 100755 } } -@@ -592,6 +618,13 @@ sub do_one_test($$) +@@ -603,6 +629,13 @@ sub do_one_test($$) print("(cleanup operation failed: $cleanup)\n"); } @@ -219,25 +219,25 @@ index a441f42..cb05b52 100755 $num_tests_done++; } -@@ -631,7 +664,7 @@ sub test_one_dir($$) - my $found_tests = (0 != (grep { $_ =~ /\.vgtest$/ } @fs)); +@@ -643,7 +676,7 @@ sub test_one_dir($$) + my $tests_start_time = time; 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"; +@@ -657,7 +690,7 @@ sub test_one_dir($$) + my $end_time = "(in $tests_cost_time sec)"; + my $end_dashes = "-" x (50 - (length $full_dir) + - (length $end_time) - 1); +- print "-- Finished tests in $full_dir $end_time $end_dashes\n"; + print "-- Finished tests in $full_dir $dashes\n" if ($yoctoptest == 0); } chdir(".."); -@@ -667,10 +700,12 @@ sub summarise_results +@@ -683,10 +716,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"}), @@ -253,5 +253,5 @@ index a441f42..cb05b52 100755 print "\n"; } -- -2.6.2 +2.30.2 diff --git a/meta/recipes-devtools/valgrind/valgrind/0005-tc20_verifywrap.c-Fake-__GLIBC_PREREQ-with-musl.patch b/meta/recipes-devtools/valgrind/valgrind/0005-tc20_verifywrap.c-Fake-__GLIBC_PREREQ-with-musl.patch deleted file mode 100644 index 6176640e42..0000000000 --- a/meta/recipes-devtools/valgrind/valgrind/0005-tc20_verifywrap.c-Fake-__GLIBC_PREREQ-with-musl.patch +++ /dev/null @@ -1,30 +0,0 @@ -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/meta/recipes-devtools/valgrind/valgrind/Added-support-for-PPC-instructions-mfatbu-mfatbl.patch b/meta/recipes-devtools/valgrind/valgrind/Added-support-for-PPC-instructions-mfatbu-mfatbl.patch index 07774f38a9..51cd3532d3 100644 --- a/meta/recipes-devtools/valgrind/valgrind/Added-support-for-PPC-instructions-mfatbu-mfatbl.patch +++ b/meta/recipes-devtools/valgrind/valgrind/Added-support-for-PPC-instructions-mfatbu-mfatbl.patch @@ -3,14 +3,14 @@ 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 +Upstream-Status: Submitted [https://bugs.kde.org/show_bug.cgi?id=289836] + +Signed-off-by: Aneesh Bansal <aneesh.bansal@freescale.com> +--- VEX/priv/guest_ppc_defs.h | 2 ++ VEX/priv/guest_ppc_helpers.c | 18 ++++++++++++++++++ diff --git a/meta/recipes-devtools/valgrind/valgrind/avoid-neon-for-targets-which-don-t-support-it.patch b/meta/recipes-devtools/valgrind/valgrind/avoid-neon-for-targets-which-don-t-support-it.patch index 5fcfec0015..82b8344279 100644 --- a/meta/recipes-devtools/valgrind/valgrind/avoid-neon-for-targets-which-don-t-support-it.patch +++ b/meta/recipes-devtools/valgrind/valgrind/avoid-neon-for-targets-which-don-t-support-it.patch @@ -8,7 +8,7 @@ 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 +Upstream-Status: Submitted [https://bugs.kde.org/show_bug.cgi?id=454346] Signed-off-by: Andre McCurdy <armccurdy@gmail.com> --- diff --git a/meta/recipes-devtools/valgrind/valgrind/fixed-perl-path.patch b/meta/recipes-devtools/valgrind/valgrind/fixed-perl-path.patch index b431d3356e..b9804e7451 100644 --- a/meta/recipes-devtools/valgrind/valgrind/fixed-perl-path.patch +++ b/meta/recipes-devtools/valgrind/valgrind/fixed-perl-path.patch @@ -1,4 +1,4 @@ -From 67e7a690107efb16d6d5aebfe420b64a552accdf Mon Sep 17 00:00:00 2001 +From beaa5b64c60d501fa9cd59fdc563e5f5bccf6882 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 @@ -17,35 +17,15 @@ a better fix would need: 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(-) + massif/ms_print.in | 2 +- + perf/vg_perf.in | 2 +- + tests/vg_regtest.in | 2 +- + 3 files changed, 3 insertions(+), 3 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 +index a206ce4..df1bc31 100755 --- a/massif/ms_print.in +++ b/massif/ms_print.in @@ -1,4 +1,4 @@ @@ -55,7 +35,7 @@ index e6fae89..3b85b40 100755 ##--------------------------------------------------------------------## ##--- Massif's results printer ms_print.in ---## diff --git a/perf/vg_perf.in b/perf/vg_perf.in -index 7a80cb0..28f6156 100644 +index 90ee1d2..c585096 100644 --- a/perf/vg_perf.in +++ b/perf/vg_perf.in @@ -1,4 +1,4 @@ @@ -65,7 +45,7 @@ index 7a80cb0..28f6156 100644 ##--- Valgrind performance testing script vg_perf ---## ##--------------------------------------------------------------------## diff --git a/tests/vg_regtest.in b/tests/vg_regtest.in -index cb05b52..032e947 100755 +index 7152765..ad18800 100755 --- a/tests/vg_regtest.in +++ b/tests/vg_regtest.in @@ -1,4 +1,4 @@ @@ -74,5 +54,3 @@ index cb05b52..032e947 100755 ##--------------------------------------------------------------------## ##--- Valgrind regression testing script vg_regtest ---## ##--------------------------------------------------------------------## ---- -2.4.0 diff --git a/meta/recipes-devtools/valgrind/valgrind/remove-for-aarch64 b/meta/recipes-devtools/valgrind/valgrind/remove-for-aarch64 index 93bfd45a4e..5bfba1c8d3 100644 --- a/meta/recipes-devtools/valgrind/valgrind/remove-for-aarch64 +++ b/meta/recipes-devtools/valgrind/valgrind/remove-for-aarch64 @@ -1,215 +1,8 @@ -gdbserver_tests/hgtls -cachegrind/tests/ann1 -callgrind/tests/simwork1 -callgrind/tests/simwork2 -callgrind/tests/simwork3 -callgrind/tests/simwork-both -callgrind/tests/simwork-cache -callgrind/tests/threads -callgrind/tests/threads-use -drd/tests/annotate_barrier -drd/tests/annotate_barrier_xml -drd/tests/annotate_hbefore -drd/tests/annotate_hb_err -drd/tests/annotate_hb_race -drd/tests/annotate_ignore_read -drd/tests/annotate_ignore_rw -drd/tests/annotate_ignore_rw2 -drd/tests/annotate_ignore_write -drd/tests/annotate_ignore_write2 -drd/tests/annotate_order_1 -drd/tests/annotate_order_2 -drd/tests/annotate_order_3 -drd/tests/annotate_publish_hg -drd/tests/annotate_rwlock -drd/tests/annotate_rwlock_hg drd/tests/annotate_sem -drd/tests/annotate_smart_pointer -drd/tests/annotate_smart_pointer2 -drd/tests/annotate_spinlock -drd/tests/annotate_static -drd/tests/annotate_trace_memory -drd/tests/annotate_trace_memory_xml -drd/tests/atomic_var -drd/tests/bar_trivial -drd/tests/bug-235681 -drd/tests/bug322621 -drd/tests/circular_buffer -drd/tests/concurrent_close -drd/tests/custom_alloc -drd/tests/custom_alloc_fiw -drd/tests/dlopen -drd/tests/fork-parallel -drd/tests/fork-serial -drd/tests/fp_race -drd/tests/fp_race2 -drd/tests/fp_race_xml -drd/tests/free_is_write -drd/tests/free_is_write2 -drd/tests/hg01_all_ok -drd/tests/hg02_deadlock -drd/tests/hg03_inherit -drd/tests/hg04_race -drd/tests/hg05_race2 -drd/tests/hg06_readshared -drd/tests/hold_lock_1 -drd/tests/hold_lock_2 -drd/tests/linuxthreads_det -drd/tests/matinv -drd/tests/memory_allocation -drd/tests/monitor_example -drd/tests/new_delete -drd/tests/pth_barrier -drd/tests/pth_barrier2 -drd/tests/pth_barrier3 -drd/tests/pth_barrier_race -drd/tests/pth_barrier_reinit -drd/tests/pth_barrier_thr_cr -drd/tests/pth_broadcast -drd/tests/pth_cancel_locked -drd/tests/pth_cleanup_handler -drd/tests/pth_cond_race -drd/tests/pth_cond_race2 -drd/tests/pth_detached2 -drd/tests/pth_detached3 -drd/tests/pth_detached_sem -drd/tests/pth_inconsistent_cond_wait -drd/tests/pth_mutex_reinit -drd/tests/pth_once -drd/tests/pth_process_shared_mutex -drd/tests/pth_spinlock -drd/tests/pth_uninitialized_cond -drd/tests/read_and_free_race -drd/tests/recursive_mutex -drd/tests/rwlock_race -drd/tests/rwlock_test -drd/tests/rwlock_type_checking -drd/tests/sem_as_mutex -drd/tests/sem_as_mutex2 -drd/tests/sem_as_mutex3 -drd/tests/sem_open -drd/tests/sem_open2 -drd/tests/sem_open3 -drd/tests/sem_open_traced -drd/tests/sem_wait -drd/tests/sigalrm -drd/tests/sigaltstack -drd/tests/std_atomic -drd/tests/std_string -drd/tests/std_thread -drd/tests/std_thread2 -drd/tests/str_tester -drd/tests/tc01_simple_race -drd/tests/tc02_simple_tls -drd/tests/tc03_re_excl -drd/tests/tc04_free_lock -drd/tests/tc05_simple_race -drd/tests/tc06_two_races -drd/tests/tc07_hbl1 -drd/tests/tc08_hbl2 -drd/tests/tc09_bad_unlock -drd/tests/tc10_rec_lock -drd/tests/tc11_XCHG -drd/tests/tc12_rwl_trivial -drd/tests/tc13_laog1 -drd/tests/tc15_laog_lockdel -drd/tests/tc16_byterace -drd/tests/tc17_sembar -drd/tests/tc18_semabuse -drd/tests/tc19_shadowmem -drd/tests/tc21_pthonce -drd/tests/tc22_exit_w_lock -drd/tests/tc23_bogus_condwait -helgrind/tests/annotate_rwlock -helgrind/tests/annotate_smart_pointer -helgrind/tests/bar_bad -helgrind/tests/bar_trivial -helgrind/tests/bug322621 -helgrind/tests/cond_init_destroy -helgrind/tests/cond_timedwait_invalid -helgrind/tests/cond_timedwait_test -helgrind/tests/free_is_write -helgrind/tests/hg01_all_ok -helgrind/tests/hg03_inherit -helgrind/tests/hg04_race +gdbserver_tests/hgtls helgrind/tests/hg05_race2 -helgrind/tests/hg06_readshared -helgrind/tests/locked_vs_unlocked1_fwd -helgrind/tests/locked_vs_unlocked1_rev -helgrind/tests/locked_vs_unlocked2 -helgrind/tests/locked_vs_unlocked3 -helgrind/tests/pth_barrier1 -helgrind/tests/pth_barrier2 -helgrind/tests/pth_barrier3 -helgrind/tests/pth_destroy_cond -helgrind/tests/rwlock_race -helgrind/tests/rwlock_test -helgrind/tests/shmem_abits -helgrind/tests/stackteardown -helgrind/tests/t2t_laog -helgrind/tests/tc01_simple_race -helgrind/tests/tc02_simple_tls -helgrind/tests/tc03_re_excl -helgrind/tests/tc04_free_lock -helgrind/tests/tc05_simple_race -helgrind/tests/tc06_two_races -helgrind/tests/tc06_two_races_xml -helgrind/tests/tc07_hbl1 -helgrind/tests/tc08_hbl2 -helgrind/tests/tc09_bad_unlock -helgrind/tests/tc10_rec_lock -helgrind/tests/tc11_XCHG -helgrind/tests/tc12_rwl_trivial -helgrind/tests/tc13_laog1 -helgrind/tests/tc14_laog_dinphils -helgrind/tests/tc15_laog_lockdel -helgrind/tests/tc16_byterace -helgrind/tests/tc17_sembar -helgrind/tests/tc18_semabuse -helgrind/tests/tc19_shadowmem helgrind/tests/tc20_verifywrap -helgrind/tests/tc21_pthonce -helgrind/tests/tc22_exit_w_lock -helgrind/tests/tc23_bogus_condwait -helgrind/tests/tc24_nonzero_sem -helgrind/tests/tls_threads -memcheck/tests/accounting -memcheck/tests/addressable -memcheck/tests/arm64-linux/scalar -memcheck/tests/atomic_incs -memcheck/tests/badaddrvalue -memcheck/tests/badfree -memcheck/tests/badfree-2trace -memcheck/tests/badfree3 -memcheck/tests/badjump -memcheck/tests/badjump2 -memcheck/tests/badloop -memcheck/tests/badpoll -memcheck/tests/badrw -memcheck/tests/big_blocks_freed_list -memcheck/tests/brk2 memcheck/tests/dw4 -memcheck/tests/err_disable4 -memcheck/tests/err_disable_arange1 -memcheck/tests/leak-autofreepool-5 -memcheck/tests/leak_cpp_interior -memcheck/tests/linux/lsframe1 -memcheck/tests/linux/lsframe2 -memcheck/tests/linux/with-space -memcheck/tests/origin5-bz2 -memcheck/tests/origin6-fp -memcheck/tests/overlap -memcheck/tests/partial_load_dflt -memcheck/tests/pdb-realloc2 -memcheck/tests/sh-mem -memcheck/tests/sh-mem-random -memcheck/tests/sigaltstack -memcheck/tests/sigkill -memcheck/tests/signal2 -memcheck/tests/supp_unknown -memcheck/tests/threadname -memcheck/tests/threadname_xml -memcheck/tests/unit_oset memcheck/tests/varinfo1 memcheck/tests/varinfo2 memcheck/tests/varinfo3 @@ -217,19 +10,23 @@ memcheck/tests/varinfo4 memcheck/tests/varinfo5 memcheck/tests/varinfo6 memcheck/tests/varinforestrict -memcheck/tests/vcpu_bz2 -memcheck/tests/vcpu_fbench -memcheck/tests/vcpu_fnfns -memcheck/tests/wcs -memcheck/tests/wrap1 -memcheck/tests/wrap2 -memcheck/tests/wrap3 -memcheck/tests/wrap4 -memcheck/tests/wrap5 -memcheck/tests/wrap6 -memcheck/tests/wrap7 -memcheck/tests/wrap8 -memcheck/tests/wrapmalloc -memcheck/tests/wrapmallocstatic -memcheck/tests/writev1 -memcheck/tests/xml1 +memcheck/tests/atomic_incs +memcheck/tests/bug464969_d_demangle +memcheck/tests/cxx17_aligned_new +memcheck/tests/demangle +memcheck/tests/long_namespace_xml +memcheck/tests/mismatches +memcheck/tests/mismatches_xml +memcheck/tests/new_aligned_delete_default +memcheck/tests/new_delete_mismatch_size +memcheck/tests/new_nothrow +memcheck/tests/realloc_size_zero_mismatch +memcheck/tests/sized_aligned_new_delete_args +memcheck/tests/sized_aligned_new_delete_misaligned1 +memcheck/tests/sized_aligned_new_delete_misaligned1_xml +memcheck/tests/sized_aligned_new_delete_misaligned2 +memcheck/tests/sized_aligned_new_delete_misaligned2_xml +memcheck/tests/sized_aligned_new_delete_misaligned3 +memcheck/tests/sized_aligned_new_delete_misaligned3_xml +memcheck/tests/sized_delete +none/tests/bigcode diff --git a/meta/recipes-devtools/valgrind/valgrind/remove-for-all b/meta/recipes-devtools/valgrind/valgrind/remove-for-all index d6a85c4735..8435a6d41d 100644 --- a/meta/recipes-devtools/valgrind/valgrind/remove-for-all +++ b/meta/recipes-devtools/valgrind/valgrind/remove-for-all @@ -1,2 +1,29 @@ +cachegrind/tests/wrap5 +drd/tests/boost_thread +none/tests/amd64/fb_test_amd64 +none/tests/tls +gdbserver_tests/hginfo +gdbserver_tests/mcinvokeRU +memcheck/tests/linux/dlclose_leak-no-keep +memcheck/tests/linux/dlclose_leak +memcheck/tests/linux/timerfd-syscall +memcheck/tests/supp_unknown +memcheck/tests/wrap1 +memcheck/tests/wrap2 +memcheck/tests/wrap3 +memcheck/tests/wrap4 +memcheck/tests/wrap5 +memcheck/tests/wrap6 +memcheck/tests/wrap7 +memcheck/tests/wrap8 +helgrind/tests/tls_threads +helgrind/tests/pth_mempcpy_false_races drd/tests/bar_bad drd/tests/bar_bad_xml +drd/tests/pth_barrier_thr_cr +drd/tests/std_thread2 +drd/tests/thread_name_xml +massif/tests/deep-D +massif/tests/bug469146 +massif/tests/new-cpp +massif/tests/overloaded-new diff --git a/meta/recipes-devtools/valgrind/valgrind/run-ptest b/meta/recipes-devtools/valgrind/valgrind/run-ptest index f37780ef6a..15cf03f9d2 100755 --- a/meta/recipes-devtools/valgrind/valgrind/run-ptest +++ b/meta/recipes-devtools/valgrind/valgrind/run-ptest @@ -7,6 +7,7 @@ # Randy MacLeod <Randy.MacLeod@windriver.com> ############################################################### VALGRIND_LIB=@libdir@/valgrind +VALGRIND_LIBEXECDIR=@libexecdir@/valgrind VALGRIND_BIN=@bindir@/valgrind LOG="${VALGRIND_LIB}/ptest/valgrind_ptest_$(date +%Y%m%d-%H%M%S).log" @@ -31,18 +32,35 @@ if [ "$arch" = "aarch64" ]; then done fi +echo "Run non-deterministic tests using taskset to limit them to a single core." +for i in `cat taskset_nondeterministic_tests`; do + # The remove-for-aarch64 and taskset_nondeterministic_tests may overlap so + # check if a file exist. + if test -f "${i}.vgtest"; then + taskset 0x00000001 perl tests/vg_regtest --valgrind=${VALGRIND_BIN} --valgrind-lib=${VALGRIND_LIBEXECDIR} --yocto-ptest $i 2>&1|tee -a ${LOG} + mv $i.vgtest $i.IGNORE + fi +done + cd ${VALGRIND_LIB}/ptest && ./tests/vg_regtest \ --valgrind=${VALGRIND_BIN} \ - --valgrind-lib=${VALGRIND_LIB} \ + --valgrind-lib=${VALGRIND_LIBEXECDIR} \ --yocto-ptest \ gdbserver_tests ${TOOLS} ${EXP_TOOLS} \ - 2>&1|tee ${LOG} + 2>&1|tee -a ${LOG} cd ${VALGRIND_LIB}/ptest && \ ./tests/post_regtest_checks $(pwd) \ gdbserver_tests ${TOOLS} ${EXP_TOOLS} \ 2>&1|tee -a ${LOG} +echo "Restore non-deterministic tests" +for i in `cat taskset_nondeterministic_tests`; do + if test -f "${i}.vgtest.IGNORE"; then + mv $i.IGNORE $i.vgtest; + fi +done + if [ "$arch" = "aarch64" ]; then echo "Aarch64: Restore valgrind tests that result in defunct process and then out of memory" for i in `cat remove-for-aarch64`; do diff --git a/meta/recipes-devtools/valgrind/valgrind/s390x_vec_op_t.patch b/meta/recipes-devtools/valgrind/valgrind/s390x_vec_op_t.patch index eea671da0a..bde1241dc7 100644 --- a/meta/recipes-devtools/valgrind/valgrind/s390x_vec_op_t.patch +++ b/meta/recipes-devtools/valgrind/valgrind/s390x_vec_op_t.patch @@ -1,3 +1,8 @@ +From 8154d38bac5cdb3675cfdaf562ab9da01988b263 Mon Sep 17 00:00:00 2001 +From: Yi Fan Yu <yifan.yu@windriver.com> +Date: Wed, 17 Mar 2021 12:16:31 -0400 +Subject: [PATCH 19/20] remove s390x_vec_op_t + s390x_vec_op_t is not needed anywhere, only elements of enum are accessed removing it ensures that valgrind can be built with -fno-common option @@ -6,14 +11,25 @@ ld: ../../VEX/libvex-amd64-linux.a(libvex_amd64_linux_a-guest_s390_helpers.o):/u Upstream-Status: Pending Signed-off-by: Khem Raj <raj.khem@gmail.com> + +Signed-off-by: Yi Fan Yu <yifan.yu@windriver.com> +--- + VEX/priv/guest_s390_defs.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/VEX/priv/guest_s390_defs.h b/VEX/priv/guest_s390_defs.h +index 9054290..dab8002 100644 --- a/VEX/priv/guest_s390_defs.h +++ b/VEX/priv/guest_s390_defs.h -@@ -286,7 +286,7 @@ enum { - S390_VEC_OP_VFCHE = 18, - S390_VEC_OP_VFTCI = 19, - S390_VEC_OP_LAST = 20 // supposed to be the last element in enum +@@ -284,7 +284,7 @@ typedef enum { + S390_VEC_OP_VBPERM, + S390_VEC_OP_VMSL, + S390_VEC_OP_LAST // supposed to be the last element in enum -} s390x_vec_op_t; +}; /* Arguments of s390x_dirtyhelper_vec_op(...) which are packed into one ULong variable. +-- +2.29.2 + diff --git a/meta/recipes-devtools/valgrind/valgrind/taskset_nondeterministic_tests b/meta/recipes-devtools/valgrind/valgrind/taskset_nondeterministic_tests new file mode 100644 index 0000000000..e15100ade7 --- /dev/null +++ b/meta/recipes-devtools/valgrind/valgrind/taskset_nondeterministic_tests @@ -0,0 +1,2 @@ +helgrind/tests/hg05_race2 +helgrind/tests/tc09_bad_unlock diff --git a/meta/recipes-devtools/valgrind/valgrind/use-appropriate-march-mcpu-mfpu-for-ARM-test-apps.patch b/meta/recipes-devtools/valgrind/valgrind/use-appropriate-march-mcpu-mfpu-for-ARM-test-apps.patch index adea405213..f15d04b173 100644 --- a/meta/recipes-devtools/valgrind/valgrind/use-appropriate-march-mcpu-mfpu-for-ARM-test-apps.patch +++ b/meta/recipes-devtools/valgrind/valgrind/use-appropriate-march-mcpu-mfpu-for-ARM-test-apps.patch @@ -15,7 +15,7 @@ over-ride that). See similar cases in none/tests/arm/Makefile.am -Upstream-Status: Pending +Upstream-Status: Submitted [https://bugs.kde.org/show_bug.cgi?id=454346] Signed-off-by: Andre McCurdy <armccurdy@gmail.com> --- |