summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/valgrind
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/valgrind')
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/0001-Guard-against-__GLIBC_PREREQ-for-musl-libc.patch36
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/0001-Make-local-functions-static-to-avoid-assembler-error.patch182
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/0001-Remove-tests-that-fail-to-build-on-some-PPC32-config.patch51
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/0001-docs-Disable-manual-validation.patch36
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/0001-drd-Port-to-Fedora-33.patch48
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/0001-drd-musl-fix.patch31
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/0001-fix-opcode-not-supported-on-mips32-linux.patch82
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/0001-gdbserver_tests-Disable-nlcontrolc.vgtest-for-x86-64.patch36
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/0001-helgrind-Intercept-libc-functions.patch54
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/0001-makefiles-Drop-setting-mcpu-to-cortex-a8-on-arm-arch.patch2
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/0001-memcheck-arm64-Define-__THROW-if-not-already-defined.patch32
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/0001-none-tests-fdleak_cmsg.stderr.exp-adjust-tmp-paths.patch2
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/0001-str_tester.c-Limit-rawmemchr-test-to-glibc.patch39
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/0001-valgrind-monitor.py-regular-expressions-should-use-r.patch64
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/0002-Bug-476548-valgrind-3.22.0-fails-on-assertion-when-l.patch147
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/0002-context-APIs-are-not-available-on-musl.patch52
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/0002-memcheck-x86-Define-__THROW-if-not-defined.patch32
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/0003-Add-fchmodat2-syscall-on-linux.patch221
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/0003-tests-seg_override-Replace-__modify_ldt-with-syscall.patch68
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/0004-Bug-478624-Valgrind-incompatibility-with-binutils-2..patch137
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/0004-Fix-out-of-tree-builds.patch185
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/0005-Modify-vg_test-wrapper-to-support-PTEST-formats.patch54
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/0005-tc20_verifywrap.c-Fake-__GLIBC_PREREQ-with-musl.patch30
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/Added-support-for-PPC-instructions-mfatbu-mfatbl.patch8
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/avoid-neon-for-targets-which-don-t-support-it.patch2
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/fixed-perl-path.patch40
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/remove-for-aarch64245
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/remove-for-all27
-rwxr-xr-xmeta/recipes-devtools/valgrind/valgrind/run-ptest32
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/s390x_vec_op_t.patch24
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/taskset_nondeterministic_tests2
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/use-appropriate-march-mcpu-mfpu-for-ARM-test-apps.patch2
-rw-r--r--meta/recipes-devtools/valgrind/valgrind_3.22.0.bb (renamed from meta/recipes-devtools/valgrind/valgrind_3.16.1.bb)157
33 files changed, 842 insertions, 1318 deletions
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 @@
1From 1b5b6f827ac1153a41fc93e78bf34ccdf5720b9b Mon Sep 17 00:00:00 2001
2From: Randy MacLeod <Randy.MacLeod@windriver.com>
3Date: Fri, 19 Oct 2018 10:31:12 -0400
4Subject: [PATCH] Guard against __GLIBC_PREREQ for musl libc
5
6Upstream-Status: Submitted https://bugs.kde.org/show_bug.cgi?id=400162
7
8Signed-off-by: Randy MacLeod <Randy.MacLeod@windriver.com>
9---
10 memcheck/tests/linux/sys-statx.c | 5 +++++
11 1 file changed, 5 insertions(+)
12
13diff --git a/memcheck/tests/linux/sys-statx.c b/memcheck/tests/linux/sys-statx.c
14index fe9f9ba45..473c2cd7f 100644
15--- a/memcheck/tests/linux/sys-statx.c
16+++ b/memcheck/tests/linux/sys-statx.c
17@@ -7,11 +7,16 @@
18 #include <assert.h>
19 #include <string.h>
20 #include <sys/syscall.h>
21+
22+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
23 #if __GLIBC_PREREQ(2,28)
24 /* struct statx provided in sys/stat.h */
25 #else
26 #include <linux/stat.h>
27 #endif
28+#else
29+#include <linux/stat.h>
30+#endif
31 #include <errno.h>
32
33 int check_stat2;
34--
352.17.0
36
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 @@
1From 2155c1b2cf00e744e280c493eb74bf457dfcc3b1 Mon Sep 17 00:00:00 2001
2From: Randy MacLeod <Randy.MacLeod@windriver.com>
3Date: Sun, 21 Oct 2018 15:09:31 -0400
4Subject: [PATCH] Make local functions static to avoid assembler error
5
6Avoid mips32 x-compiler warnings such as:
7
8| ../../../valgrind-3.14.0/helgrind/tests/annotate_hbefore.c:360:6: warning: no previous prototype for 'do_signal' [-Wmissing-prototypes]
9| void do_signal ( UWord* w )
10| ^~~~~~~~~
11
12by making functions and global variables that are file scope be static
13and more importantly also avoid an assembler error:
14
15/tmp/cce22iiw.s: Assembler messages:
16/tmp/cce22iiw.s:446: Error: symbol `exit_0' is already defined
17/tmp/cce22iiw.s:448: Error: symbol `exit' is already defined
18/tmp/cce22iiw.s:915: Error: symbol `exit_0' is already defined
19/tmp/cce22iiw.s:917: Error: symbol `exit' is already defined
20
21Upstream-Status: Submitted https://bugs.kde.org/show_bug.cgi?id=400164
22
23Signed-off-by: Randy MacLeod <Randy.MacLeod@windriver.com>
24---
25 helgrind/tests/annotate_hbefore.c | 34 +++++++++++++++----------------
26 1 file changed, 17 insertions(+), 17 deletions(-)
27
28diff --git a/helgrind/tests/annotate_hbefore.c b/helgrind/tests/annotate_hbefore.c
29index e311714f7..f55514e45 100644
30--- a/helgrind/tests/annotate_hbefore.c
31+++ b/helgrind/tests/annotate_hbefore.c
32@@ -24,7 +24,7 @@ typedef unsigned long int UWord;
33
34 // ppc64
35 /* return 1 if success, 0 if failure */
36-UWord do_acasW ( UWord* addr, UWord expected, UWord nyu )
37+static UWord do_acasW ( UWord* addr, UWord expected, UWord nyu )
38 {
39 UWord old, success;
40
41@@ -57,7 +57,7 @@ UWord do_acasW ( UWord* addr, UWord expected, UWord nyu )
42
43 // ppc32
44 /* return 1 if success, 0 if failure */
45-UWord do_acasW ( UWord* addr, UWord expected, UWord nyu )
46+static UWord do_acasW ( UWord* addr, UWord expected, UWord nyu )
47 {
48 UWord old, success;
49
50@@ -90,7 +90,7 @@ UWord do_acasW ( UWord* addr, UWord expected, UWord nyu )
51
52 // amd64
53 /* return 1 if success, 0 if failure */
54-UWord do_acasW ( UWord* addr, UWord expected, UWord nyu )
55+static UWord do_acasW ( UWord* addr, UWord expected, UWord nyu )
56 {
57 UWord block[4] = { (UWord)addr, expected, nyu, 2 };
58 __asm__ __volatile__(
59@@ -113,7 +113,7 @@ UWord do_acasW ( UWord* addr, UWord expected, UWord nyu )
60
61 // x86
62 /* return 1 if success, 0 if failure */
63-UWord do_acasW ( UWord* addr, UWord expected, UWord nyu )
64+static UWord do_acasW ( UWord* addr, UWord expected, UWord nyu )
65 {
66 UWord block[4] = { (UWord)addr, expected, nyu, 2 };
67 __asm__ __volatile__(
68@@ -138,7 +138,7 @@ UWord do_acasW ( UWord* addr, UWord expected, UWord nyu )
69
70 // arm
71 /* return 1 if success, 0 if failure */
72-UWord do_acasW ( UWord* addr, UWord expected, UWord nyu )
73+static UWord do_acasW ( UWord* addr, UWord expected, UWord nyu )
74 {
75 UWord old, success;
76 UWord block[2] = { (UWord)addr, nyu };
77@@ -171,7 +171,7 @@ UWord do_acasW ( UWord* addr, UWord expected, UWord nyu )
78
79 // arm64
80 /* return 1 if success, 0 if failure */
81-UWord do_acasW ( UWord* addr, UWord expected, UWord nyu )
82+static UWord do_acasW ( UWord* addr, UWord expected, UWord nyu )
83 {
84 UWord old, success;
85 UWord block[2] = { (UWord)addr, nyu };
86@@ -204,7 +204,7 @@ UWord do_acasW ( UWord* addr, UWord expected, UWord nyu )
87
88 // s390x
89 /* return 1 if success, 0 if failure */
90-UWord do_acasW(UWord* addr, UWord expected, UWord nyu )
91+static UWord do_acasW(UWord* addr, UWord expected, UWord nyu )
92 {
93 int cc;
94
95@@ -223,7 +223,7 @@ UWord do_acasW(UWord* addr, UWord expected, UWord nyu )
96
97 // mips32
98 /* return 1 if success, 0 if failure */
99-UWord do_acasW ( UWord* addr, UWord expected, UWord nyu )
100+static UWord do_acasW ( UWord* addr, UWord expected, UWord nyu )
101 {
102 UWord success;
103 UWord block[3] = { (UWord)addr, nyu, expected};
104@@ -256,7 +256,7 @@ UWord do_acasW ( UWord* addr, UWord expected, UWord nyu )
105
106 // mips64
107 /* return 1 if success, 0 if failure */
108-UWord do_acasW ( UWord* addr, UWord expected, UWord nyu )
109+static UWord do_acasW ( UWord* addr, UWord expected, UWord nyu )
110 {
111 UWord success;
112 UWord block[3] = { (UWord)addr, nyu, expected};
113@@ -287,7 +287,7 @@ UWord do_acasW ( UWord* addr, UWord expected, UWord nyu )
114
115 #endif
116
117-void atomic_incW ( UWord* w )
118+static void atomic_incW ( UWord* w )
119 {
120 while (1) {
121 UWord old = *w;
122@@ -301,7 +301,7 @@ void atomic_incW ( UWord* w )
123
124 #define NNN 1000000
125
126-void* thread_fn ( void* arg )
127+static void* thread_fn ( void* arg )
128 {
129 UWord* w = (UWord*)arg;
130 int i;
131@@ -331,10 +331,10 @@ int main ( void )
132
133 #endif
134
135-int shared_var = 0; // is not raced upon
136+static int shared_var = 0; // is not raced upon
137
138
139-void delayXms ( int i )
140+static void delayXms ( int i )
141 {
142 struct timespec ts = { 0, 1 * 1000 * 1000 };
143 // We do the sleep in small pieces to have scheduling
144@@ -348,7 +348,7 @@ void delayXms ( int i )
145 }
146 }
147
148-void do_wait ( UWord* w )
149+static void do_wait ( UWord* w )
150 {
151 UWord w0 = *w;
152 UWord volatile * wV = w;
153@@ -357,7 +357,7 @@ void do_wait ( UWord* w )
154 ANNOTATE_HAPPENS_AFTER(w);
155 }
156
157-void do_signal ( UWord* w )
158+static void do_signal ( UWord* w )
159 {
160 ANNOTATE_HAPPENS_BEFORE(w);
161 atomic_incW(w);
162@@ -365,7 +365,7 @@ void do_signal ( UWord* w )
163
164
165
166-void* thread_fn1 ( void* arg )
167+static void* thread_fn1 ( void* arg )
168 {
169 UWord* w = (UWord*)arg;
170 delayXms(500); // ensure t2 gets to its wait first
171@@ -376,7 +376,7 @@ void* thread_fn1 ( void* arg )
172 return NULL;
173 }
174
175-void* thread_fn2 ( void* arg )
176+static void* thread_fn2 ( void* arg )
177 {
178 UWord* w = (UWord*)arg;
179 do_wait(w); // wait for h-b edge from first thread
180--
1812.17.0
182
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 @@
1From 9762fd23e1f1db66d4b977c694a17d3bca3fe99a Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Fri, 8 Jan 2016 16:36:29 +0200
4Subject: [PATCH] Remove tests that fail to build on some PPC32 configurations
5
6Failures are documented here:
7http://errors.yoctoproject.org/Errors/Search/?items=10&query=862d702fbb99e484631315aa44b9e46f8fc567da&filter=valgrind&type=recipe
8
9Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
10Upstream-Status: Pending
11---
12 memcheck/tests/ppc32/Makefile.am | 2 +-
13 none/tests/ppc32/Makefile.am | 4 ++--
14 2 files changed, 3 insertions(+), 3 deletions(-)
15
16diff --git a/memcheck/tests/ppc32/Makefile.am b/memcheck/tests/ppc32/Makefile.am
17index 26b95a2..8f05743 100644
18--- a/memcheck/tests/ppc32/Makefile.am
19+++ b/memcheck/tests/ppc32/Makefile.am
20@@ -10,7 +10,7 @@ EXTRA_DIST = $(noinst_SCRIPTS) \
21 power_ISA2_07.stderr.exp power_ISA2_07.vgtest
22
23 check_PROGRAMS = \
24- power_ISA2_05 power_ISA2_07
25+ power_ISA2_07
26
27 power_ISA2_05_CFLAGS = $(AM_CFLAGS) $(WERROR) -Winline -Wall -Wshadow -g \
28 -I$(top_srcdir)/include @FLAG_M32@
29diff --git a/none/tests/ppc32/Makefile.am b/none/tests/ppc32/Makefile.am
30index 196239e..0fe3425 100644
31--- a/none/tests/ppc32/Makefile.am
32+++ b/none/tests/ppc32/Makefile.am
33@@ -50,13 +50,13 @@ EXTRA_DIST = \
34
35 check_PROGRAMS = \
36 allexec \
37- lsw jm-insns round \
38+ lsw \
39 test_isa_2_06_part1 test_isa_2_06_part2 test_isa_2_06_part3 \
40 test_dfp1 test_dfp2 test_dfp3 test_dfp4 test_dfp5 \
41 test_isa_2_07_part1 test_isa_2_07_part2 \
42 test_tm test_touch_tm ldst_multiple data-cache-instructions \
43 test_fx test_gx \
44- testVMX twi tw xlc_dbl_u32 power5+_round power6_bcmp \
45+ twi tw xlc_dbl_u32 power6_bcmp \
46 bug129390-ppc32 bug139050-ppc32 \
47 ldstrev mftocrf mcrfs
48
49--
502.6.4
51
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 @@
1From 99fc6fe9b66becac3c94068129e84217330a71a6 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 13 Jan 2022 18:26:02 -0800
4Subject: [PATCH] docs: Disable manual validation
5
6validating manual and manpages, this task involves calling xmllint which
7accesses network and --nonet option also does not disable this,
8therefore disable it.
9
10Fixes
11| error : Resource temporarily unavailable
12| ../callgrind/docs/cl-manual.xml:4: warning: failed to load external entity "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
13| <!ENTITY % vg-entities SYSTEM "../../docs/xml/vg-entities.xml"> %vg-entities; ]
14
15Upstream-Status: Inappropriate [OE-Specific]
16Signed-off-by: Khem Raj <raj.khem@gmail.com>
17---
18 docs/Makefile.am | 2 +-
19 1 file changed, 1 insertion(+), 1 deletion(-)
20
21diff --git a/docs/Makefile.am b/docs/Makefile.am
22index d4250e8..c500306 100644
23--- a/docs/Makefile.am
24+++ b/docs/Makefile.am
25@@ -192,7 +192,7 @@ valid-manpages: $(MANPAGES_XML_FILES)
26 touch $@; \
27 fi
28
29-check-local: valid-manual valid-manpages
30+check-local:
31
32 # The text version of the FAQ.
33 FAQ.txt:
34--
352.34.1
36
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 @@
1From 15330adf7c2471fbaa6a0818db07078d81dbff97 Mon Sep 17 00:00:00 2001
2From: Bart Van Assche <bvanassche@acm.org>
3Date: Sat, 19 Sep 2020 08:08:59 -0700
4Subject: [PATCH] drd: Port to Fedora 33
5
6Apparently on Fedora 33 the POSIX thread functions exist in both libc and
7libpthread. Hence this patch that intercepts the pthread functions in
8libc. See also https://bugs.kde.org/show_bug.cgi?id=426144 .
9
10Signed-off-by: Bart Van Assche <bvanassche@acm.org>
11
12This patch was imported from the valgrind sourceware server
13(https://sourceware.org/git/?p=valgrind.git;a=commit;h=15330adf7c2471fbaa6a0818db07078d81dbff97)
14It was modified to remove the changes to the valgrind NEWS file,
15as these are difficult to maintain and don't impact the valgrind
16code itself.
17
18Upstream-Status: Backport
19
20Signed-off-by: Stacy Gaikovaia <stacy.gaikovaia@windriver.com>
21---
22 drd/drd_pthread_intercepts.c | 9 +++++++++
23 1 file changed, 10 insertions(+)
24
25diff --git a/drd/drd_pthread_intercepts.c b/drd/drd_pthread_intercepts.c
26index 58c45aaec..c2882e5ab 100644
27--- a/drd/drd_pthread_intercepts.c
28+++ b/drd/drd_pthread_intercepts.c
29@@ -174,7 +174,16 @@ static int never_true;
30 ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBC_SONAME,zf) argl_decl \
31 { return implf argl; }
32 #else
33+/*
34+ * On Linux, intercept both the libc and the libpthread functions. At
35+ * least glibc 2.32.9000 (Fedora 34) has an implementation of all pthread
36+ * functions in both libc and libpthread. Older glibc versions only have an
37+ * implementation of the pthread functions in libpthread.
38+ */
39 #define PTH_FUNC(ret_ty, zf, implf, argl_decl, argl) \
40+ ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBC_SONAME,zf) argl_decl; \
41+ ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBC_SONAME,zf) argl_decl \
42+ { return implf argl; } \
43 ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBPTHREAD_SONAME,zf) argl_decl; \
44 ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBPTHREAD_SONAME,zf) argl_decl \
45 { return implf argl; }
46--
472.25.1
48
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 @@
1The changes in 0001-drd-Port-to-Fedora-33.patch break builds on musl. These
2need a __GLIBC__ guard to ensure musl builds continue to work.
3
4Upstream-Status: Pending
5Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6
7Index: valgrind-3.16.1/drd/drd_pthread_intercepts.c
8===================================================================
9--- valgrind-3.16.1.orig/drd/drd_pthread_intercepts.c
10+++ valgrind-3.16.1/drd/drd_pthread_intercepts.c
11@@ -180,6 +180,7 @@ static int never_true;
12 * functions in both libc and libpthread. Older glibc versions only have an
13 * implementation of the pthread functions in libpthread.
14 */
15+#ifdef __GLIBC__
16 #define PTH_FUNC(ret_ty, zf, implf, argl_decl, argl) \
17 ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBC_SONAME,zf) argl_decl; \
18 ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBC_SONAME,zf) argl_decl \
19@@ -187,6 +188,12 @@ static int never_true;
20 ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBPTHREAD_SONAME,zf) argl_decl; \
21 ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBPTHREAD_SONAME,zf) argl_decl \
22 { return implf argl; }
23+#else
24+#define PTH_FUNC(ret_ty, zf, implf, argl_decl, argl) \
25+ ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBPTHREAD_SONAME,zf) argl_decl; \
26+ ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBPTHREAD_SONAME,zf) argl_decl \
27+ { return implf argl; }
28+#endif
29 #endif
30
31 /**
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 @@
1From fb5362f205b37c5060fcd764a7ed393abe4f2f3d Mon Sep 17 00:00:00 2001
2From: Hongxu Jia <hongxu.jia@windriver.com>
3Date: Fri, 27 Jul 2018 17:39:37 +0800
4Subject: [PATCH 1/2] fix opcode not supported on mips32-linux
5
6While build tests(`make check') on mips32-linux, there are
7serial failures such as:
8[snip]
9| mips-wrsmllib32-linux-gcc -meb -mabi=32 -mhard-float -c
10-o atomic_incs-atomic_incs.o `test -f 'atomic_incs.c' || echo
11'../../../valgrind-3.13.0/memcheck/tests/'`atomic_incs.c
12| /tmp/ccqrmINN.s: Assembler messages:
13| /tmp/ccqrmINN.s:247: Error: opcode not supported on this
14processor: mips1 (mips1) `ll $t3,0($t1)'
15| /tmp/ccqrmINN.s:249: Error: opcode not supported on this
16processor: mips1 (mips1) `sc $t3,0($t1)'
17[snip]
18
19Since the following commit applied, it defines CLFAGS for mips32,
20but missed to pass them to tests which caused the above failure
21...
223e344c57f Merge in a port for mips32-linux
23...
24
25Upstream-Status: Submitted [https://bugs.kde.org/show_bug.cgi?id=396905]
26Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
27---
28 helgrind/tests/Makefile.am | 5 +++++
29 memcheck/tests/Makefile.am | 5 +++++
30 none/tests/mips32/Makefile.am | 4 ++++
31 3 files changed, 14 insertions(+)
32
33diff --git a/helgrind/tests/Makefile.am b/helgrind/tests/Makefile.am
34index ad1af191a..6209d35a7 100644
35--- a/helgrind/tests/Makefile.am
36+++ b/helgrind/tests/Makefile.am
37@@ -214,6 +214,11 @@ check_PROGRAMS += annotate_rwlock
38 endif
39
40 AM_CFLAGS += $(AM_FLAG_M3264_PRI)
41+
42+if VGCONF_PLATFORMS_INCLUDE_MIPS32_LINUX
43+AM_CFLAGS += $(AM_CFLAGS_MIPS32_LINUX)
44+endif
45+
46 AM_CXXFLAGS += $(AM_FLAG_M3264_PRI)
47
48 LDADD = -lpthread
49diff --git a/memcheck/tests/Makefile.am b/memcheck/tests/Makefile.am
50index 84e49405f..aff861a32 100644
51--- a/memcheck/tests/Makefile.am
52+++ b/memcheck/tests/Makefile.am
53@@ -443,6 +443,11 @@ check_PROGRAMS += reach_thread_register
54 endif
55
56 AM_CFLAGS += $(AM_FLAG_M3264_PRI)
57+
58+if VGCONF_PLATFORMS_INCLUDE_MIPS32_LINUX
59+AM_CFLAGS += $(AM_CFLAGS_MIPS32_LINUX)
60+endif
61+
62 AM_CXXFLAGS += $(AM_FLAG_M3264_PRI)
63
64 if VGCONF_PLATFORMS_INCLUDE_ARM_LINUX
65diff --git a/none/tests/mips32/Makefile.am b/none/tests/mips32/Makefile.am
66index d11591d45..602cd26f6 100644
67--- a/none/tests/mips32/Makefile.am
68+++ b/none/tests/mips32/Makefile.am
69@@ -99,6 +99,10 @@ check_PROGRAMS = \
70 round_fpu64 \
71 fpu_branches
72
73+if VGCONF_PLATFORMS_INCLUDE_MIPS32_LINUX
74+AM_CFLAGS += $(AM_CFLAGS_MIPS32_LINUX)
75+endif
76+
77 AM_CFLAGS += @FLAG_M32@
78 AM_CXXFLAGS += @FLAG_M32@
79 AM_CCASFLAGS += @FLAG_M32@
80--
812.17.1
82
diff --git a/meta/recipes-devtools/valgrind/valgrind/0001-gdbserver_tests-Disable-nlcontrolc.vgtest-for-x86-64.patch b/meta/recipes-devtools/valgrind/valgrind/0001-gdbserver_tests-Disable-nlcontrolc.vgtest-for-x86-64.patch
deleted file mode 100644
index 0bd8273cd8..0000000000
--- a/meta/recipes-devtools/valgrind/valgrind/0001-gdbserver_tests-Disable-nlcontrolc.vgtest-for-x86-64.patch
+++ /dev/null
@@ -1,36 +0,0 @@
1From d8c19e0bb9ca2fd48f223e1fdeffcafeb0aa1745 Mon Sep 17 00:00:00 2001
2From: Yi Fan Yu <yifan.yu@windriver.com>
3Date: Wed, 17 Feb 2021 14:53:44 -0500
4Subject: [PATCH] gdbserver_tests: Disable nlcontrolc.vgtest for x86-64
5
6Test hangs after glibc 2.33 uprev
7
8Using gdb to modify the timeout argument no longer
9affects how long `select` wait.
10
11https://bugs.kde.org/show_bug.cgi?id=432870
12Upstream-Status: Pending
13Waiting for upstream to take action.
14
15Signed-off-by: Yi Fan Yu <yifan.yu@windriver.com>
16---
17 gdbserver_tests/nlcontrolc.vgtest | 3 ++-
18 1 file changed, 2 insertions(+), 1 deletion(-)
19
20diff --git a/gdbserver_tests/nlcontrolc.vgtest b/gdbserver_tests/nlcontrolc.vgtest
21index bb5308403..96d2b52bb 100644
22--- a/gdbserver_tests/nlcontrolc.vgtest
23+++ b/gdbserver_tests/nlcontrolc.vgtest
24@@ -13,7 +13,8 @@ args: 1000000000 1000000000 1000000000 BSBSBSBS 1
25 vgopts: --tool=none --vgdb=yes --vgdb-error=0 --vgdb-prefix=./vgdb-prefix-nlcontrolc
26 stderr_filter: filter_stderr
27 # Bug 338633 nlcontrol hangs on arm64 currently.
28-prereq: test -e gdb -a -f vgdb.invoker && ! ../tests/arch_test arm64 && ! ../tests/os_test solaris
29+# Bug 432870 nlcontrolc hangs on x86-64 starting with glibc 2.33
30+prereq: test -e gdb -a -f vgdb.invoker && ! ../tests/arch_test arm64 && ! ../tests/os_test solaris && ! ../tests/arch_test amd64
31 progB: gdb
32 argsB: --quiet -l 60 --nx ./sleepers
33 stdinB: nlcontrolc.stdinB.gdb
34--
352.29.2
36
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 @@
1From cdec010444df5a4328e90d07a2024fdeefcc74b5 Mon Sep 17 00:00:00 2001
2From: Paul Floyd <paulf@free.fr>
3Date: Wed, 18 Nov 2020 12:49:20 -0400
4Subject: [PATCH] helgrind: Intercept libc functions
5
6PTH_FUNC definition needs to be modified in order to
7intercept posix thread functions in both libc and
8libpthread. In order to handle this in helgrind, weak alias
9the pthread functions in glibc.
10
11Upstream-Status: Submitted
12
13Signed-off-by: Paul Floyd <paulf@free.fr>
14Signed-off-by: Stacy Gaikovaia <stacy.gaikovaia@windriver.com>
15---
16 helgrind/hg_intercepts.c | 12 ++++++++++++
17 1 file changed, 12 insertions(+)
18
19diff --git a/helgrind/hg_intercepts.c b/helgrind/hg_intercepts.c
20index a10c3a4a3..316140ca6 100644
21--- a/helgrind/hg_intercepts.c
22+++ b/helgrind/hg_intercepts.c
23@@ -77,6 +77,11 @@
24 /*--- ---*/
25 /*----------------------------------------------------------------*/
26
27+#define hg_expand(tok) #tok
28+#define hg_str(tok) hg_expand(tok)
29+# define hg_weak_alias(name, aliasname) \
30+ extern __typeof (name) aliasname __attribute__ ((weak, alias(hg_str(name))))
31+
32 #if defined(VGO_solaris)
33 /* On Solaris, libpthread is just a filter library on top of libc.
34 * Threading and synchronization functions in runtime linker are not
35@@ -91,9 +96,16 @@
36 #define CREQ_PTHREAD_T Word
37 #define SEM_ERROR ret
38 #else
39+#ifdef MUSL_LIBC
40+#define PTH_FUNC(ret_ty, f, args...) \
41+ ret_ty I_WRAP_SONAME_FNNAME_ZZ(VG_Z_LIBPTHREAD_SONAME,f)(args); \
42+ ret_ty I_WRAP_SONAME_FNNAME_ZZ(VG_Z_LIBPTHREAD_SONAME,f)(args)
43+#else
44 #define PTH_FUNC(ret_ty, f, args...) \
45 ret_ty I_WRAP_SONAME_FNNAME_ZZ(VG_Z_LIBPTHREAD_SONAME,f)(args); \
46+ hg_weak_alias(I_WRAP_SONAME_FNNAME_ZZ(VG_Z_LIBPTHREAD_SONAME,f), I_WRAP_SONAME_FNNAME_ZZ(VG_Z_LIBC_SONAME,f)); \
47 ret_ty I_WRAP_SONAME_FNNAME_ZZ(VG_Z_LIBPTHREAD_SONAME,f)(args)
48+#endif
49 #define CREQ_PTHREAD_T pthread_t
50 #define SEM_ERROR errno
51 #endif /* VGO_solaris */
52--
532.17.1
54
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.
10Fixes 10Fixes
11| cc1: warning: switch -mcpu=cortex-a8 conflicts with -march=armv7ve switch 11| cc1: warning: switch -mcpu=cortex-a8 conflicts with -march=armv7ve switch
12 12
13Upstream-Status: Pending 13Upstream-Status: Submitted [https://bugs.kde.org/show_bug.cgi?id=454346]
14 14
15Signed-off-by: Khem Raj <raj.khem@gmail.com> 15Signed-off-by: Khem Raj <raj.khem@gmail.com>
16--- 16---
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 @@
1From 3409dc35c15bb14c8a525239806322648e079ab1 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 5 Jul 2017 17:12:43 -0700
4Subject: [PATCH 1/3] memcheck/arm64: Define __THROW if not already defined
5
6Helps compiling with musl where __THROW is not available
7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9---
10Upstream-Status: Submitted
11
12 memcheck/tests/arm64-linux/scalar.h | 4 ++++
13 1 file changed, 4 insertions(+)
14
15diff --git a/memcheck/tests/arm64-linux/scalar.h b/memcheck/tests/arm64-linux/scalar.h
16index 9008816..8ef050f 100644
17--- a/memcheck/tests/arm64-linux/scalar.h
18+++ b/memcheck/tests/arm64-linux/scalar.h
19@@ -12,6 +12,10 @@
20 #include <sys/types.h>
21 #include <sys/mman.h>
22
23+#ifndef __THROW
24+#define __THROW
25+#endif
26+
27 // Since we use vki_unistd.h, we can't include <unistd.h>. So we have to
28 // declare this ourselves.
29 extern long int syscall (long int __sysno, ...) __THROW;
30--
312.13.2
32
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
19@@ -25,10 +25,10 @@ Open file descriptor ...: /dev/null 19@@ -25,10 +25,10 @@ Open file descriptor ...: /dev/null
20 20
21 21
22 FILE DESCRIPTORS: 6 open at exit. 22 FILE DESCRIPTORS: 6 open (3 std) at exit.
23-Open file descriptor ...: /tmp/data2 23-Open file descriptor ...: /tmp/data2
24+Open file descriptor ...: ... 24+Open file descriptor ...: ...
25 ... 25 ...
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 @@
1From de692e359801a1f0488c76267e4f904dd2efe754 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 10 Jun 2017 00:39:07 -0700
4Subject: [PATCH] str_tester.c: Limit rawmemchr() test to glibc
5
6rawmemchr() is a GNU extention therefore mark it so
7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9---
10Upstream-Status: Pending
11
12 memcheck/tests/str_tester.c | 4 ++--
13 1 file changed, 2 insertions(+), 2 deletions(-)
14
15diff --git a/memcheck/tests/str_tester.c b/memcheck/tests/str_tester.c
16index 9f7790a..47e4b4a 100644
17--- a/memcheck/tests/str_tester.c
18+++ b/memcheck/tests/str_tester.c
19@@ -504,7 +504,7 @@ test_strchrnul (void)
20 #endif
21
22 // DDD: better done by testing for the function.
23-#if !defined(__APPLE__) && !defined(__sun)
24+#if !defined(__APPLE__) && !defined(__sun) && defined(__GLIBC__)
25 static void
26 test_rawmemchr (void)
27 {
28@@ -1442,7 +1442,7 @@ main (void)
29 test_strchrnul ();
30 # endif
31
32-# if !defined(__APPLE__) && !defined(__sun)
33+# if !defined(__APPLE__) && !defined(__sun) && defined(__GLIBC__)
34 /* rawmemchr. */
35 test_rawmemchr ();
36 # endif
37--
382.13.1
39
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 @@
1From 027b649fdb831868e71be01cafdacc49a5f419ab Mon Sep 17 00:00:00 2001
2From: Mark Wielaard <mark@klomp.org>
3Date: Fri, 17 Nov 2023 14:01:21 +0100
4Subject: [PATCH 1/4] valgrind-monitor.py regular expressions should use raw
5 strings
6
7With python 3.12 gdb will produce the following SyntaxWarning when
8loading valgrind-monitor-def.py:
9
10 /usr/share/gdb/auto-load/valgrind-monitor-def.py:214:
11 SyntaxWarning: invalid escape sequence '\['
12 if re.fullmatch("^0x[0123456789ABCDEFabcdef]+\[[^\[\]]+\]$", arg_str):
13
14In a future python version this will become an SyntaxError.
15
16Use a raw strings for the regular expression.
17
18https://bugs.kde.org/show_bug.cgi?id=476708
19(cherry picked from commit 0fbfbe05028ad18efda786a256a2738d2c231ed4)
20
21Upstream-Status: Backport [https://sourceware.org/git/?p=valgrind.git;a=commit;h=027b649fdb831868e71be01cafdacc49a5f419ab]
22Signed-off-by: Khem Raj <raj.khem@gmail.com>
23---
24 NEWS | 13 +++++++++++++
25 coregrind/m_gdbserver/valgrind-monitor-def.py | 2 +-
26 2 files changed, 14 insertions(+), 1 deletion(-)
27
28diff --git a/NEWS b/NEWS
29index f11da4be8..ee5b4ff11 100644
30--- a/NEWS
31+++ b/NEWS
32@@ -1,3 +1,16 @@
33+Branch 3.22
34+~~~~~~~~~~~
35+
36+* ==================== FIXED BUGS ====================
37+
38+The following bugs have been fixed or resolved on this branch.
39+
40+476708 valgrind-monitor.py regular expressions should use raw strings
41+
42+To see details of a given bug, visit
43+ https://bugs.kde.org/show_bug.cgi?id=XXXXXX
44+where XXXXXX is the bug number as listed above.
45+
46 Release 3.22.0 (31 Oct 2023)
47 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
48
49diff --git a/coregrind/m_gdbserver/valgrind-monitor-def.py b/coregrind/m_gdbserver/valgrind-monitor-def.py
50index b4e7b992d..d74b1590c 100644
51--- a/coregrind/m_gdbserver/valgrind-monitor-def.py
52+++ b/coregrind/m_gdbserver/valgrind-monitor-def.py
53@@ -211,7 +211,7 @@ class Valgrind_ADDR_LEN_opt(Valgrind_Command):
54 For compatibility reason with the Valgrind gdbserver monitor command,
55 we detect and accept usages such as 0x1234ABCD[10]."""
56 def invoke(self, arg_str : str, from_tty : bool) -> None:
57- if re.fullmatch("^0x[0123456789ABCDEFabcdef]+\[[^\[\]]+\]$", arg_str):
58+ if re.fullmatch(r"^0x[0123456789ABCDEFabcdef]+\[[^\[\]]+\]$", arg_str):
59 arg_str = arg_str.replace("[", " ")
60 arg_str = arg_str.replace("]", " ")
61 eval_execute_2(self, arg_str,
62--
632.44.0
64
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 @@
1From 1d00e5ce0fb069911c4b525ec38289fb5d9021b0 Mon Sep 17 00:00:00 2001
2From: Paul Floyd <pjfloyd@wanadoo.fr>
3Date: Sat, 18 Nov 2023 08:49:34 +0100
4Subject: [PATCH 2/4] Bug 476548 - valgrind 3.22.0 fails on assertion when
5 loading debuginfo file produced by mold
6
7(cherry picked from commit 9ea4ae66707a4dcc6f4328e11911652e4418c585)
8
9Upstream-Status: Backport [https://sourceware.org/git/?p=valgrind.git;a=commit;h=1d00e5ce0fb069911c4b525ec38289fb5d9021b0]
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
12 NEWS | 2 ++
13 coregrind/m_debuginfo/image.c | 14 +++++++++
14 coregrind/m_debuginfo/priv_image.h | 4 +++
15 coregrind/m_debuginfo/readelf.c | 49 ++++++++++++++++++++++++++++--
16 4 files changed, 66 insertions(+), 3 deletions(-)
17
18diff --git a/NEWS b/NEWS
19index ee5b4ff11..6cd13429a 100644
20--- a/NEWS
21+++ b/NEWS
22@@ -5,6 +5,8 @@ Branch 3.22
23
24 The following bugs have been fixed or resolved on this branch.
25
26+476548 valgrind 3.22.0 fails on assertion when loading debuginfo
27+ file produced by mold
28 476708 valgrind-monitor.py regular expressions should use raw strings
29
30 To see details of a given bug, visit
31diff --git a/coregrind/m_debuginfo/image.c b/coregrind/m_debuginfo/image.c
32index 02e509071..445f95555 100644
33--- a/coregrind/m_debuginfo/image.c
34+++ b/coregrind/m_debuginfo/image.c
35@@ -1221,6 +1221,20 @@ Int ML_(img_strcmp_c)(DiImage* img, DiOffT off1, const HChar* str2)
36 }
37 }
38
39+Int ML_(img_strcmp_n)(DiImage* img, DiOffT off1, const HChar* str2, Word n)
40+{
41+ ensure_valid(img, off1, 1, "ML_(img_strcmp_c)");
42+ while (n) {
43+ UChar c1 = get(img, off1);
44+ UChar c2 = *(const UChar*)str2;
45+ if (c1 < c2) return -1;
46+ if (c1 > c2) return 1;
47+ if (c1 == 0) return 0;
48+ off1++; str2++; --n;
49+ }
50+ return 0;
51+}
52+
53 UChar ML_(img_get_UChar)(DiImage* img, DiOffT offset)
54 {
55 ensure_valid(img, offset, 1, "ML_(img_get_UChar)");
56diff --git a/coregrind/m_debuginfo/priv_image.h b/coregrind/m_debuginfo/priv_image.h
57index a49846f14..c91e49f01 100644
58--- a/coregrind/m_debuginfo/priv_image.h
59+++ b/coregrind/m_debuginfo/priv_image.h
60@@ -115,6 +115,10 @@ Int ML_(img_strcmp)(DiImage* img, DiOffT off1, DiOffT off2);
61 cast to HChar before comparison. */
62 Int ML_(img_strcmp_c)(DiImage* img, DiOffT off1, const HChar* str2);
63
64+/* Do strncmp of a C string in the image vs a normal one. Chars are
65+ cast to HChar before comparison. */
66+Int ML_(img_strcmp_n)(DiImage* img, DiOffT off1, const HChar* str2, Word n);
67+
68 /* Do strlen of a C string in the image. */
69 SizeT ML_(img_strlen)(DiImage* img, DiOffT off);
70
71diff --git a/coregrind/m_debuginfo/readelf.c b/coregrind/m_debuginfo/readelf.c
72index fb64ed976..46f8c8343 100644
73--- a/coregrind/m_debuginfo/readelf.c
74+++ b/coregrind/m_debuginfo/readelf.c
75@@ -2501,8 +2501,7 @@ Bool ML_(read_elf_object) ( struct _DebugInfo* di )
76 di->rodata_avma += inrw1->bias;
77 di->rodata_bias = inrw1->bias;
78 di->rodata_debug_bias = inrw1->bias;
79- }
80- else {
81+ } else {
82 BAD(".rodata"); /* should not happen? */
83 }
84 di->rodata_present = True;
85@@ -2977,6 +2976,46 @@ Bool ML_(read_elf_object) ( struct _DebugInfo* di )
86 return retval;
87 }
88
89+static void find_rodata(Word i, Word shnum, DiImage* dimg, struct _DebugInfo* di, DiOffT shdr_dioff,
90+ UWord shdr_dent_szB, DiOffT shdr_strtab_dioff, PtrdiffT rw_dbias)
91+{
92+ ElfXX_Shdr a_shdr;
93+ ElfXX_Shdr a_extra_shdr;
94+ ML_(img_get)(&a_shdr, dimg,
95+ INDEX_BIS(shdr_dioff, i, shdr_dent_szB),
96+ sizeof(a_shdr));
97+ if (di->rodata_present &&
98+ 0 == ML_(img_strcmp_c)(dimg, shdr_strtab_dioff
99+ + a_shdr.sh_name, ".rodata")) {
100+ Word sh_size = a_shdr.sh_size;
101+ Word j;
102+ Word next_addr = a_shdr.sh_addr + a_shdr.sh_size;
103+ for (j = i + 1; j < shnum; ++j) {
104+ ML_(img_get)(&a_extra_shdr, dimg,
105+ INDEX_BIS(shdr_dioff, j, shdr_dent_szB),
106+ sizeof(a_shdr));
107+ if (0 == ML_(img_strcmp_n)(dimg, shdr_strtab_dioff
108+ + a_extra_shdr.sh_name, ".rodata", 7)) {
109+ if (a_extra_shdr.sh_addr ==
110+ VG_ROUNDUP(next_addr, a_extra_shdr.sh_addralign)) {
111+ sh_size = VG_ROUNDUP(sh_size, a_extra_shdr.sh_addralign) + a_extra_shdr.sh_size;
112+ }
113+ next_addr = a_extra_shdr.sh_addr + a_extra_shdr.sh_size;
114+ } else {
115+ break;
116+ }
117+ }
118+ vg_assert(di->rodata_size == sh_size);
119+ vg_assert(di->rodata_avma + a_shdr.sh_addr + rw_dbias);
120+ di->rodata_debug_svma = a_shdr.sh_addr;
121+ di->rodata_debug_bias = di->rodata_bias +
122+ di->rodata_svma - di->rodata_debug_svma;
123+ TRACE_SYMTAB("acquiring .rodata debug svma = %#lx .. %#lx\n",
124+ di->rodata_debug_svma,
125+ di->rodata_debug_svma + di->rodata_size - 1);
126+ TRACE_SYMTAB("acquiring .rodata debug bias = %#lx\n", (UWord)di->rodata_debug_bias);
127+ }
128+}
129 Bool ML_(read_elf_debug) ( struct _DebugInfo* di )
130 {
131 Word i, j;
132@@ -3391,7 +3430,11 @@ Bool ML_(read_elf_debug) ( struct _DebugInfo* di )
133 FIND(text, rx)
134 FIND(data, rw)
135 FIND(sdata, rw)
136- FIND(rodata, rw)
137+ // https://bugs.kde.org/show_bug.cgi?id=476548
138+ // special handling for rodata as adjacent
139+ // rodata sections may have been merged in ML_(read_elf_object)
140+ //FIND(rodata, rw)
141+ find_rodata(i, ehdr_dimg.e_shnum, dimg, di, shdr_dioff, shdr_dent_szB, shdr_strtab_dioff, rw_dbias);
142 FIND(bss, rw)
143 FIND(sbss, rw)
144
145--
1462.44.0
147
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 @@
1From bd4e926e7e14747b3cd4d7b2a1bd5410b22f3ea2 Mon Sep 17 00:00:00 2001
2From: Randy MacLeod <Randy.MacLeod@windriver.com>
3Date: Tue, 16 Oct 2018 21:27:46 -0400
4Subject: [PATCH] context APIs are not available on musl
5
6Upstream-Status: Pending
7
8Updated patch for valgrind-3.14
9
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11Signed-off-by: Randy MacLeod <Randy.MacLeod@windriver.com>
12---
13 memcheck/tests/linux/stack_changes.c | 7 ++++++-
14 1 file changed, 6 insertions(+), 1 deletion(-)
15
16diff --git a/memcheck/tests/linux/stack_changes.c b/memcheck/tests/linux/stack_changes.c
17index 7f97b90a5..a26cb4ae6 100644
18--- a/memcheck/tests/linux/stack_changes.c
19+++ b/memcheck/tests/linux/stack_changes.c
20@@ -10,6 +10,7 @@
21 // This test is checking the libc context calls (setcontext, etc.) and
22 // checks that Valgrind notices their stack changes properly.
23
24+#ifdef __GLIBC__
25 typedef ucontext_t mycontext;
26
27 mycontext ctx1, ctx2, oldc;
28@@ -51,9 +52,11 @@ int init_context(mycontext *uc)
29
30 return ret;
31 }
32+#endif
33
34 int main(int argc, char **argv)
35 {
36+#ifdef __GLIBC__
37 int c1 = init_context(&ctx1);
38 int c2 = init_context(&ctx2);
39
40@@ -66,6 +69,8 @@ int main(int argc, char **argv)
41 //free(ctx1.uc_stack.ss_sp);
42 VALGRIND_STACK_DEREGISTER(c2);
43 //free(ctx2.uc_stack.ss_sp);
44-
45+#else
46+ printf("libc context call APIs e.g. getcontext() are deprecated by posix\n");
47+#endif
48 return 0;
49 }
50--
512.17.0
52
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 @@
1From 67d199dbdcbb3feff5f8928f87725fc64c0307d7 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 5 Jul 2017 17:36:42 -0700
4Subject: [PATCH 2/3] memcheck/x86: Define __THROW if not defined
5
6musl does not have __THROW, therefore make it null
7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9---
10Upstream-Status: Submitted
11
12 memcheck/tests/x86-linux/scalar.h | 4 ++++
13 1 file changed, 4 insertions(+)
14
15diff --git a/memcheck/tests/x86-linux/scalar.h b/memcheck/tests/x86-linux/scalar.h
16index ef28b03..52f742e 100644
17--- a/memcheck/tests/x86-linux/scalar.h
18+++ b/memcheck/tests/x86-linux/scalar.h
19@@ -11,6 +11,10 @@
20 #include <sys/types.h>
21 #include <sys/mman.h>
22
23+#ifndef __THROW
24+#define __THROW
25+#endif
26+
27 // Since we use vki_unistd.h, we can't include <unistd.h>. So we have to
28 // declare this ourselves.
29 extern long int syscall (long int __sysno, ...) __THROW;
30--
312.13.2
32
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 @@
1From a43e62dddcf51ec6578a90c5988a41e856b44b05 Mon Sep 17 00:00:00 2001
2From: Mark Wielaard <mark@klomp.org>
3Date: Sat, 18 Nov 2023 21:17:02 +0100
4Subject: [PATCH 3/4] Add fchmodat2 syscall on linux
5
6fchmodat2 is a new syscall on linux 6.6. It is a variant of fchmodat
7that takes an extra flags argument.
8
9https://bugs.kde.org/show_bug.cgi?id=477198
10
11(cherry picked from commit 372d09fd9a8d76847c81092ebff71c80fd6c145d)
12
13Upstream-Status: Backport [https://sourceware.org/git/?p=valgrind.git;a=commit;h=a43e62dddcf51ec6578a90c5988a41e856b44b05]
14Signed-off-by: Khem Raj <raj.khem@gmail.com>
15---
16 NEWS | 1 +
17 coregrind/m_syswrap/priv_syswrap-linux.h | 3 +++
18 coregrind/m_syswrap/syswrap-amd64-linux.c | 2 ++
19 coregrind/m_syswrap/syswrap-arm-linux.c | 2 ++
20 coregrind/m_syswrap/syswrap-arm64-linux.c | 2 ++
21 coregrind/m_syswrap/syswrap-linux.c | 11 +++++++++++
22 coregrind/m_syswrap/syswrap-mips32-linux.c | 2 ++
23 coregrind/m_syswrap/syswrap-mips64-linux.c | 1 +
24 coregrind/m_syswrap/syswrap-nanomips-linux.c | 1 +
25 coregrind/m_syswrap/syswrap-ppc32-linux.c | 2 ++
26 coregrind/m_syswrap/syswrap-ppc64-linux.c | 2 ++
27 coregrind/m_syswrap/syswrap-s390x-linux.c | 2 ++
28 coregrind/m_syswrap/syswrap-x86-linux.c | 2 ++
29 include/vki/vki-scnums-shared-linux.h | 2 ++
30 14 files changed, 35 insertions(+)
31
32diff --git a/NEWS b/NEWS
33index 6cd13429a..da0f8c1aa 100644
34--- a/NEWS
35+++ b/NEWS
36@@ -8,6 +8,7 @@ The following bugs have been fixed or resolved on this branch.
37 476548 valgrind 3.22.0 fails on assertion when loading debuginfo
38 file produced by mold
39 476708 valgrind-monitor.py regular expressions should use raw strings
40+477198 Add fchmodat2 syscall on linux
41
42 To see details of a given bug, visit
43 https://bugs.kde.org/show_bug.cgi?id=XXXXXX
44diff --git a/coregrind/m_syswrap/priv_syswrap-linux.h b/coregrind/m_syswrap/priv_syswrap-linux.h
45index 7c9decf5a..798c456c9 100644
46--- a/coregrind/m_syswrap/priv_syswrap-linux.h
47+++ b/coregrind/m_syswrap/priv_syswrap-linux.h
48@@ -331,6 +331,9 @@ DECL_TEMPLATE(linux, sys_openat2);
49 // Linux-specific (new in Linux 5.14)
50 DECL_TEMPLATE(linux, sys_memfd_secret);
51
52+// Since Linux 6.6
53+DECL_TEMPLATE(linux, sys_fchmodat2);
54+
55 /* ---------------------------------------------------------------------
56 Wrappers for sockets and ipc-ery. These are split into standalone
57 procedures because x86-linux hides them inside multiplexors
58diff --git a/coregrind/m_syswrap/syswrap-amd64-linux.c b/coregrind/m_syswrap/syswrap-amd64-linux.c
59index 008600798..fe17d118b 100644
60--- a/coregrind/m_syswrap/syswrap-amd64-linux.c
61+++ b/coregrind/m_syswrap/syswrap-amd64-linux.c
62@@ -886,6 +886,8 @@ static SyscallTableEntry syscall_table[] = {
63 LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), // 441
64
65 LINXY(__NR_memfd_secret, sys_memfd_secret), // 447
66+
67+ LINX_(__NR_fchmodat2, sys_fchmodat2), // 452
68 };
69
70 SyscallTableEntry* ML_(get_linux_syscall_entry) ( UInt sysno )
71diff --git a/coregrind/m_syswrap/syswrap-arm-linux.c b/coregrind/m_syswrap/syswrap-arm-linux.c
72index 9a7a1e0d2..811931d3b 100644
73--- a/coregrind/m_syswrap/syswrap-arm-linux.c
74+++ b/coregrind/m_syswrap/syswrap-arm-linux.c
75@@ -1059,6 +1059,8 @@ static SyscallTableEntry syscall_main_table[] = {
76 LINX_(__NR_faccessat2, sys_faccessat2), // 439
77
78 LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), // 441
79+
80+ LINX_(__NR_fchmodat2, sys_fchmodat2), // 452
81 };
82
83
84diff --git a/coregrind/m_syswrap/syswrap-arm64-linux.c b/coregrind/m_syswrap/syswrap-arm64-linux.c
85index 6af7bab83..3307bc2ca 100644
86--- a/coregrind/m_syswrap/syswrap-arm64-linux.c
87+++ b/coregrind/m_syswrap/syswrap-arm64-linux.c
88@@ -840,6 +840,8 @@ static SyscallTableEntry syscall_main_table[] = {
89 LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), // 441
90
91 LINXY(__NR_memfd_secret, sys_memfd_secret), // 447
92+
93+ LINX_(__NR_fchmodat2, sys_fchmodat2), // 452
94 };
95
96
97diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c
98index d571fc327..efa47f2e6 100644
99--- a/coregrind/m_syswrap/syswrap-linux.c
100+++ b/coregrind/m_syswrap/syswrap-linux.c
101@@ -6059,6 +6059,17 @@ PRE(sys_fchmodat)
102 PRE_MEM_RASCIIZ( "fchmodat(path)", ARG2 );
103 }
104
105+PRE(sys_fchmodat2)
106+{
107+ PRINT("sys_fchmodat2 ( %ld, %#" FMT_REGWORD "x(%s), %" FMT_REGWORD "u, %"
108+ FMT_REGWORD "u )",
109+ SARG1, ARG2, (HChar*)(Addr)ARG2, ARG3, ARG4);
110+ PRE_REG_READ4(long, "fchmodat2",
111+ int, dfd, const char *, path, vki_mode_t, mode,
112+ unsigned int, flags);
113+ PRE_MEM_RASCIIZ( "fchmodat2(pathname)", ARG2 );
114+}
115+
116 PRE(sys_faccessat)
117 {
118 PRINT("sys_faccessat ( %ld, %#" FMT_REGWORD "x(%s), %ld )",
119diff --git a/coregrind/m_syswrap/syswrap-mips32-linux.c b/coregrind/m_syswrap/syswrap-mips32-linux.c
120index 6268a00dd..74a1f6eac 100644
121--- a/coregrind/m_syswrap/syswrap-mips32-linux.c
122+++ b/coregrind/m_syswrap/syswrap-mips32-linux.c
123@@ -1143,6 +1143,8 @@ static SyscallTableEntry syscall_main_table[] = {
124 LINX_ (__NR_faccessat2, sys_faccessat2), // 439
125
126 LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), // 441
127+
128+ LINX_(__NR_fchmodat2, sys_fchmodat2), // 452
129 };
130
131 SyscallTableEntry* ML_(get_linux_syscall_entry) (UInt sysno)
132diff --git a/coregrind/m_syswrap/syswrap-mips64-linux.c b/coregrind/m_syswrap/syswrap-mips64-linux.c
133index 6cdf25893..4e8508b7a 100644
134--- a/coregrind/m_syswrap/syswrap-mips64-linux.c
135+++ b/coregrind/m_syswrap/syswrap-mips64-linux.c
136@@ -820,6 +820,7 @@ static SyscallTableEntry syscall_main_table[] = {
137 LINXY (__NR_close_range, sys_close_range),
138 LINX_ (__NR_faccessat2, sys_faccessat2),
139 LINXY(__NR_epoll_pwait2, sys_epoll_pwait2),
140+ LINX_ (__NR_fchmodat2, sys_fchmodat2),
141 };
142
143 SyscallTableEntry * ML_(get_linux_syscall_entry) ( UInt sysno )
144diff --git a/coregrind/m_syswrap/syswrap-nanomips-linux.c b/coregrind/m_syswrap/syswrap-nanomips-linux.c
145index d724cde74..7859900c1 100644
146--- a/coregrind/m_syswrap/syswrap-nanomips-linux.c
147+++ b/coregrind/m_syswrap/syswrap-nanomips-linux.c
148@@ -829,6 +829,7 @@ static SyscallTableEntry syscall_main_table[] = {
149 LINXY (__NR_close_range, sys_close_range),
150 LINX_ (__NR_faccessat2, sys_faccessat2),
151 LINXY (__NR_epoll_pwait2, sys_epoll_pwait2),
152+ LINX_ (__NR_fchmodat2, sys_fchmodat2),
153 };
154
155 SyscallTableEntry* ML_(get_linux_syscall_entry) (UInt sysno)
156diff --git a/coregrind/m_syswrap/syswrap-ppc32-linux.c b/coregrind/m_syswrap/syswrap-ppc32-linux.c
157index c0cfef235..1e19116ee 100644
158--- a/coregrind/m_syswrap/syswrap-ppc32-linux.c
159+++ b/coregrind/m_syswrap/syswrap-ppc32-linux.c
160@@ -1063,6 +1063,8 @@ static SyscallTableEntry syscall_table[] = {
161 LINX_(__NR_faccessat2, sys_faccessat2), // 439
162
163 LINXY (__NR_epoll_pwait2, sys_epoll_pwait2), // 441
164+
165+ LINX_ (__NR_fchmodat2, sys_fchmodat2), // 452
166 };
167
168 SyscallTableEntry* ML_(get_linux_syscall_entry) ( UInt sysno )
169diff --git a/coregrind/m_syswrap/syswrap-ppc64-linux.c b/coregrind/m_syswrap/syswrap-ppc64-linux.c
170index f5976f30c..1097212a4 100644
171--- a/coregrind/m_syswrap/syswrap-ppc64-linux.c
172+++ b/coregrind/m_syswrap/syswrap-ppc64-linux.c
173@@ -1032,6 +1032,8 @@ static SyscallTableEntry syscall_table[] = {
174 LINX_(__NR_faccessat2, sys_faccessat2), // 439
175
176 LINXY (__NR_epoll_pwait2, sys_epoll_pwait2), // 441
177+
178+ LINX_ (__NR_fchmodat2, sys_fchmodat2), // 452
179 };
180
181 SyscallTableEntry* ML_(get_linux_syscall_entry) ( UInt sysno )
182diff --git a/coregrind/m_syswrap/syswrap-s390x-linux.c b/coregrind/m_syswrap/syswrap-s390x-linux.c
183index afba154e7..3588672c7 100644
184--- a/coregrind/m_syswrap/syswrap-s390x-linux.c
185+++ b/coregrind/m_syswrap/syswrap-s390x-linux.c
186@@ -873,6 +873,8 @@ static SyscallTableEntry syscall_table[] = {
187 LINX_(__NR_faccessat2, sys_faccessat2), // 439
188
189 LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), // 441
190+
191+ LINX_ (__NR_fchmodat2, sys_fchmodat2), // 452
192 };
193
194 SyscallTableEntry* ML_(get_linux_syscall_entry) ( UInt sysno )
195diff --git a/coregrind/m_syswrap/syswrap-x86-linux.c b/coregrind/m_syswrap/syswrap-x86-linux.c
196index da4fd8fa2..58badc6b0 100644
197--- a/coregrind/m_syswrap/syswrap-x86-linux.c
198+++ b/coregrind/m_syswrap/syswrap-x86-linux.c
199@@ -1658,6 +1658,8 @@ static SyscallTableEntry syscall_table[] = {
200 LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), // 441
201
202 LINXY(__NR_memfd_secret, sys_memfd_secret), // 447
203+
204+ LINX_(__NR_fchmodat2, sys_fchmodat2), // 452
205 };
206
207 SyscallTableEntry* ML_(get_linux_syscall_entry) ( UInt sysno )
208diff --git a/include/vki/vki-scnums-shared-linux.h b/include/vki/vki-scnums-shared-linux.h
209index 542382b53..a4cd87149 100644
210--- a/include/vki/vki-scnums-shared-linux.h
211+++ b/include/vki/vki-scnums-shared-linux.h
212@@ -50,4 +50,6 @@
213
214 #define __NR_memfd_secret 447
215
216+#define __NR_fchmodat2 452
217+
218 #endif
219--
2202.44.0
221
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 @@
1From d103475875858ab8a2e6b53ce178bb2f63883d4c Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 5 Jul 2017 17:37:56 -0700
4Subject: [PATCH 3/3] tests/seg_override: Replace __modify_ldt() with syscall()
5
6__modify_ldt() is specific to glibc, replacing it with syscall()
7makes it more portable.
8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11Upstream-Status: Submitted
12
13 none/tests/x86-linux/seg_override.c | 15 ++++++---------
14 1 file changed, 6 insertions(+), 9 deletions(-)
15
16diff --git a/none/tests/x86-linux/seg_override.c b/none/tests/x86-linux/seg_override.c
17index b7619c9..c89874b 100644
18--- a/none/tests/x86-linux/seg_override.c
19+++ b/none/tests/x86-linux/seg_override.c
20@@ -2,6 +2,8 @@
21 #include <stdio.h>
22 #include <errno.h>
23 #include <string.h>
24+#include <unistd.h>
25+#include <syscall.h>
26
27 /* Stuff from Wine. */
28
29@@ -52,14 +54,11 @@ inline static unsigned int wine_ldt_get_limit( const LDT_ENTRY *ent )
30 /* our copy of the ldt */
31 LDT_ENTRY ldt_copy[8192];
32
33-/* System call to set LDT entry. */
34-//extern int __modify_ldt (int, struct modify_ldt_ldt_s *, size_t);
35-extern int __modify_ldt (int, void *, size_t);
36-
37 void print_ldt ( void )
38 {
39 int res;
40- res = __modify_ldt( 0, ldt_copy, 8192*sizeof(LDT_ENTRY) );
41+ /* System call to set LDT entry. */
42+ res = syscall(SYS_modify_ldt, 0, ldt_copy, 8192*sizeof(LDT_ENTRY) );
43 printf("got %d bytes\n", res );
44 perror("error is");
45 }
46@@ -83,9 +82,6 @@ struct modify_ldt_ldt_s
47 unsigned int empty:25;
48 };
49
50-/* System call to set LDT entry. */
51-//extern int __modify_ldt (int, struct modify_ldt_ldt_s *, size_t);
52-
53 void set_ldt1 ( void* base )
54 {
55 int stat;
56@@ -102,7 +98,8 @@ void set_ldt1 ( void* base )
57 ldt_entry.read_exec_only = 0;
58 ldt_entry.limit_in_pages = 0;
59 ldt_entry.seg_not_present = 0;
60- stat = __modify_ldt (1, &ldt_entry, sizeof (ldt_entry));
61+ /* System call to set LDT entry. */
62+ stat = syscall(SYS_modify_ldt, 1, &ldt_entry, sizeof (ldt_entry));
63 printf("stat = %d\n", stat);
64 }
65
66--
672.13.2
68
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 @@
1From 41ff9aa49f6c54c66d0e6b37f265fd9cb0176057 Mon Sep 17 00:00:00 2001
2From: Paul Floyd <pjfloyd@wanadoo.fr>
3Date: Sun, 17 Dec 2023 14:18:51 +0100
4Subject: [PATCH 4/4] Bug 478624 - Valgrind incompatibility with binutils-2.42
5 on x86 with new nop patterns (unhandled instruction bytes: 0x2E 0x8D 0xB4
6 0x26)
7
8It was a bit of a struggle to get the testcase to build
9with both clang and gcc (oddly enough gcc was more difficult) so
10I just resorted to using .byte arrays.
11
12(cherry picked from commit d35005cef8ad8207542738812705ceabf137d7e0)
13
14Upstream-Status: Backport [https://sourceware.org/git/?p=valgrind.git;a=commit;h=41ff9aa49f6c54c66d0e6b37f265fd9cb0176057]
15Signed-off-by: Khem Raj <raj.khem@gmail.com>
16---
17 .gitignore | 1 +
18 NEWS | 2 ++
19 VEX/priv/guest_x86_toIR.c | 22 +++++++++++++-
20 none/tests/x86/Makefile.am | 2 ++
21 none/tests/x86/gnu_binutils_nop.c | 34 ++++++++++++++++++++++
22 none/tests/x86/gnu_binutils_nop.stderr.exp | 0
23 none/tests/x86/gnu_binutils_nop.vgtest | 2 ++
24 7 files changed, 62 insertions(+), 1 deletion(-)
25 create mode 100644 none/tests/x86/gnu_binutils_nop.c
26 create mode 100644 none/tests/x86/gnu_binutils_nop.stderr.exp
27 create mode 100644 none/tests/x86/gnu_binutils_nop.vgtest
28
29--- a/NEWS
30+++ b/NEWS
31@@ -9,6 +9,8 @@ The following bugs have been fixed or re
32 file produced by mold
33 476708 valgrind-monitor.py regular expressions should use raw strings
34 477198 Add fchmodat2 syscall on linux
35+478624 Valgrind incompatibility with binutils-2.42 on x86 with new nop patterns
36+ (unhandled instruction bytes: 0x2E 0x8D 0xB4 0x26)
37
38 To see details of a given bug, visit
39 https://bugs.kde.org/show_bug.cgi?id=XXXXXX
40--- a/VEX/priv/guest_x86_toIR.c
41+++ b/VEX/priv/guest_x86_toIR.c
42@@ -8198,7 +8198,7 @@ DisResult disInstr_X86_WRK (
43 delta += 5;
44 goto decode_success;
45 }
46- /* Don't barf on recent binutils padding,
47+ /* Don't barf on recent (2010) binutils padding,
48 all variants of which are: nopw %cs:0x0(%eax,%eax,1)
49 66 2e 0f 1f 84 00 00 00 00 00
50 66 66 2e 0f 1f 84 00 00 00 00 00
51@@ -8222,6 +8222,26 @@ DisResult disInstr_X86_WRK (
52 goto decode_success;
53 }
54 }
55+
56+ /* bug478624 GNU binutils uses a leal of esi into itself with
57+ a zero offset and CS prefix as an 8 byte no-op (Dec 2023).
58+ Since the CS prefix is hardly ever used we don't do much
59+ to decode it, just a few cases for conditional branches.
60+ So add handling here with other pseudo-no-ops.
61+ */
62+ if (code[0] == 0x2E && code[1] == 0x8D) {
63+ if (code[2] == 0x74 && code[3] == 0x26 && code[4] == 0x00) {
64+ DIP("leal %%cs:0(%%esi,%%eiz,1),%%esi\n");
65+ delta += 5;
66+ goto decode_success;
67+ }
68+ if (code[2] == 0xB4 && code[3] == 0x26 && code[4] == 0x00
69+ && code[5] == 0x00 && code[6] == 0x00 && code[7] == 0x00) {
70+ DIP("leal %%cs:0(%%esi,%%eiz,1),%%esi\n");
71+ delta += 8;
72+ goto decode_success;
73+ }
74+ }
75
76 // Intel CET requires the following opcodes to be treated as NOPs
77 // with any prefix and ModRM, SIB and disp combination:
78--- a/none/tests/x86/Makefile.am
79+++ b/none/tests/x86/Makefile.am
80@@ -52,6 +52,7 @@ EXTRA_DIST = \
81 fxtract.stdout.exp fxtract.stderr.exp fxtract.vgtest \
82 fxtract.stdout.exp-older-glibc \
83 getseg.stdout.exp getseg.stderr.exp getseg.vgtest \
84+ gnu_binutils_nop.stderr.exp gnu_binutils_nop.vgtest \
85 incdec_alt.stdout.exp incdec_alt.stderr.exp incdec_alt.vgtest \
86 int.stderr.exp int.stdout.exp int.disabled \
87 $(addsuffix .stderr.exp,$(INSN_TESTS)) \
88@@ -100,6 +101,7 @@ check_PROGRAMS = \
89 fpu_lazy_eflags \
90 fxtract \
91 getseg \
92+ gnu_binutils_nop \
93 incdec_alt \
94 $(INSN_TESTS) \
95 int \
96--- /dev/null
97+++ b/none/tests/x86/gnu_binutils_nop.c
98@@ -0,0 +1,34 @@
99+int main(void)
100+{
101+ // GNU binutils uses various opcodes as alternatives for nop
102+ // the idea is that it is faster to execute one large opcode
103+ // with no side-effects than multiple repetitions of the
104+ // single byte 'nop'. This gives more choice when code
105+ // needs to be padded.
106+
107+ // the following is based on
108+ // https://sourceware.org/cgit/binutils-gdb/tree/gas/config/tc-i386.c#n1256
109+
110+ // one byte
111+ __asm__ __volatile__("nop");
112+ // two bytes
113+ __asm__ __volatile__("xchg %ax,%ax");
114+ // three bytes
115+ //__asm__ __volatile__("leal 0(%esi),%esi");
116+ __asm__ __volatile__(".byte 0x8d,0x76,0x00");
117+ // four bytes
118+ //__asm__ __volatile__("leal 0(%esi,%eiz),%esi");
119+ __asm__ __volatile__(".byte 0x8d,0x74,0x26,0x00");
120+ // five bytes
121+ //__asm__ __volatile__("leal %cs:0(%esi,%eiz),%esi");
122+ __asm__ __volatile__(".byte 0x2e,0x8d,0x74,0x26,0x00");
123+ // six bytes
124+ //__asm__ __volatile__("leal 0L(%esi),%esi");
125+ __asm__ __volatile__(".byte 0x8d,0xb6,0x00,0x00,0x00,0x00");
126+ // seven bytes
127+ //__asm__ __volatile__("leal 0L(%esi,%eiz),%esi");
128+ __asm__ __volatile__(".byte 0x8d,0xb4,0x26,0x00,0x00,0x00,0x00");
129+ // eight bytes
130+ //__asm__ __volatile__("leal %cs:0L(%esi,%eiz),%esi");
131+ __asm__ __volatile__(".byte 0x2e,0x8d,0xb4,0x26,0x00,0x00,0x00,0x00");
132+}
133--- /dev/null
134+++ b/none/tests/x86/gnu_binutils_nop.vgtest
135@@ -0,0 +1,2 @@
136+prog: gnu_binutils_nop
137+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 @@
1From 8f916dcb395fe5a2429f2867ba4daf8ef3af073a Mon Sep 17 00:00:00 2001
2From: Randy MacLeod <Randy.MacLeod@windriver.com>
3Date: Tue, 16 Oct 2018 21:01:04 -0400
4Subject: [PATCH] Fix out of tree builds.
5
6The paths to these files need to be fully specified in
7the out of tree build case. glibc-2.X.supp is a generated file so the
8full path
9is deliberately not specified in that case.
10
11RP 2013/03/23
12
13Patch refreshed for valgrind-3.14.0.
14
15Upstream-Status: Pending
16
17Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
18Signed-off-by: Randy MacLeod <Randy.MacLeod@windriver.com>
19---
20 configure.ac | 66 ++++++++++++++++++++++++++--------------------------
21 1 file changed, 33 insertions(+), 33 deletions(-)
22
23diff --git a/configure.ac b/configure.ac
24index 524230d..54861c5 100755
25--- a/configure.ac
26+++ b/configure.ac
27@@ -396,50 +396,50 @@ case "${host_os}" in
28 9.*)
29 AC_MSG_RESULT([Darwin 9.x (${kernel}) / Mac OS X 10.5 Leopard])
30 AC_DEFINE([DARWIN_VERS], DARWIN_10_5, [Darwin / Mac OS X version])
31- DEFAULT_SUPP="darwin9.supp ${DEFAULT_SUPP}"
32- DEFAULT_SUPP="darwin9-drd.supp ${DEFAULT_SUPP}"
33+ DEFAULT_SUPP="$srcdir/darwin9.supp ${DEFAULT_SUPP}"
34+ DEFAULT_SUPP="$srcdir/darwin9-drd.supp ${DEFAULT_SUPP}"
35 ;;
36 10.*)
37 AC_MSG_RESULT([Darwin 10.x (${kernel}) / Mac OS X 10.6 Snow Leopard])
38 AC_DEFINE([DARWIN_VERS], DARWIN_10_6, [Darwin / Mac OS X version])
39- DEFAULT_SUPP="darwin10.supp ${DEFAULT_SUPP}"
40- DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
41+ DEFAULT_SUPP="$srcdir/darwin10.supp ${DEFAULT_SUPP}"
42+ DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
43 ;;
44 11.*)
45 AC_MSG_RESULT([Darwin 11.x (${kernel}) / Mac OS X 10.7 Lion])
46 AC_DEFINE([DARWIN_VERS], DARWIN_10_7, [Darwin / Mac OS X version])
47- DEFAULT_SUPP="darwin11.supp ${DEFAULT_SUPP}"
48- DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
49+ DEFAULT_SUPP="$srcdir/darwin11.supp ${DEFAULT_SUPP}"
50+ DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
51 ;;
52 12.*)
53 AC_MSG_RESULT([Darwin 12.x (${kernel}) / Mac OS X 10.8 Mountain Lion])
54 AC_DEFINE([DARWIN_VERS], DARWIN_10_8, [Darwin / Mac OS X version])
55- DEFAULT_SUPP="darwin12.supp ${DEFAULT_SUPP}"
56- DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
57+ DEFAULT_SUPP="$srcdir/darwin12.supp ${DEFAULT_SUPP}"
58+ DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
59 ;;
60 13.*)
61 AC_MSG_RESULT([Darwin 13.x (${kernel}) / Mac OS X 10.9 Mavericks])
62 AC_DEFINE([DARWIN_VERS], DARWIN_10_9, [Darwin / Mac OS X version])
63- DEFAULT_SUPP="darwin13.supp ${DEFAULT_SUPP}"
64- DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
65+ DEFAULT_SUPP="$srcdir/darwin13.supp ${DEFAULT_SUPP}"
66+ DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
67 ;;
68 14.*)
69 AC_MSG_RESULT([Darwin 14.x (${kernel}) / Mac OS X 10.10 Yosemite])
70 AC_DEFINE([DARWIN_VERS], DARWIN_10_10, [Darwin / Mac OS X version])
71- DEFAULT_SUPP="darwin14.supp ${DEFAULT_SUPP}"
72- DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
73+ DEFAULT_SUPP="$srcdir/darwin14.supp ${DEFAULT_SUPP}"
74+ DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
75 ;;
76 15.*)
77 AC_MSG_RESULT([Darwin 15.x (${kernel}) / Mac OS X 10.11 El Capitan])
78 AC_DEFINE([DARWIN_VERS], DARWIN_10_11, [Darwin / Mac OS X version])
79- DEFAULT_SUPP="darwin15.supp ${DEFAULT_SUPP}"
80- DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
81+ DEFAULT_SUPP="$srcdir/darwin15.supp ${DEFAULT_SUPP}"
82+ DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
83 ;;
84 16.*)
85 AC_MSG_RESULT([Darwin 16.x (${kernel}) / macOS 10.12 Sierra])
86 AC_DEFINE([DARWIN_VERS], DARWIN_10_12, [Darwin / Mac OS X version])
87- DEFAULT_SUPP="darwin16.supp ${DEFAULT_SUPP}"
88- DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
89+ DEFAULT_SUPP="$srcdir/darwin16.supp ${DEFAULT_SUPP}"
90+ DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
91 ;;
92 17.*)
93 AC_MSG_RESULT([Darwin 17.x (${kernel}) / macOS 10.13 High Sierra])
94@@ -464,7 +464,7 @@ case "${host_os}" in
95 DEFAULT_SUPP="solaris12.supp ${DEFAULT_SUPP}"
96 ;;
97 *)
98- DEFAULT_SUPP="solaris11.supp ${DEFAULT_SUPP}"
99+ DEFAULT_SUPP="$srcdir/solaris11.supp ${DEFAULT_SUPP}"
100 ;;
101 esac
102 ;;
103@@ -472,7 +472,7 @@ case "${host_os}" in
104 solaris2.12*)
105 AC_MSG_RESULT([ok (${host_os})])
106 VGCONF_OS="solaris"
107- DEFAULT_SUPP="solaris12.supp ${DEFAULT_SUPP}"
108+ DEFAULT_SUPP="$srcdir/solaris12.supp ${DEFAULT_SUPP}"
109 ;;
110
111 *)
112@@ -1095,29 +1095,29 @@ AC_MSG_CHECKING([the glibc version])
113 case "${GLIBC_VERSION}" in
114 2.2)
115 AC_MSG_RESULT(${GLIBC_VERSION} family)
116- DEFAULT_SUPP="glibc-2.2.supp ${DEFAULT_SUPP}"
117- DEFAULT_SUPP="glibc-2.2-LinuxThreads-helgrind.supp ${DEFAULT_SUPP}"
118- DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
119+ DEFAULT_SUPP="$srcdir/glibc-2.2.supp ${DEFAULT_SUPP}"
120+ DEFAULT_SUPP="$srcdir/glibc-2.2-LinuxThreads-helgrind.supp ${DEFAULT_SUPP}"
121+ DEFAULT_SUPP="$srcdir/glibc-2.X-drd.supp ${DEFAULT_SUPP}"
122 ;;
123 2.[[3-6]])
124 AC_MSG_RESULT(${GLIBC_VERSION} family)
125- DEFAULT_SUPP="glibc-${GLIBC_VERSION}.supp ${DEFAULT_SUPP}"
126- DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
127- DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
128+ DEFAULT_SUPP="$srcdir/glibc-${GLIBC_VERSION}.supp ${DEFAULT_SUPP}"
129+ DEFAULT_SUPP="$srcdir/glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
130+ DEFAULT_SUPP="$srcdir/glibc-2.X-drd.supp ${DEFAULT_SUPP}"
131 ;;
132 2.[[7-9]])
133 AC_MSG_RESULT(${GLIBC_VERSION} family)
134 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
135- DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
136- DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
137+ DEFAULT_SUPP="$srcdir/glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
138+ DEFAULT_SUPP="$srcdir/glibc-2.X-drd.supp ${DEFAULT_SUPP}"
139 ;;
140 2.10|2.11)
141 AC_MSG_RESULT(${GLIBC_VERSION} family)
142 AC_DEFINE([GLIBC_MANDATORY_STRLEN_REDIRECT], 1,
143 [Define to 1 if strlen() has been optimized heavily (amd64 glibc >= 2.10)])
144 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
145- DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
146- DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
147+ DEFAULT_SUPP="$srcdir/glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
148+ DEFAULT_SUPP="$srcdir/glibc-2.X-drd.supp ${DEFAULT_SUPP}"
149 ;;
150 2.*)
151 AC_MSG_RESULT(${GLIBC_VERSION} family)
152@@ -1126,8 +1126,8 @@ case "${GLIBC_VERSION}" in
153 AC_DEFINE([GLIBC_MANDATORY_INDEX_AND_STRLEN_REDIRECT], 1,
154 [Define to 1 if index() and strlen() have been optimized heavily (x86 glibc >= 2.12)])
155 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
156- DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
157- DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
158+ DEFAULT_SUPP="$srcdir/glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
159+ DEFAULT_SUPP="$srcdir/glibc-2.X-drd.supp ${DEFAULT_SUPP}"
160 ;;
161 darwin)
162 AC_MSG_RESULT(Darwin)
163@@ -1137,7 +1137,7 @@ case "${GLIBC_VERSION}" in
164 bionic)
165 AC_MSG_RESULT(Bionic)
166 AC_DEFINE([BIONIC_LIBC], 1, [Define to 1 if you're using Bionic])
167- DEFAULT_SUPP="bionic.supp ${DEFAULT_SUPP}"
168+ DEFAULT_SUPP="$srcdir/bionic.supp ${DEFAULT_SUPP}"
169 ;;
170 solaris)
171 AC_MSG_RESULT(Solaris)
172@@ -1164,8 +1164,8 @@ if test "$VGCONF_OS" != "solaris"; then
173 # attempt to detect whether such libraries are installed on the
174 # build machine (or even if any X facilities are present); just
175 # add the suppressions antidisirregardless.
176- DEFAULT_SUPP="xfree-4.supp ${DEFAULT_SUPP}"
177- DEFAULT_SUPP="xfree-3.supp ${DEFAULT_SUPP}"
178+ DEFAULT_SUPP="$srcdir/xfree-4.supp ${DEFAULT_SUPP}"
179+ DEFAULT_SUPP="$srcdir/xfree-3.supp ${DEFAULT_SUPP}"
180 fi
181
182
183--
1842.17.1
185
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 @@
1From f49f27f1bc67d07440b0ac9a7d767a8ea1589bfe Mon Sep 17 00:00:00 2001 1From e244a72c6f8803550f37e81f72bbae039651013b Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com> 2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Tue, 15 Dec 2015 15:50:44 +0200 3Date: Tue, 15 Dec 2015 15:50:44 +0200
4Subject: [PATCH 5/5] Modify vg_test wrapper to support PTEST formats 4Subject: [PATCH] Modify vg_test wrapper to support PTEST formats
5 5
6Change the valgrind regression test script vg_regtest to 6Change the valgrind regression test script vg_regtest to
7support the yocto ptest stdout reporting format. The commit adds 7support the yocto ptest stdout reporting format. The commit adds
@@ -14,7 +14,7 @@ option, --yocto-ptest, the valgrind regression test output is unchanged.
14Enforce 30 seconds limit for the test. 14Enforce 30 seconds limit for the test.
15This resume execution of the remaining tests when valgrind hangs. 15This resume execution of the remaining tests when valgrind hangs.
16 16
17Upstream-Status: Pending 17Upstream-Status: Inappropriate [oe-core specific]
18 18
19Signed-off-by: Dave Lerner <dave.lerner@windriver.com> 19Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
20Signed-off-by: Tudor Florea <tudor.florea@enea.com> 20Signed-off-by: Tudor Florea <tudor.florea@enea.com>
@@ -25,11 +25,11 @@ Increase time limit to 90 s.
25 25
26Signed-off-by: Yi Fan Yu <yifan.yu@windriver.com> 26Signed-off-by: Yi Fan Yu <yifan.yu@windriver.com>
27--- 27---
28 tests/vg_regtest.in | 75 +++++++++++++++++++++++++++++++++++++++-------------- 28 tests/vg_regtest.in | 75 +++++++++++++++++++++++++++++++++------------
29 1 file changed, 55 insertions(+), 20 deletions(-) 29 1 file changed, 55 insertions(+), 20 deletions(-)
30 30
31diff --git a/tests/vg_regtest.in b/tests/vg_regtest.in 31diff --git a/tests/vg_regtest.in b/tests/vg_regtest.in
32index a441f42..cb05b52 100755 32index ad18800..e4bd8cb 100755
33--- a/tests/vg_regtest.in 33--- a/tests/vg_regtest.in
34+++ b/tests/vg_regtest.in 34+++ b/tests/vg_regtest.in
35@@ -47,6 +47,7 @@ 35@@ -47,6 +47,7 @@
@@ -49,7 +49,7 @@ index a441f42..cb05b52 100755
49 . " Use EXTRA_REGTEST_OPTS to supply extra args for all tests\n" 49 . " Use EXTRA_REGTEST_OPTS to supply extra args for all tests\n"
50 . "\n"; 50 . "\n";
51 51
52@@ -186,6 +187,7 @@ my $outer_args; 52@@ -187,6 +188,7 @@ my $run_outer_args = "";
53 my $valgrind_lib = "$tests_dir/.in_place"; 53 my $valgrind_lib = "$tests_dir/.in_place";
54 my $keepunfiltered = 0; 54 my $keepunfiltered = 0;
55 my $looptillfail = 0; 55 my $looptillfail = 0;
@@ -57,7 +57,7 @@ index a441f42..cb05b52 100755
57 57
58 # default filter is the one named "filter_stderr" in the test's directory 58 # default filter is the one named "filter_stderr" in the test's directory
59 my $default_stderr_filter = "filter_stderr"; 59 my $default_stderr_filter = "filter_stderr";
60@@ -244,6 +246,8 @@ sub process_command_line() 60@@ -245,6 +247,8 @@ sub process_command_line()
61 $keepunfiltered = 1; 61 $keepunfiltered = 1;
62 } elsif ($arg =~ /^--loop-till-fail$/) { 62 } elsif ($arg =~ /^--loop-till-fail$/) {
63 $looptillfail = 1; 63 $looptillfail = 1;
@@ -66,7 +66,7 @@ index a441f42..cb05b52 100755
66 } else { 66 } else {
67 die $usage; 67 die $usage;
68 } 68 }
69@@ -365,13 +369,28 @@ sub read_vgtest_file($) 69@@ -376,13 +380,28 @@ sub read_vgtest_file($)
70 #---------------------------------------------------------------------------- 70 #----------------------------------------------------------------------------
71 # Since most of the program time is spent in system() calls, need this to 71 # Since most of the program time is spent in system() calls, need this to
72 # propagate a Ctrl-C enabling us to quit. 72 # propagate a Ctrl-C enabling us to quit.
@@ -100,7 +100,7 @@ index a441f42..cb05b52 100755
100 # if $keepunfiltered, copies $1 to $1.unfiltered.out 100 # if $keepunfiltered, copies $1 to $1.unfiltered.out
101 # renames $0 tp $1 101 # renames $0 tp $1
102 sub filtered_rename($$) 102 sub filtered_rename($$)
103@@ -419,23 +438,25 @@ sub do_diffs($$$$) 103@@ -430,23 +449,25 @@ sub do_diffs($$$$)
104 # A match; remove .out and any previously created .diff files. 104 # A match; remove .out and any previously created .diff files.
105 unlink("$name.$mid.out"); 105 unlink("$name.$mid.out");
106 unlink(<$name.$mid.diff*>); 106 unlink(<$name.$mid.diff*>);
@@ -128,7 +128,7 @@ index a441f42..cb05b52 100755
128 $vgtest =~ /^(.*)\.vgtest/; 128 $vgtest =~ /^(.*)\.vgtest/;
129 my $name = $1; 129 my $name = $1;
130 my $fullname = "$dir/$name"; 130 my $fullname = "$dir/$name";
131@@ -454,7 +475,11 @@ sub do_one_test($$) 131@@ -465,7 +486,11 @@ sub do_one_test($$)
132 } elsif (256 == $prereq_res) { 132 } elsif (256 == $prereq_res) {
133 # Nb: weird Perl-ism -- exit code of '1' is seen by Perl as 256... 133 # Nb: weird Perl-ism -- exit code of '1' is seen by Perl as 256...
134 # Prereq failed, skip. 134 # Prereq failed, skip.
@@ -141,7 +141,7 @@ index a441f42..cb05b52 100755
141 return; 141 return;
142 } else { 142 } else {
143 # Bad prereq; abort. 143 # Bad prereq; abort.
144@@ -472,7 +497,7 @@ sub do_one_test($$) 144@@ -483,7 +508,7 @@ sub do_one_test($$)
145 } 145 }
146 # If there is a progB, let's start it in background: 146 # If there is a progB, let's start it in background:
147 printf("%-16s valgrind $extraopts $vgopts $prog $args (progB: $progB $argsB)\n", 147 printf("%-16s valgrind $extraopts $vgopts $prog $args (progB: $progB $argsB)\n",
@@ -150,7 +150,7 @@ index a441f42..cb05b52 100755
150 # progB.done used to detect child has finished. See below. 150 # progB.done used to detect child has finished. See below.
151 # Note: redirection of stdout and stderr is before $progB to allow argsB 151 # Note: redirection of stdout and stderr is before $progB to allow argsB
152 # to e.g. redirect stdoutB to stderrB 152 # to e.g. redirect stdoutB to stderrB
153@@ -488,7 +513,8 @@ sub do_one_test($$) 153@@ -499,7 +524,8 @@ sub do_one_test($$)
154 . "touch progB.done) &"); 154 . "touch progB.done) &");
155 } 155 }
156 } else { 156 } else {
@@ -160,7 +160,7 @@ index a441f42..cb05b52 100755
160 } 160 }
161 161
162 # Collect environment variables, if any. 162 # Collect environment variables, if any.
163@@ -529,7 +555,7 @@ sub do_one_test($$) 163@@ -540,7 +566,7 @@ sub do_one_test($$)
164 # Find all the .stdout.exp files. If none, use /dev/null. 164 # Find all the .stdout.exp files. If none, use /dev/null.
165 my @stdout_exps = <$name.stdout.exp*>; 165 my @stdout_exps = <$name.stdout.exp*>;
166 @stdout_exps = ( "/dev/null" ) if (0 == scalar @stdout_exps); 166 @stdout_exps = ( "/dev/null" ) if (0 == scalar @stdout_exps);
@@ -169,7 +169,7 @@ index a441f42..cb05b52 100755
169 169
170 # Filter stderr 170 # Filter stderr
171 $stderr_filter_args = $name if (! defined $stderr_filter_args); 171 $stderr_filter_args = $name if (! defined $stderr_filter_args);
172@@ -538,7 +564,7 @@ sub do_one_test($$) 172@@ -549,7 +575,7 @@ sub do_one_test($$)
173 # Find all the .stderr.exp files. At least one must exist. 173 # Find all the .stderr.exp files. At least one must exist.
174 my @stderr_exps = <$name.stderr.exp*>; 174 my @stderr_exps = <$name.stderr.exp*>;
175 (0 != scalar @stderr_exps) or die "Could not find `$name.stderr.exp*'\n"; 175 (0 != scalar @stderr_exps) or die "Could not find `$name.stderr.exp*'\n";
@@ -178,7 +178,7 @@ index a441f42..cb05b52 100755
178 178
179 if (defined $progB) { 179 if (defined $progB) {
180 # wait for the child to be finished 180 # wait for the child to be finished
181@@ -562,7 +588,7 @@ sub do_one_test($$) 181@@ -573,7 +599,7 @@ sub do_one_test($$)
182 # Find all the .stdoutB.exp files. If none, use /dev/null. 182 # Find all the .stdoutB.exp files. If none, use /dev/null.
183 my @stdoutB_exps = <$name.stdoutB.exp*>; 183 my @stdoutB_exps = <$name.stdoutB.exp*>;
184 @stdoutB_exps = ( "/dev/null" ) if (0 == scalar @stdoutB_exps); 184 @stdoutB_exps = ( "/dev/null" ) if (0 == scalar @stdoutB_exps);
@@ -187,7 +187,7 @@ index a441f42..cb05b52 100755
187 187
188 # Filter stderr 188 # Filter stderr
189 $stderrB_filter_args = $name if (! defined $stderrB_filter_args); 189 $stderrB_filter_args = $name if (! defined $stderrB_filter_args);
190@@ -571,7 +597,7 @@ sub do_one_test($$) 190@@ -582,7 +608,7 @@ sub do_one_test($$)
191 # Find all the .stderrB.exp files. At least one must exist. 191 # Find all the .stderrB.exp files. At least one must exist.
192 my @stderrB_exps = <$name.stderrB.exp*>; 192 my @stderrB_exps = <$name.stderrB.exp*>;
193 (0 != scalar @stderrB_exps) or die "Could not find `$name.stderrB.exp*'\n"; 193 (0 != scalar @stderrB_exps) or die "Could not find `$name.stderrB.exp*'\n";
@@ -196,7 +196,7 @@ index a441f42..cb05b52 100755
196 } 196 }
197 197
198 # Maybe do post-test check 198 # Maybe do post-test check
199@@ -583,7 +609,7 @@ sub do_one_test($$) 199@@ -594,7 +620,7 @@ sub do_one_test($$)
200 # Find all the .post.exp files. If none, use /dev/null. 200 # Find all the .post.exp files. If none, use /dev/null.
201 my @post_exps = <$name.post.exp*>; 201 my @post_exps = <$name.post.exp*>;
202 @post_exps = ( "/dev/null" ) if (0 == scalar @post_exps); 202 @post_exps = ( "/dev/null" ) if (0 == scalar @post_exps);
@@ -205,7 +205,7 @@ index a441f42..cb05b52 100755
205 } 205 }
206 } 206 }
207 207
208@@ -592,6 +618,13 @@ sub do_one_test($$) 208@@ -603,6 +629,13 @@ sub do_one_test($$)
209 print("(cleanup operation failed: $cleanup)\n"); 209 print("(cleanup operation failed: $cleanup)\n");
210 } 210 }
211 211
@@ -219,25 +219,25 @@ index a441f42..cb05b52 100755
219 $num_tests_done++; 219 $num_tests_done++;
220 } 220 }
221 221
222@@ -631,7 +664,7 @@ sub test_one_dir($$) 222@@ -643,7 +676,7 @@ sub test_one_dir($$)
223 my $found_tests = (0 != (grep { $_ =~ /\.vgtest$/ } @fs));
224 223
224 my $tests_start_time = time;
225 if ($found_tests) { 225 if ($found_tests) {
226- print "-- Running tests in $full_dir $dashes\n"; 226- print "-- Running tests in $full_dir $dashes\n";
227+ print "-- Running tests in $full_dir $dashes\n" if ($yoctoptest == 0); 227+ print "-- Running tests in $full_dir $dashes\n" if ($yoctoptest == 0);
228 } 228 }
229 foreach my $f (@fs) { 229 foreach my $f (@fs) {
230 if (-d $f) { 230 if (-d $f) {
231@@ -641,7 +674,7 @@ sub test_one_dir($$) 231@@ -657,7 +690,7 @@ sub test_one_dir($$)
232 } 232 my $end_time = "(in $tests_cost_time sec)";
233 } 233 my $end_dashes = "-" x (50 - (length $full_dir)
234 if ($found_tests) { 234 - (length $end_time) - 1);
235- print "-- Finished tests in $full_dir $dashes\n"; 235- print "-- Finished tests in $full_dir $end_time $end_dashes\n";
236+ print "-- Finished tests in $full_dir $dashes\n" if ($yoctoptest == 0); 236+ print "-- Finished tests in $full_dir $dashes\n" if ($yoctoptest == 0);
237 } 237 }
238 238
239 chdir(".."); 239 chdir("..");
240@@ -667,10 +700,12 @@ sub summarise_results 240@@ -683,10 +716,12 @@ sub summarise_results
241 $num_failures{"stdout"}, plural($num_failures{"stdout"}), 241 $num_failures{"stdout"}, plural($num_failures{"stdout"}),
242 $num_failures{"stderrB"}, plural($num_failures{"stderrB"}), 242 $num_failures{"stderrB"}, plural($num_failures{"stderrB"}),
243 $num_failures{"stdoutB"}, plural($num_failures{"stdoutB"}), 243 $num_failures{"stdoutB"}, plural($num_failures{"stdoutB"}),
@@ -253,5 +253,5 @@ index a441f42..cb05b52 100755
253 print "\n"; 253 print "\n";
254 } 254 }
255-- 255--
2562.6.2 2562.30.2
257 257
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 @@
1From b4b9f072c22f96844e02cb9d68f7ff2408680817 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 10 Jun 2017 01:07:59 -0700
4Subject: [PATCH 5/6] tc20_verifywrap.c: Fake __GLIBC_PREREQ with musl
5
6similar to sun
7
8Upstream-Status: Pending
9
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
12 helgrind/tests/tc20_verifywrap.c | 2 +-
13 1 file changed, 1 insertion(+), 1 deletion(-)
14
15diff --git a/helgrind/tests/tc20_verifywrap.c b/helgrind/tests/tc20_verifywrap.c
16index c110000..a311a49 100644
17--- a/helgrind/tests/tc20_verifywrap.c
18+++ b/helgrind/tests/tc20_verifywrap.c
19@@ -20,7 +20,7 @@
20
21 #if !defined(__APPLE__)
22
23-#if defined(__sun__)
24+#if defined(__sun__) || (defined(__linux__) && !defined(__GLIBC__))
25 /* Fake __GLIBC_PREREQ on Solaris. Pretend glibc >= 2.4. */
26 # define __GLIBC_PREREQ
27 #else
28--
292.13.1
30
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>
3Date: Mon, 21 Nov 2011 17:31:39 +0530 3Date: Mon, 21 Nov 2011 17:31:39 +0530
4Subject: [PATCH] Added support for PPC instructions mfatbu, mfatbl. 4Subject: [PATCH] Added support for PPC instructions mfatbu, mfatbl.
5 5
6Upstream-Status: Pending
7
8Signed-off-by: Aneesh Bansal <aneesh.bansal@freescale.com>
9---
10Currently 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 : 6Currently 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 :
11dis_proc_ctl(ppc)(mfspr,SPR)(0x20F) 7dis_proc_ctl(ppc)(mfspr,SPR)(0x20F)
12disInstr(ppc): unhandled instruction: 0x7C0F82A6 8disInstr(ppc): unhandled instruction: 0x7C0F82A6
13 9
10Upstream-Status: Submitted [https://bugs.kde.org/show_bug.cgi?id=289836]
11
12Signed-off-by: Aneesh Bansal <aneesh.bansal@freescale.com>
13---
14 14
15 VEX/priv/guest_ppc_defs.h | 2 ++ 15 VEX/priv/guest_ppc_defs.h | 2 ++
16 VEX/priv/guest_ppc_helpers.c | 18 ++++++++++++++++++ 16 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
8possible, but fallback to C when building for ARM targets which don't 8possible, but fallback to C when building for ARM targets which don't
9support neon. 9support neon.
10 10
11Upstream-Status: Pending 11Upstream-Status: Submitted [https://bugs.kde.org/show_bug.cgi?id=454346]
12 12
13Signed-off-by: Andre McCurdy <armccurdy@gmail.com> 13Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
14--- 14---
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 @@
1From 67e7a690107efb16d6d5aebfe420b64a552accdf Mon Sep 17 00:00:00 2001 1From beaa5b64c60d501fa9cd59fdc563e5f5bccf6882 Mon Sep 17 00:00:00 2001
2From: Qing He <qing.he@intel.com> 2From: Qing He <qing.he@intel.com>
3Date: Tue, 31 Aug 2010 22:51:58 +0800 3Date: Tue, 31 Aug 2010 22:51:58 +0800
4Subject: [PATCH] valgrind: fix perl scripts 4Subject: [PATCH] valgrind: fix perl scripts
@@ -17,35 +17,15 @@ a better fix would need:
17Upstream-Status: Inappropriate [configuration] 17Upstream-Status: Inappropriate [configuration]
18 18
19Signed-off-by: Maxin B. John <maxin.john@intel.com> 19Signed-off-by: Maxin B. John <maxin.john@intel.com>
20
20--- 21---
21 cachegrind/cg_annotate.in | 2 +- 22 massif/ms_print.in | 2 +-
22 cachegrind/cg_diff.in | 2 +- 23 perf/vg_perf.in | 2 +-
23 massif/ms_print.in | 2 +- 24 tests/vg_regtest.in | 2 +-
24 perf/vg_perf.in | 2 +- 25 3 files changed, 3 insertions(+), 3 deletions(-)
25 4 files changed, 4 insertions(+), 4 deletions(-)
26 26
27diff --git a/cachegrind/cg_annotate.in b/cachegrind/cg_annotate.in
28index 69365e8..978265d 100644
29--- a/cachegrind/cg_annotate.in
30+++ b/cachegrind/cg_annotate.in
31@@ -1,4 +1,4 @@
32-#! @PERL@
33+#! /usr/bin/perl
34
35 ##--------------------------------------------------------------------##
36 ##--- Cachegrind's annotator. cg_annotate.in ---##
37diff --git a/cachegrind/cg_diff.in b/cachegrind/cg_diff.in
38index 395460b..05873cc 100755
39--- a/cachegrind/cg_diff.in
40+++ b/cachegrind/cg_diff.in
41@@ -1,4 +1,4 @@
42-#! @PERL@
43+#! /usr/bin/perl
44
45 ##--------------------------------------------------------------------##
46 ##--- Cachegrind's differencer. cg_diff.in ---##
47diff --git a/massif/ms_print.in b/massif/ms_print.in 27diff --git a/massif/ms_print.in b/massif/ms_print.in
48index e6fae89..3b85b40 100755 28index a206ce4..df1bc31 100755
49--- a/massif/ms_print.in 29--- a/massif/ms_print.in
50+++ b/massif/ms_print.in 30+++ b/massif/ms_print.in
51@@ -1,4 +1,4 @@ 31@@ -1,4 +1,4 @@
@@ -55,7 +35,7 @@ index e6fae89..3b85b40 100755
55 ##--------------------------------------------------------------------## 35 ##--------------------------------------------------------------------##
56 ##--- Massif's results printer ms_print.in ---## 36 ##--- Massif's results printer ms_print.in ---##
57diff --git a/perf/vg_perf.in b/perf/vg_perf.in 37diff --git a/perf/vg_perf.in b/perf/vg_perf.in
58index 7a80cb0..28f6156 100644 38index 90ee1d2..c585096 100644
59--- a/perf/vg_perf.in 39--- a/perf/vg_perf.in
60+++ b/perf/vg_perf.in 40+++ b/perf/vg_perf.in
61@@ -1,4 +1,4 @@ 41@@ -1,4 +1,4 @@
@@ -65,7 +45,7 @@ index 7a80cb0..28f6156 100644
65 ##--- Valgrind performance testing script vg_perf ---## 45 ##--- Valgrind performance testing script vg_perf ---##
66 ##--------------------------------------------------------------------## 46 ##--------------------------------------------------------------------##
67diff --git a/tests/vg_regtest.in b/tests/vg_regtest.in 47diff --git a/tests/vg_regtest.in b/tests/vg_regtest.in
68index cb05b52..032e947 100755 48index 7152765..ad18800 100755
69--- a/tests/vg_regtest.in 49--- a/tests/vg_regtest.in
70+++ b/tests/vg_regtest.in 50+++ b/tests/vg_regtest.in
71@@ -1,4 +1,4 @@ 51@@ -1,4 +1,4 @@
@@ -74,5 +54,3 @@ index cb05b52..032e947 100755
74 ##--------------------------------------------------------------------## 54 ##--------------------------------------------------------------------##
75 ##--- Valgrind regression testing script vg_regtest ---## 55 ##--- Valgrind regression testing script vg_regtest ---##
76 ##--------------------------------------------------------------------## 56 ##--------------------------------------------------------------------##
77---
782.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 @@
1gdbserver_tests/hgtls
2cachegrind/tests/ann1
3callgrind/tests/simwork1
4callgrind/tests/simwork2
5callgrind/tests/simwork3
6callgrind/tests/simwork-both
7callgrind/tests/simwork-cache
8callgrind/tests/threads
9callgrind/tests/threads-use
10drd/tests/annotate_barrier
11drd/tests/annotate_barrier_xml
12drd/tests/annotate_hbefore
13drd/tests/annotate_hb_err
14drd/tests/annotate_hb_race
15drd/tests/annotate_ignore_read
16drd/tests/annotate_ignore_rw
17drd/tests/annotate_ignore_rw2
18drd/tests/annotate_ignore_write
19drd/tests/annotate_ignore_write2
20drd/tests/annotate_order_1
21drd/tests/annotate_order_2
22drd/tests/annotate_order_3
23drd/tests/annotate_publish_hg
24drd/tests/annotate_rwlock
25drd/tests/annotate_rwlock_hg
26drd/tests/annotate_sem 1drd/tests/annotate_sem
27drd/tests/annotate_smart_pointer 2gdbserver_tests/hgtls
28drd/tests/annotate_smart_pointer2
29drd/tests/annotate_spinlock
30drd/tests/annotate_static
31drd/tests/annotate_trace_memory
32drd/tests/annotate_trace_memory_xml
33drd/tests/atomic_var
34drd/tests/bar_trivial
35drd/tests/bug-235681
36drd/tests/bug322621
37drd/tests/circular_buffer
38drd/tests/concurrent_close
39drd/tests/custom_alloc
40drd/tests/custom_alloc_fiw
41drd/tests/dlopen
42drd/tests/fork-parallel
43drd/tests/fork-serial
44drd/tests/fp_race
45drd/tests/fp_race2
46drd/tests/fp_race_xml
47drd/tests/free_is_write
48drd/tests/free_is_write2
49drd/tests/hg01_all_ok
50drd/tests/hg02_deadlock
51drd/tests/hg03_inherit
52drd/tests/hg04_race
53drd/tests/hg05_race2
54drd/tests/hg06_readshared
55drd/tests/hold_lock_1
56drd/tests/hold_lock_2
57drd/tests/linuxthreads_det
58drd/tests/matinv
59drd/tests/memory_allocation
60drd/tests/monitor_example
61drd/tests/new_delete
62drd/tests/pth_barrier
63drd/tests/pth_barrier2
64drd/tests/pth_barrier3
65drd/tests/pth_barrier_race
66drd/tests/pth_barrier_reinit
67drd/tests/pth_barrier_thr_cr
68drd/tests/pth_broadcast
69drd/tests/pth_cancel_locked
70drd/tests/pth_cleanup_handler
71drd/tests/pth_cond_race
72drd/tests/pth_cond_race2
73drd/tests/pth_detached2
74drd/tests/pth_detached3
75drd/tests/pth_detached_sem
76drd/tests/pth_inconsistent_cond_wait
77drd/tests/pth_mutex_reinit
78drd/tests/pth_once
79drd/tests/pth_process_shared_mutex
80drd/tests/pth_spinlock
81drd/tests/pth_uninitialized_cond
82drd/tests/read_and_free_race
83drd/tests/recursive_mutex
84drd/tests/rwlock_race
85drd/tests/rwlock_test
86drd/tests/rwlock_type_checking
87drd/tests/sem_as_mutex
88drd/tests/sem_as_mutex2
89drd/tests/sem_as_mutex3
90drd/tests/sem_open
91drd/tests/sem_open2
92drd/tests/sem_open3
93drd/tests/sem_open_traced
94drd/tests/sem_wait
95drd/tests/sigalrm
96drd/tests/sigaltstack
97drd/tests/std_atomic
98drd/tests/std_string
99drd/tests/std_thread
100drd/tests/std_thread2
101drd/tests/str_tester
102drd/tests/tc01_simple_race
103drd/tests/tc02_simple_tls
104drd/tests/tc03_re_excl
105drd/tests/tc04_free_lock
106drd/tests/tc05_simple_race
107drd/tests/tc06_two_races
108drd/tests/tc07_hbl1
109drd/tests/tc08_hbl2
110drd/tests/tc09_bad_unlock
111drd/tests/tc10_rec_lock
112drd/tests/tc11_XCHG
113drd/tests/tc12_rwl_trivial
114drd/tests/tc13_laog1
115drd/tests/tc15_laog_lockdel
116drd/tests/tc16_byterace
117drd/tests/tc17_sembar
118drd/tests/tc18_semabuse
119drd/tests/tc19_shadowmem
120drd/tests/tc21_pthonce
121drd/tests/tc22_exit_w_lock
122drd/tests/tc23_bogus_condwait
123helgrind/tests/annotate_rwlock
124helgrind/tests/annotate_smart_pointer
125helgrind/tests/bar_bad
126helgrind/tests/bar_trivial
127helgrind/tests/bug322621
128helgrind/tests/cond_init_destroy
129helgrind/tests/cond_timedwait_invalid
130helgrind/tests/cond_timedwait_test
131helgrind/tests/free_is_write
132helgrind/tests/hg01_all_ok
133helgrind/tests/hg03_inherit
134helgrind/tests/hg04_race
135helgrind/tests/hg05_race2 3helgrind/tests/hg05_race2
136helgrind/tests/hg06_readshared
137helgrind/tests/locked_vs_unlocked1_fwd
138helgrind/tests/locked_vs_unlocked1_rev
139helgrind/tests/locked_vs_unlocked2
140helgrind/tests/locked_vs_unlocked3
141helgrind/tests/pth_barrier1
142helgrind/tests/pth_barrier2
143helgrind/tests/pth_barrier3
144helgrind/tests/pth_destroy_cond
145helgrind/tests/rwlock_race
146helgrind/tests/rwlock_test
147helgrind/tests/shmem_abits
148helgrind/tests/stackteardown
149helgrind/tests/t2t_laog
150helgrind/tests/tc01_simple_race
151helgrind/tests/tc02_simple_tls
152helgrind/tests/tc03_re_excl
153helgrind/tests/tc04_free_lock
154helgrind/tests/tc05_simple_race
155helgrind/tests/tc06_two_races
156helgrind/tests/tc06_two_races_xml
157helgrind/tests/tc07_hbl1
158helgrind/tests/tc08_hbl2
159helgrind/tests/tc09_bad_unlock
160helgrind/tests/tc10_rec_lock
161helgrind/tests/tc11_XCHG
162helgrind/tests/tc12_rwl_trivial
163helgrind/tests/tc13_laog1
164helgrind/tests/tc14_laog_dinphils
165helgrind/tests/tc15_laog_lockdel
166helgrind/tests/tc16_byterace
167helgrind/tests/tc17_sembar
168helgrind/tests/tc18_semabuse
169helgrind/tests/tc19_shadowmem
170helgrind/tests/tc20_verifywrap 4helgrind/tests/tc20_verifywrap
171helgrind/tests/tc21_pthonce
172helgrind/tests/tc22_exit_w_lock
173helgrind/tests/tc23_bogus_condwait
174helgrind/tests/tc24_nonzero_sem
175helgrind/tests/tls_threads
176memcheck/tests/accounting
177memcheck/tests/addressable
178memcheck/tests/arm64-linux/scalar
179memcheck/tests/atomic_incs
180memcheck/tests/badaddrvalue
181memcheck/tests/badfree
182memcheck/tests/badfree-2trace
183memcheck/tests/badfree3
184memcheck/tests/badjump
185memcheck/tests/badjump2
186memcheck/tests/badloop
187memcheck/tests/badpoll
188memcheck/tests/badrw
189memcheck/tests/big_blocks_freed_list
190memcheck/tests/brk2
191memcheck/tests/dw4 5memcheck/tests/dw4
192memcheck/tests/err_disable4
193memcheck/tests/err_disable_arange1
194memcheck/tests/leak-autofreepool-5
195memcheck/tests/leak_cpp_interior
196memcheck/tests/linux/lsframe1
197memcheck/tests/linux/lsframe2
198memcheck/tests/linux/with-space
199memcheck/tests/origin5-bz2
200memcheck/tests/origin6-fp
201memcheck/tests/overlap
202memcheck/tests/partial_load_dflt
203memcheck/tests/pdb-realloc2
204memcheck/tests/sh-mem
205memcheck/tests/sh-mem-random
206memcheck/tests/sigaltstack
207memcheck/tests/sigkill
208memcheck/tests/signal2
209memcheck/tests/supp_unknown
210memcheck/tests/threadname
211memcheck/tests/threadname_xml
212memcheck/tests/unit_oset
213memcheck/tests/varinfo1 6memcheck/tests/varinfo1
214memcheck/tests/varinfo2 7memcheck/tests/varinfo2
215memcheck/tests/varinfo3 8memcheck/tests/varinfo3
@@ -217,19 +10,23 @@ memcheck/tests/varinfo4
217memcheck/tests/varinfo5 10memcheck/tests/varinfo5
218memcheck/tests/varinfo6 11memcheck/tests/varinfo6
219memcheck/tests/varinforestrict 12memcheck/tests/varinforestrict
220memcheck/tests/vcpu_bz2 13memcheck/tests/atomic_incs
221memcheck/tests/vcpu_fbench 14memcheck/tests/bug464969_d_demangle
222memcheck/tests/vcpu_fnfns 15memcheck/tests/cxx17_aligned_new
223memcheck/tests/wcs 16memcheck/tests/demangle
224memcheck/tests/wrap1 17memcheck/tests/long_namespace_xml
225memcheck/tests/wrap2 18memcheck/tests/mismatches
226memcheck/tests/wrap3 19memcheck/tests/mismatches_xml
227memcheck/tests/wrap4 20memcheck/tests/new_aligned_delete_default
228memcheck/tests/wrap5 21memcheck/tests/new_delete_mismatch_size
229memcheck/tests/wrap6 22memcheck/tests/new_nothrow
230memcheck/tests/wrap7 23memcheck/tests/realloc_size_zero_mismatch
231memcheck/tests/wrap8 24memcheck/tests/sized_aligned_new_delete_args
232memcheck/tests/wrapmalloc 25memcheck/tests/sized_aligned_new_delete_misaligned1
233memcheck/tests/wrapmallocstatic 26memcheck/tests/sized_aligned_new_delete_misaligned1_xml
234memcheck/tests/writev1 27memcheck/tests/sized_aligned_new_delete_misaligned2
235memcheck/tests/xml1 28memcheck/tests/sized_aligned_new_delete_misaligned2_xml
29memcheck/tests/sized_aligned_new_delete_misaligned3
30memcheck/tests/sized_aligned_new_delete_misaligned3_xml
31memcheck/tests/sized_delete
32none/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 @@
1cachegrind/tests/wrap5
2drd/tests/boost_thread
3none/tests/amd64/fb_test_amd64
4none/tests/tls
5gdbserver_tests/hginfo
6gdbserver_tests/mcinvokeRU
7memcheck/tests/linux/dlclose_leak-no-keep
8memcheck/tests/linux/dlclose_leak
9memcheck/tests/linux/timerfd-syscall
10memcheck/tests/supp_unknown
11memcheck/tests/wrap1
12memcheck/tests/wrap2
13memcheck/tests/wrap3
14memcheck/tests/wrap4
15memcheck/tests/wrap5
16memcheck/tests/wrap6
17memcheck/tests/wrap7
18memcheck/tests/wrap8
19helgrind/tests/tls_threads
20helgrind/tests/pth_mempcpy_false_races
1drd/tests/bar_bad 21drd/tests/bar_bad
2drd/tests/bar_bad_xml 22drd/tests/bar_bad_xml
23drd/tests/pth_barrier_thr_cr
24drd/tests/std_thread2
25drd/tests/thread_name_xml
26massif/tests/deep-D
27massif/tests/bug469146
28massif/tests/new-cpp
29massif/tests/overloaded-new
diff --git a/meta/recipes-devtools/valgrind/valgrind/run-ptest b/meta/recipes-devtools/valgrind/valgrind/run-ptest
index e8a1a668fc..15cf03f9d2 100755
--- a/meta/recipes-devtools/valgrind/valgrind/run-ptest
+++ b/meta/recipes-devtools/valgrind/valgrind/run-ptest
@@ -7,6 +7,7 @@
7# Randy MacLeod <Randy.MacLeod@windriver.com> 7# Randy MacLeod <Randy.MacLeod@windriver.com>
8############################################################### 8###############################################################
9VALGRIND_LIB=@libdir@/valgrind 9VALGRIND_LIB=@libdir@/valgrind
10VALGRIND_LIBEXECDIR=@libexecdir@/valgrind
10VALGRIND_BIN=@bindir@/valgrind 11VALGRIND_BIN=@bindir@/valgrind
11 12
12LOG="${VALGRIND_LIB}/ptest/valgrind_ptest_$(date +%Y%m%d-%H%M%S).log" 13LOG="${VALGRIND_LIB}/ptest/valgrind_ptest_$(date +%Y%m%d-%H%M%S).log"
@@ -31,18 +32,35 @@ if [ "$arch" = "aarch64" ]; then
31 done 32 done
32fi 33fi
33 34
35echo "Run non-deterministic tests using taskset to limit them to a single core."
36for i in `cat taskset_nondeterministic_tests`; do
37 # The remove-for-aarch64 and taskset_nondeterministic_tests may overlap so
38 # check if a file exist.
39 if test -f "${i}.vgtest"; then
40 taskset 0x00000001 perl tests/vg_regtest --valgrind=${VALGRIND_BIN} --valgrind-lib=${VALGRIND_LIBEXECDIR} --yocto-ptest $i 2>&1|tee -a ${LOG}
41 mv $i.vgtest $i.IGNORE
42 fi
43done
44
34cd ${VALGRIND_LIB}/ptest && ./tests/vg_regtest \ 45cd ${VALGRIND_LIB}/ptest && ./tests/vg_regtest \
35 --valgrind=${VALGRIND_BIN} \ 46 --valgrind=${VALGRIND_BIN} \
36 --valgrind-lib=${VALGRIND_LIB} \ 47 --valgrind-lib=${VALGRIND_LIBEXECDIR} \
37 --yocto-ptest \ 48 --yocto-ptest \
38 gdbserver_tests ${TOOLS} ${EXP_TOOLS} \ 49 gdbserver_tests ${TOOLS} ${EXP_TOOLS} \
39 2>&1|tee ${LOG} 50 2>&1|tee -a ${LOG}
40 51
41cd ${VALGRIND_LIB}/ptest && \ 52cd ${VALGRIND_LIB}/ptest && \
42 ./tests/post_regtest_checks $(pwd) \ 53 ./tests/post_regtest_checks $(pwd) \
43 gdbserver_tests ${TOOLS} ${EXP_TOOLS} \ 54 gdbserver_tests ${TOOLS} ${EXP_TOOLS} \
44 2>&1|tee -a ${LOG} 55 2>&1|tee -a ${LOG}
45 56
57echo "Restore non-deterministic tests"
58for i in `cat taskset_nondeterministic_tests`; do
59 if test -f "${i}.vgtest.IGNORE"; then
60 mv $i.IGNORE $i.vgtest;
61 fi
62done
63
46if [ "$arch" = "aarch64" ]; then 64if [ "$arch" = "aarch64" ]; then
47 echo "Aarch64: Restore valgrind tests that result in defunct process and then out of memory" 65 echo "Aarch64: Restore valgrind tests that result in defunct process and then out of memory"
48 for i in `cat remove-for-aarch64`; do 66 for i in `cat remove-for-aarch64`; do
@@ -55,6 +73,16 @@ for i in `cat remove-for-all`; do
55 mv $i.IGNORE $i.vgtest; 73 mv $i.IGNORE $i.vgtest;
56done 74done
57 75
76echo "Failed test details..."
77failed_tests=`grep FAIL: ${LOG} | awk '{print $2}'`
78for test in $failed_tests; do
79 for diff_results in `ls $test*.diff`; do
80 echo $diff_results
81 echo '************'
82 cat $diff_results
83 done
84done
85
58passed=`grep PASS: ${LOG}|wc -l` 86passed=`grep PASS: ${LOG}|wc -l`
59failed=`grep FAIL: ${LOG}|wc -l` 87failed=`grep FAIL: ${LOG}|wc -l`
60skipped=`grep SKIP: ${LOG}|wc -l` 88skipped=`grep SKIP: ${LOG}|wc -l`
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 @@
1From 8154d38bac5cdb3675cfdaf562ab9da01988b263 Mon Sep 17 00:00:00 2001
2From: Yi Fan Yu <yifan.yu@windriver.com>
3Date: Wed, 17 Mar 2021 12:16:31 -0400
4Subject: [PATCH 19/20] remove s390x_vec_op_t
5
1s390x_vec_op_t is not needed anywhere, only elements of enum are accessed 6s390x_vec_op_t is not needed anywhere, only elements of enum are accessed
2removing it ensures that valgrind can be built with -fno-common option 7removing it ensures that valgrind can be built with -fno-common option
3 8
@@ -6,14 +11,25 @@ ld: ../../VEX/libvex-amd64-linux.a(libvex_amd64_linux_a-guest_s390_helpers.o):/u
6 11
7Upstream-Status: Pending 12Upstream-Status: Pending
8Signed-off-by: Khem Raj <raj.khem@gmail.com> 13Signed-off-by: Khem Raj <raj.khem@gmail.com>
14
15Signed-off-by: Yi Fan Yu <yifan.yu@windriver.com>
16---
17 VEX/priv/guest_s390_defs.h | 2 +-
18 1 file changed, 1 insertion(+), 1 deletion(-)
19
20diff --git a/VEX/priv/guest_s390_defs.h b/VEX/priv/guest_s390_defs.h
21index 9054290..dab8002 100644
9--- a/VEX/priv/guest_s390_defs.h 22--- a/VEX/priv/guest_s390_defs.h
10+++ b/VEX/priv/guest_s390_defs.h 23+++ b/VEX/priv/guest_s390_defs.h
11@@ -286,7 +286,7 @@ enum { 24@@ -284,7 +284,7 @@ typedef enum {
12 S390_VEC_OP_VFCHE = 18, 25 S390_VEC_OP_VBPERM,
13 S390_VEC_OP_VFTCI = 19, 26 S390_VEC_OP_VMSL,
14 S390_VEC_OP_LAST = 20 // supposed to be the last element in enum 27 S390_VEC_OP_LAST // supposed to be the last element in enum
15-} s390x_vec_op_t; 28-} s390x_vec_op_t;
16+}; 29+};
17 30
18 /* Arguments of s390x_dirtyhelper_vec_op(...) which are packed into one 31 /* Arguments of s390x_dirtyhelper_vec_op(...) which are packed into one
19 ULong variable. 32 ULong variable.
33--
342.29.2
35
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 @@
1helgrind/tests/hg05_race2
2helgrind/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).
15 15
16See similar cases in none/tests/arm/Makefile.am 16See similar cases in none/tests/arm/Makefile.am
17 17
18Upstream-Status: Pending 18Upstream-Status: Submitted [https://bugs.kde.org/show_bug.cgi?id=454346]
19 19
20Signed-off-by: Andre McCurdy <armccurdy@gmail.com> 20Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
21--- 21---
diff --git a/meta/recipes-devtools/valgrind/valgrind_3.16.1.bb b/meta/recipes-devtools/valgrind/valgrind_3.22.0.bb
index d0aefdf39a..563d99f0e2 100644
--- a/meta/recipes-devtools/valgrind/valgrind_3.16.1.bb
+++ b/meta/recipes-devtools/valgrind/valgrind_3.22.0.bb
@@ -2,7 +2,7 @@ SUMMARY = "Valgrind memory debugger and instrumentation framework"
2HOMEPAGE = "http://valgrind.org/" 2HOMEPAGE = "http://valgrind.org/"
3DESCRIPTION = "Valgrind is an instrumentation framework for building dynamic analysis tools. There are Valgrind tools that can automatically detect many memory management and threading bugs, and profile your programs in detail." 3DESCRIPTION = "Valgrind is an instrumentation framework for building dynamic analysis tools. There are Valgrind tools that can automatically detect many memory management and threading bugs, and profile your programs in detail."
4BUGTRACKER = "http://valgrind.org/support/bug_reports.html" 4BUGTRACKER = "http://valgrind.org/support/bug_reports.html"
5LICENSE = "GPLv2 & GPLv2+ & BSD" 5LICENSE = "GPL-2.0-only & GPL-2.0-or-later & BSD-3-Clause"
6LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ 6LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
7 file://include/pub_tool_basics.h;beginline=6;endline=29;md5=41c410e8d3f305aee7aaa666b2e4f366 \ 7 file://include/pub_tool_basics.h;beginline=6;endline=29;md5=41c410e8d3f305aee7aaa666b2e4f366 \
8 file://include/valgrind.h;beginline=1;endline=56;md5=ad3b317f3286b6b704575d9efe6ca5df \ 8 file://include/valgrind.h;beginline=1;endline=56;md5=ad3b317f3286b6b704575d9efe6ca5df \
@@ -18,44 +18,34 @@ SRC_URI = "https://sourceware.org/pub/valgrind/valgrind-${PV}.tar.bz2 \
18 file://run-ptest \ 18 file://run-ptest \
19 file://remove-for-aarch64 \ 19 file://remove-for-aarch64 \
20 file://remove-for-all \ 20 file://remove-for-all \
21 file://0004-Fix-out-of-tree-builds.patch \ 21 file://taskset_nondeterministic_tests \
22 file://0005-Modify-vg_test-wrapper-to-support-PTEST-formats.patch \ 22 file://0005-Modify-vg_test-wrapper-to-support-PTEST-formats.patch \
23 file://0001-Remove-tests-that-fail-to-build-on-some-PPC32-config.patch \
24 file://use-appropriate-march-mcpu-mfpu-for-ARM-test-apps.patch \ 23 file://use-appropriate-march-mcpu-mfpu-for-ARM-test-apps.patch \
25 file://avoid-neon-for-targets-which-don-t-support-it.patch \ 24 file://avoid-neon-for-targets-which-don-t-support-it.patch \
26 file://valgrind-make-ld-XXX.so-strlen-intercept-optional.patch \ 25 file://valgrind-make-ld-XXX.so-strlen-intercept-optional.patch \
27 file://0001-makefiles-Drop-setting-mcpu-to-cortex-a8-on-arm-arch.patch \ 26 file://0001-makefiles-Drop-setting-mcpu-to-cortex-a8-on-arm-arch.patch \
28 file://0001-str_tester.c-Limit-rawmemchr-test-to-glibc.patch \
29 file://0001-sigqueue-Rename-_sifields-to-__si_fields-on-musl.patch \ 27 file://0001-sigqueue-Rename-_sifields-to-__si_fields-on-musl.patch \
30 file://0002-context-APIs-are-not-available-on-musl.patch \
31 file://0003-correct-include-directive-path-for-config.h.patch \ 28 file://0003-correct-include-directive-path-for-config.h.patch \
32 file://0005-tc20_verifywrap.c-Fake-__GLIBC_PREREQ-with-musl.patch \
33 file://0001-memcheck-arm64-Define-__THROW-if-not-already-defined.patch \
34 file://0002-memcheck-x86-Define-__THROW-if-not-defined.patch \
35 file://0003-tests-seg_override-Replace-__modify_ldt-with-syscall.patch \
36 file://0001-fix-opcode-not-supported-on-mips32-linux.patch \
37 file://0001-Guard-against-__GLIBC_PREREQ-for-musl-libc.patch \
38 file://0001-Make-local-functions-static-to-avoid-assembler-error.patch \
39 file://0001-Return-a-valid-exit_code-from-vg_regtest.patch \ 29 file://0001-Return-a-valid-exit_code-from-vg_regtest.patch \
40 file://0001-valgrind-filter_xml_frames-do-not-filter-usr.patch \ 30 file://0001-valgrind-filter_xml_frames-do-not-filter-usr.patch \
41 file://0001-memcheck-vgtests-remove-fullpath-after-flags.patch \ 31 file://0001-memcheck-vgtests-remove-fullpath-after-flags.patch \
42 file://s390x_vec_op_t.patch \ 32 file://s390x_vec_op_t.patch \
43 file://0001-none-tests-fdleak_cmsg.stderr.exp-adjust-tmp-paths.patch \ 33 file://0001-none-tests-fdleak_cmsg.stderr.exp-adjust-tmp-paths.patch \
44 file://0001-memcheck-tests-Fix-timerfd-syscall-test.patch \ 34 file://0001-memcheck-tests-Fix-timerfd-syscall-test.patch \
45 file://0001-drd-Port-to-Fedora-33.patch \ 35 file://0001-docs-Disable-manual-validation.patch \
46 file://0001-drd-musl-fix.patch \ 36 file://0001-valgrind-monitor.py-regular-expressions-should-use-r.patch \
47 file://0001-helgrind-Intercept-libc-functions.patch \ 37 file://0002-Bug-476548-valgrind-3.22.0-fails-on-assertion-when-l.patch \
48 file://0001-gdbserver_tests-Disable-nlcontrolc.vgtest-for-x86-64.patch \ 38 file://0003-Add-fchmodat2-syscall-on-linux.patch \
39 file://0004-Bug-478624-Valgrind-incompatibility-with-binutils-2..patch \
49 " 40 "
50SRC_URI[md5sum] = "d1b153f1ab17cf1f311705e7a83ef589" 41SRC_URI[sha256sum] = "c811db5add2c5f729944caf47c4e7a65dcaabb9461e472b578765dd7bf6d2d4c"
51SRC_URI[sha256sum] = "c91f3a2f7b02db0f3bc99479861656154d241d2fdb265614ba918cc6720a33ca"
52UPSTREAM_CHECK_REGEX = "valgrind-(?P<pver>\d+(\.\d+)+)\.tar" 42UPSTREAM_CHECK_REGEX = "valgrind-(?P<pver>\d+(\.\d+)+)\.tar"
53 43
54COMPATIBLE_HOST = '(i.86|x86_64|arm|aarch64|mips|powerpc|powerpc64).*-linux' 44COMPATIBLE_HOST = '(i.86|x86_64|arm|aarch64|mips|powerpc|powerpc64).*-linux'
55 45
56# patch 0001-memcheck-vgtests-remove-fullpath-after-flags.patch removes relative path 46# patch 0001-memcheck-vgtests-remove-fullpath-after-flags.patch removes relative path
57# argument. Change expected stderr files accordingly. 47# argument. Change expected stderr files accordingly.
58do_patch_append() { 48do_patch:append() {
59 bb.build.exec_func('do_sed_paths', d) 49 bb.build.exec_func('do_sed_paths', d)
60} 50}
61 51
@@ -65,23 +55,23 @@ do_sed_paths() {
65} 55}
66 56
67# valgrind supports armv7 and above 57# valgrind supports armv7 and above
68COMPATIBLE_HOST_armv4 = 'null' 58COMPATIBLE_HOST:armv4 = 'null'
69COMPATIBLE_HOST_armv5 = 'null' 59COMPATIBLE_HOST:armv5 = 'null'
70COMPATIBLE_HOST_armv6 = 'null' 60COMPATIBLE_HOST:armv6 = 'null'
71 61
72# valgrind fails with powerpc soft-float 62# valgrind fails with powerpc soft-float
73COMPATIBLE_HOST_powerpc = "${@bb.utils.contains('TARGET_FPU', 'soft', 'null', '.*-linux', d)}" 63COMPATIBLE_HOST:powerpc = "${@bb.utils.contains('TARGET_FPU', 'soft', 'null', '.*-linux', d)}"
74 64
75# X32 isn't supported by valgrind at this time 65# X32 isn't supported by valgrind at this time
76COMPATIBLE_HOST_linux-gnux32 = 'null' 66COMPATIBLE_HOST:linux-gnux32 = 'null'
77COMPATIBLE_HOST_linux-muslx32 = 'null' 67COMPATIBLE_HOST:linux-muslx32 = 'null'
78 68
79# Disable for some MIPS variants 69# Disable for some MIPS variants
80COMPATIBLE_HOST_mipsarchr6 = 'null' 70COMPATIBLE_HOST:mipsarchr6 = 'null'
81COMPATIBLE_HOST_linux-gnun32 = 'null' 71COMPATIBLE_HOST:linux-gnun32 = 'null'
82 72
83# Disable for powerpc64 with musl 73# Disable for powerpc64 with musl
84COMPATIBLE_HOST_libc-musl_powerpc64 = 'null' 74COMPATIBLE_HOST:libc-musl:powerpc64 = 'null'
85 75
86# brokenseip is unfortunately required by ptests to pass 76# brokenseip is unfortunately required by ptests to pass
87inherit autotools-brokensep ptest multilib_header 77inherit autotools-brokensep ptest multilib_header
@@ -90,7 +80,7 @@ EXTRA_OECONF = "--enable-tls --without-mpicc"
90EXTRA_OECONF += "${@['--enable-only32bit','--enable-only64bit'][d.getVar('SITEINFO_BITS') != '32']}" 80EXTRA_OECONF += "${@['--enable-only32bit','--enable-only64bit'][d.getVar('SITEINFO_BITS') != '32']}"
91 81
92# valgrind checks host_cpu "armv7*)", so we need to over-ride the autotools.bbclass default --host option 82# valgrind checks host_cpu "armv7*)", so we need to over-ride the autotools.bbclass default --host option
93EXTRA_OECONF_append_arm = " --host=armv7${HOST_VENDOR}-${HOST_OS}" 83EXTRA_OECONF:append:arm = " --host=armv7${HOST_VENDOR}-${HOST_OS}"
94 84
95EXTRA_OEMAKE = "-w" 85EXTRA_OEMAKE = "-w"
96 86
@@ -102,53 +92,73 @@ CACHED_CONFIGUREVARS += "ac_cv_path_PERL='/usr/bin/env perl'"
102# which fixes build path issue in DWARF. 92# which fixes build path issue in DWARF.
103SELECTED_OPTIMIZATION = "${DEBUG_FLAGS}" 93SELECTED_OPTIMIZATION = "${DEBUG_FLAGS}"
104 94
105do_configure_prepend () { 95# Split out various helper scripts to separate packages to avoid the
96# main package depending on perl and python.
97PACKAGES =+ "${PN}-cachegrind ${PN}-massif ${PN}-callgrind"
98
99FILES:${PN}-cachegrind = "${bindir}/cg_*"
100FILES:${PN}-massif = "${bindir}/ms_*"
101FILES:${PN}-callgrind = "${bindir}/callgrind_*"
102
103RDEPENDS:${PN}-cachegrind = "${PN} python3-core"
104RDEPENDS:${PN}-massif = "${PN} perl"
105RDEPENDS:${PN}-callgrind = "${PN} perl"
106
107do_configure:prepend () {
106 rm -rf ${S}/config.h 108 rm -rf ${S}/config.h
107 sed -i -e 's:$(abs_top_builddir):$(pkglibdir)/ptest:g' ${S}/none/tests/Makefile.am 109 sed -i -e 's:$(abs_top_builddir):$(pkglibdir)/ptest:g' ${S}/none/tests/Makefile.am
108 sed -i -e 's:$(top_builddir):$(pkglibdir)/ptest:g' ${S}/memcheck/tests/Makefile.am 110 sed -i -e 's:$(top_builddir):$(pkglibdir)/ptest:g' ${S}/memcheck/tests/Makefile.am
109} 111}
110 112
111do_install_append () { 113do_install:append () {
112 install -m 644 ${B}/default.supp ${D}/${libdir}/valgrind/ 114 install -m 644 ${B}/default.supp ${D}/${libexecdir}/valgrind/
113 oe_multilib_header valgrind/config.h 115 oe_multilib_header valgrind/config.h
114} 116}
115 117
116VALGRINDARCH ?= "${TARGET_ARCH}" 118VALGRINDARCH ?= "${TARGET_ARCH}"
117VALGRINDARCH_aarch64 = "arm64" 119VALGRINDARCH:aarch64 = "arm64"
118VALGRINDARCH_x86-64 = "amd64" 120VALGRINDARCH:x86-64 = "amd64"
119VALGRINDARCH_x86 = "x86" 121VALGRINDARCH:x86 = "x86"
120VALGRINDARCH_mips = "mips32" 122VALGRINDARCH:mips = "mips32"
121VALGRINDARCH_mipsel = "mips32" 123VALGRINDARCH:mipsel = "mips32"
122VALGRINDARCH_mips64el = "mips64" 124VALGRINDARCH:mips64el = "mips64"
123VALGRINDARCH_powerpc = "ppc" 125VALGRINDARCH:powerpc = "ppc"
124VALGRINDARCH_powerpc64 = "ppc64" 126VALGRINDARCH:powerpc64 = "ppc64"
125VALGRINDARCH_powerpc64el = "ppc64le" 127VALGRINDARCH:powerpc64le = "ppc64le"
126 128
127INHIBIT_PACKAGE_STRIP_FILES = "${PKGD}${libdir}/valgrind/vgpreload_memcheck-${VALGRINDARCH}-linux.so" 129INHIBIT_PACKAGE_STRIP_FILES = "${PKGD}${libexecdir}/valgrind/vgpreload_memcheck-${VALGRINDARCH}-linux.so"
128
129RDEPENDS_${PN} += "perl"
130 130
131# valgrind needs debug information for ld.so at runtime in order to 131# valgrind needs debug information for ld.so at runtime in order to
132# redirect functions like strlen. 132# redirect functions like strlen.
133RRECOMMENDS_${PN} += "${TCLIBC}-dbg" 133RRECOMMENDS:${PN} += "${TCLIBC}-dbg"
134 134
135RDEPENDS_${PN}-ptest += " bash coreutils file \ 135RDEPENDS:${PN}-ptest += " bash coreutils curl file \
136 gdb libgomp \ 136 gdb \
137 ${TCLIBC}-src gcc-runtime-dbg \
138 libgomp \
137 perl \ 139 perl \
138 perl-module-file-basename perl-module-file-glob perl-module-getopt-long \ 140 perl-module-file-basename perl-module-file-glob perl-module-getopt-long \
139 perl-module-overloading \ 141 perl-module-overloading perl-module-cwd perl-module-ipc-open3 \
140 procps sed ${PN}-dbg ${PN}-src" 142 perl-module-carp perl-module-symbol \
141RDEPENDS_${PN}-ptest_append_libc-glibc = " glibc-utils" 143 procps \
144 python3-compile \
145 sed \
146 util-linux-taskset \
147 ${PN}-dbg ${PN}-src \
148 ${PN}-cachegrind ${PN}-massif ${PN}-callgrind \
149"
150RDEPENDS:${PN}-ptest:append:libc-glibc = " glibc-utils glibc-gconv-utf-32"
142 151
143# One of the tests contains a bogus interpreter path on purpose. 152# One of the tests contains a bogus interpreter path on purpose.
144# Skip file dependency check 153# Skip file dependency check
145SKIP_FILEDEPS_${PN}-ptest = '1' 154SKIP_FILEDEPS:${PN}-ptest = '1'
146INSANE_SKIP_${PN}-ptest = "debug-deps" 155INSANE_SKIP:${PN}-ptest = "debug-deps"
147 156
148do_compile_ptest() { 157do_compile_ptest() {
149 oe_runmake check 158 oe_runmake check
150} 159}
151 160
161
152do_install_ptest() { 162do_install_ptest() {
153 chmod +x ${B}/tests/vg_regtest 163 chmod +x ${B}/tests/vg_regtest
154 164
@@ -157,7 +167,7 @@ do_install_ptest() {
157 # 167 #
158 # The regression tests require scripts and data files that are not 168 # The regression tests require scripts and data files that are not
159 # copied to the build directory. They must be copied from the 169 # copied to the build directory. They must be copied from the
160 # source directory. 170 # source directory.
161 saved_dir=$PWD 171 saved_dir=$PWD
162 for parent_dir in ${S} ${B} ; do 172 for parent_dir in ${S} ${B} ; do
163 cd $parent_dir 173 cd $parent_dir
@@ -188,6 +198,7 @@ do_install_ptest() {
188 cp ${B}/config.h ${D}${PTEST_PATH} 198 cp ${B}/config.h ${D}${PTEST_PATH}
189 install -D ${WORKDIR}/remove-for-aarch64 ${D}${PTEST_PATH} 199 install -D ${WORKDIR}/remove-for-aarch64 ${D}${PTEST_PATH}
190 install -D ${WORKDIR}/remove-for-all ${D}${PTEST_PATH} 200 install -D ${WORKDIR}/remove-for-all ${D}${PTEST_PATH}
201 install -D ${WORKDIR}/taskset_nondeterministic_tests ${D}${PTEST_PATH}
191 202
192 # Add an executable need by none/tests/bigcode 203 # Add an executable need by none/tests/bigcode
193 mkdir ${D}${PTEST_PATH}/perf 204 mkdir ${D}${PTEST_PATH}/perf
@@ -211,33 +222,51 @@ do_install_ptest() {
211 \) \ 222 \) \
212 -exec rm {} \; 223 -exec rm {} \;
213 224
214 # These files need to be newer so touch them.
215 touch ${D}${PTEST_PATH}/cachegrind/tests/a.c -r ${D}${PTEST_PATH}/cachegrind/tests/cgout-test
216
217 # find *_annotate in ${bindir} for yocto build
218 sed -i s:\.\./\.\./cachegrind/cg_annotate:${bindir}/cg_annotate: ${D}${PTEST_PATH}/cachegrind/tests/ann1.vgtest
219 sed -i s:\.\./\.\./cachegrind/cg_annotate:${bindir}/cg_annotate: ${D}${PTEST_PATH}/cachegrind/tests/ann2.vgtest
220
221 sed -i s:\.\./\.\./callgrind/callgrind_annotate:${bindir}/callgrind_annotate: ${D}${PTEST_PATH}/callgrind/tests/ann1.vgtest 225 sed -i s:\.\./\.\./callgrind/callgrind_annotate:${bindir}/callgrind_annotate: ${D}${PTEST_PATH}/callgrind/tests/ann1.vgtest
222 sed -i s:\.\./\.\./callgrind/callgrind_annotate:${bindir}/callgrind_annotate: ${D}${PTEST_PATH}/callgrind/tests/ann2.vgtest 226 sed -i s:\.\./\.\./callgrind/callgrind_annotate:${bindir}/callgrind_annotate: ${D}${PTEST_PATH}/callgrind/tests/ann2.vgtest
223 227
228 # point the expanded @abs_top_builddir@ of the host to PTEST_PATH
229 sed -i s:${S}:${PTEST_PATH}:g \
230 ${D}${PTEST_PATH}/memcheck/tests/linux/debuginfod-check.vgtest
231
224 # handle multilib 232 # handle multilib
225 sed -i s:@libdir@:${libdir}:g ${D}${PTEST_PATH}/run-ptest 233 sed -i s:@libdir@:${libdir}:g ${D}${PTEST_PATH}/run-ptest
234 sed -i s:@libexecdir@:${libexecdir}:g ${D}${PTEST_PATH}/run-ptest
226 sed -i s:@bindir@:${bindir}:g ${D}${PTEST_PATH}/run-ptest 235 sed -i s:@bindir@:${bindir}:g ${D}${PTEST_PATH}/run-ptest
227 236
237 # enable cachegrind ptests
238 ln -s ${bindir}/cg_annotate ${D}/${PTEST_PATH}/cachegrind/cg_annotate
239 ln -s ${bindir}/cg_diff ${D}/${PTEST_PATH}/cachegrind/cg_diff
240 ln -s ${bindir}/cg_merge ${D}/${PTEST_PATH}/cachegrind/cg_merge
241
228 # This test fails on the host as well, using both 3.15 and git master (as of Jan 24 2020) 242 # This test fails on the host as well, using both 3.15 and git master (as of Jan 24 2020)
229 # https://bugs.kde.org/show_bug.cgi?id=402833 243 # https://bugs.kde.org/show_bug.cgi?id=402833
230 rm ${D}${PTEST_PATH}/memcheck/tests/overlap.vgtest 244 rm ${D}${PTEST_PATH}/memcheck/tests/overlap.vgtest
231 245
246 # This is known failure see https://bugs.kde.org/show_bug.cgi?id=435732
247 rm ${D}${PTEST_PATH}/memcheck/tests/leak_cpp_interior.vgtest
248
249 # https://bugs.kde.org/show_bug.cgi?id=445743
250 rm ${D}${PTEST_PATH}/drd/tests/pth_mutex_signal
251
232 # As the binary isn't stripped or debug-splitted, the source file isn't fetched 252 # As the binary isn't stripped or debug-splitted, the source file isn't fetched
233 # via dwarfsrcfiles either, so it needs to be installed manually. 253 # via dwarfsrcfiles either, so it needs to be installed manually.
234 mkdir -p ${D}/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}/${BP}/none/tests/ 254 mkdir -p ${D}${TARGET_DBGSRC_DIR}/none/tests/
235 install ${S}/none/tests/tls.c ${D}/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}/${BP}/none/tests/ 255 install ${S}/none/tests/tls.c ${D}${TARGET_DBGSRC_DIR}/none/tests/
256}
257
258do_install_ptest:append:x86-64 () {
259 # https://bugs.kde.org/show_bug.cgi?id=463456
260 rm ${D}${PTEST_PATH}/memcheck/tests/origin6-fp.vgtest
261 # https://bugs.kde.org/show_bug.cgi?id=463458
262 rm ${D}${PTEST_PATH}/memcheck/tests/vcpu_fnfns.vgtest
263 # https://bugs.kde.org/show_bug.cgi?id=463463
264 rm ${D}${PTEST_PATH}/none/tests/amd64/fma.vgtest
236} 265}
237 266
238# avoid stripping some generated binaries otherwise some of the tests will fail 267# avoid stripping some generated binaries otherwise some of the tests will fail
239# run-strip-reloc.sh, run-strip-strmerge.sh and so on will fail 268# run-strip-reloc.sh, run-strip-strmerge.sh and so on will fail
240INHIBIT_PACKAGE_STRIP_FILES = "\ 269INHIBIT_PACKAGE_STRIP_FILES += "\
241 ${PKGD}${PTEST_PATH}/none/tests/tls \ 270 ${PKGD}${PTEST_PATH}/none/tests/tls \
242 ${PKGD}${PTEST_PATH}/none/tests/tls.so \ 271 ${PKGD}${PTEST_PATH}/none/tests/tls.so \
243 ${PKGD}${PTEST_PATH}/none/tests/tls2.so \ 272 ${PKGD}${PTEST_PATH}/none/tests/tls2.so \