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-Return-a-valid-exit_code-from-vg_regtest.patch27
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/0001-Use-portable-syntax-for-pushsection-directive-in-inl.patch31
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/0001-configure-Drop-setting-mcpu-cortex-a8-on-arm.patch37
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/0001-docs-Disable-manual-validation.patch11
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/0001-makefiles-Drop-setting-mcpu-to-cortex-a8-on-arm-arch.patch45
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/0001-memcheck-tests-Fix-timerfd-syscall-test.patch32
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/0001-memcheck-vgtests-remove-fullpath-after-flags.patch9
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/0001-none-tests-fdleak_cmsg.stderr.exp-adjust-tmp-paths.patch9
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/0001-sigqueue-Rename-_sifields-to-__si_fields-on-musl.patch9
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/0001-tests-arm-Use-O-instead-of-O0.patch36
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/0001-valgrind-filter_xml_frames-do-not-filter-usr.patch9
-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/0003-Add-fchmodat2-syscall-on-linux.patch221
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/0003-correct-include-directive-path-for-config.h.patch9
-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/0005-Modify-vg_test-wrapper-to-support-PTEST-formats.patch257
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/Added-support-for-PPC-instructions-mfatbu-mfatbl.patch25
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/avoid-neon-for-targets-which-don-t-support-it.patch7
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/fixed-perl-path.patch5
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/remove-for-aarch6432
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/remove-for-all29
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/s390x_vec_op_t.patch15
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/use-appropriate-march-mcpu-mfpu-for-ARM-test-apps.patch9
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/valgrind-make-ld-XXX.so-strlen-intercept-optional.patch9
-rw-r--r--meta/recipes-devtools/valgrind/valgrind_3.22.0.bb276
-rw-r--r--meta/recipes-devtools/valgrind/valgrind_3.25.1.bb116
27 files changed, 296 insertions, 1317 deletions
diff --git a/meta/recipes-devtools/valgrind/valgrind/0001-Return-a-valid-exit_code-from-vg_regtest.patch b/meta/recipes-devtools/valgrind/valgrind/0001-Return-a-valid-exit_code-from-vg_regtest.patch
deleted file mode 100644
index e7af5efecc..0000000000
--- a/meta/recipes-devtools/valgrind/valgrind/0001-Return-a-valid-exit_code-from-vg_regtest.patch
+++ /dev/null
@@ -1,27 +0,0 @@
1From 5eebdefd2251803e7d21081745018fcb16b2ba71 Mon Sep 17 00:00:00 2001
2From: Randy MacLeod <Randy.MacLeod@windriver.com>
3Date: Wed, 8 May 2019 20:16:52 -0400
4Subject: [PATCH] Return a valid exit_code from vg_regtest
5
6Upstream-Status: Pending
7
8Signed-off-by: Randy MacLeod <Randy.MacLeod@windriver.com>
9---
10 tests/vg_regtest.in | 1 +
11 1 file changed, 1 insertion(+)
12
13diff --git a/tests/vg_regtest.in b/tests/vg_regtest.in
14index 909af3be8..f2799c4e3 100755
15--- a/tests/vg_regtest.in
16+++ b/tests/vg_regtest.in
17@@ -403,6 +403,7 @@ sub mysystem($)
18 exit 1;
19 }
20 }
21+ return $exit_code;
22 }
23 # if $keepunfiltered, copies $1 to $1.unfiltered.out
24 # renames $0 tp $1
25--
262.17.0
27
diff --git a/meta/recipes-devtools/valgrind/valgrind/0001-Use-portable-syntax-for-pushsection-directive-in-inl.patch b/meta/recipes-devtools/valgrind/valgrind/0001-Use-portable-syntax-for-pushsection-directive-in-inl.patch
new file mode 100644
index 0000000000..b59c544223
--- /dev/null
+++ b/meta/recipes-devtools/valgrind/valgrind/0001-Use-portable-syntax-for-pushsection-directive-in-inl.patch
@@ -0,0 +1,31 @@
1From 2089383a0e3a50f527337ea05188b3e302069888 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 14 May 2025 09:29:33 -0700
4Subject: [PATCH] Use portable syntax for pushsection directive in inline
5 assembly
6
7'@' does not work with clang inline assembler, but '%' works with both
8gcc and clang. Therefore use '%' to make it more portable
9
10Fixes
11<inline asm>:1:41: error: expected '%<type>' or "<type>"
12
13Upstream-Status: Submitted [https://bugs.kde.org/show_bug.cgi?id=504222]
14Signed-off-by: Khem Raj <raj.khem@gmail.com>
15---
16 coregrind/vg_preloaded.c | 2 +-
17 1 file changed, 1 insertion(+), 1 deletion(-)
18
19diff --git a/coregrind/vg_preloaded.c b/coregrind/vg_preloaded.c
20index 5bec51d..e4c2dbc 100644
21--- a/coregrind/vg_preloaded.c
22+++ b/coregrind/vg_preloaded.c
23@@ -55,7 +55,7 @@
24 /* Note: The "MS" section flags are to remove duplicates. */
25 #define DEFINE_GDB_PY_SCRIPT(script_name) \
26 asm("\
27-.pushsection \".debug_gdb_scripts\", \"MS\",@progbits,1\n\
28+.pushsection \".debug_gdb_scripts\", \"MS\",%progbits,1\n\
29 .byte 1 /* Python */\n\
30 .asciz \"" script_name "\"\n\
31 .popsection \n\
diff --git a/meta/recipes-devtools/valgrind/valgrind/0001-configure-Drop-setting-mcpu-cortex-a8-on-arm.patch b/meta/recipes-devtools/valgrind/valgrind/0001-configure-Drop-setting-mcpu-cortex-a8-on-arm.patch
new file mode 100644
index 0000000000..3c8bec82b3
--- /dev/null
+++ b/meta/recipes-devtools/valgrind/valgrind/0001-configure-Drop-setting-mcpu-cortex-a8-on-arm.patch
@@ -0,0 +1,37 @@
1From 5a776e61af5ab7f0cfd10cde55c796189686916f Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 10 May 2024 16:27:34 -0700
4Subject: [PATCH] configure: Drop setting mcpu=cortex-a8 on arm
5
6The -march settings from environment expresses the flags
7appropriately, moreover, this conflicts when using armhf
8without neon [1]
9
10[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=928224
11
12Upstream-Status: Submitted [https://bugs.kde.org/show_bug.cgi?id=454346]
13Signed-off-by: Khem Raj <raj.khem@gmail.com>
14---
15 configure.ac | 4 ++--
16 1 file changed, 2 insertions(+), 2 deletions(-)
17
18diff --git a/configure.ac b/configure.ac
19index 2dfbd1c..b42fdd4 100755
20--- a/configure.ac
21+++ b/configure.ac
22@@ -251,13 +251,13 @@ case "${host_cpu}" in
23
24 armv8*)
25 AC_MSG_RESULT([ok (${host_cpu})])
26- VGCONF_PLATFORM_ARM_ARCH="-marm -mcpu=cortex-a8"
27+ VGCONF_PLATFORM_ARM_ARCH="-marm"
28 ARCH_MAX="arm"
29 ;;
30
31 armv7*)
32 AC_MSG_RESULT([ok (${host_cpu})])
33- VGCONF_PLATFORM_ARM_ARCH="-marm -mcpu=cortex-a8"
34+ VGCONF_PLATFORM_ARM_ARCH="-marm"
35 ARCH_MAX="arm"
36 ;;
37
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
index 256ddb0c34..fbd799eeea 100644
--- a/meta/recipes-devtools/valgrind/valgrind/0001-docs-Disable-manual-validation.patch
+++ b/meta/recipes-devtools/valgrind/valgrind/0001-docs-Disable-manual-validation.patch
@@ -1,4 +1,4 @@
1From 99fc6fe9b66becac3c94068129e84217330a71a6 Mon Sep 17 00:00:00 2001 1From 4f674f458b1f0675abdc0ced01239e99bfa40de8 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 13 Jan 2022 18:26:02 -0800 3Date: Thu, 13 Jan 2022 18:26:02 -0800
4Subject: [PATCH] docs: Disable manual validation 4Subject: [PATCH] docs: Disable manual validation
@@ -19,11 +19,11 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
19 1 file changed, 1 insertion(+), 1 deletion(-) 19 1 file changed, 1 insertion(+), 1 deletion(-)
20 20
21diff --git a/docs/Makefile.am b/docs/Makefile.am 21diff --git a/docs/Makefile.am b/docs/Makefile.am
22index d4250e8..c500306 100644 22index 68a3da5..9833d5c 100644
23--- a/docs/Makefile.am 23--- a/docs/Makefile.am
24+++ b/docs/Makefile.am 24+++ b/docs/Makefile.am
25@@ -192,7 +192,7 @@ valid-manpages: $(MANPAGES_XML_FILES) 25@@ -202,7 +202,7 @@ valid-manpages: $(MANPAGES_XML_FILES)
26 touch $@; \ 26 fi \
27 fi 27 fi
28 28
29-check-local: valid-manual valid-manpages 29-check-local: valid-manual valid-manpages
@@ -31,6 +31,3 @@ index d4250e8..c500306 100644
31 31
32 # The text version of the FAQ. 32 # The text version of the FAQ.
33 FAQ.txt: 33 FAQ.txt:
34--
352.34.1
36
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 073713c139..f8d1e87ba9 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
@@ -1,4 +1,4 @@
1From 715cf122388f3527afa5649cebf9f1522c240693 Mon Sep 17 00:00:00 2001 1From c878aaacadf8ec723be882f9335cb33240df13d6 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 20 Apr 2017 10:11:16 -0700 3Date: Thu, 20 Apr 2017 10:11:16 -0700
4Subject: [PATCH] makefiles: Drop setting -mcpu to cortex-a8 on arm 4Subject: [PATCH] makefiles: Drop setting -mcpu to cortex-a8 on arm
@@ -14,35 +14,15 @@ Upstream-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---
17 Makefile.all.am | 6 +++---
18 helgrind/tests/Makefile.am | 6 +++--- 17 helgrind/tests/Makefile.am | 6 +++---
19 none/tests/arm/Makefile.am | 18 +++++++++--------- 18 none/tests/arm/Makefile.am | 18 +++++++++---------
20 3 files changed, 15 insertions(+), 15 deletions(-) 19 2 files changed, 12 insertions(+), 12 deletions(-)
21 20
22diff --git a/Makefile.all.am b/Makefile.all.am
23index 02059a3..c7c4700 100644
24--- a/Makefile.all.am
25+++ b/Makefile.all.am
26@@ -197,11 +197,11 @@ AM_CCASFLAGS_PPC64LE_LINUX = @FLAG_M64@ -g
27
28 AM_FLAG_M3264_ARM_LINUX = @FLAG_M32@
29 AM_CFLAGS_ARM_LINUX = @FLAG_M32@ \
30- $(AM_CFLAGS_BASE) -marm -mcpu=cortex-a8
31+ $(AM_CFLAGS_BASE) -marm
32 AM_CFLAGS_PSO_ARM_LINUX = @FLAG_M32@ $(AM_CFLAGS_BASE) \
33- -marm -mcpu=cortex-a8 $(AM_CFLAGS_PSO_BASE)
34+ -marm $(AM_CFLAGS_PSO_BASE)
35 AM_CCASFLAGS_ARM_LINUX = @FLAG_M32@ \
36- -marm -mcpu=cortex-a8 -g
37+ -marm -g
38
39 AM_FLAG_M3264_ARM64_LINUX = @FLAG_M64@
40 AM_CFLAGS_ARM64_LINUX = @FLAG_M64@ $(AM_CFLAGS_BASE)
41diff --git a/helgrind/tests/Makefile.am b/helgrind/tests/Makefile.am 21diff --git a/helgrind/tests/Makefile.am b/helgrind/tests/Makefile.am
42index df82169..07eb66a 100644 22index 7adc5c6..cac23c9 100755
43--- a/helgrind/tests/Makefile.am 23--- a/helgrind/tests/Makefile.am
44+++ b/helgrind/tests/Makefile.am 24+++ b/helgrind/tests/Makefile.am
45@@ -189,9 +189,9 @@ if ! VGCONF_PLATFORMS_INCLUDE_X86_DARWIN 25@@ -226,9 +226,9 @@ if ! VGCONF_PLATFORMS_INCLUDE_X86_DARWIN
46 endif 26 endif
47 27
48 if VGCONF_PLATFORMS_INCLUDE_ARM_LINUX 28 if VGCONF_PLATFORMS_INCLUDE_ARM_LINUX
@@ -56,10 +36,10 @@ index df82169..07eb66a 100644
56 annotate_hbefore_CFLAGS = $(AM_CFLAGS) 36 annotate_hbefore_CFLAGS = $(AM_CFLAGS)
57 tc07_hbl1_CFLAGS = $(AM_CFLAGS) 37 tc07_hbl1_CFLAGS = $(AM_CFLAGS)
58diff --git a/none/tests/arm/Makefile.am b/none/tests/arm/Makefile.am 38diff --git a/none/tests/arm/Makefile.am b/none/tests/arm/Makefile.am
59index 024eb6d..ccecb90 100644 39index 41a5a03..a76981e 100644
60--- a/none/tests/arm/Makefile.am 40--- a/none/tests/arm/Makefile.am
61+++ b/none/tests/arm/Makefile.am 41+++ b/none/tests/arm/Makefile.am
62@@ -52,10 +52,10 @@ allexec_CFLAGS = $(AM_CFLAGS) @FLAG_W_NO_NONNULL@ 42@@ -56,10 +56,10 @@ allexec_CFLAGS = $(AM_CFLAGS) @FLAG_W_NO_NONNULL@
63 # need special helping w.r.t -mfpu and -mfloat-abi, though. 43 # need special helping w.r.t -mfpu and -mfloat-abi, though.
64 # Also force -O0 since -O takes hundreds of MB of memory 44 # Also force -O0 since -O takes hundreds of MB of memory
65 # for v6intThumb.c. 45 # for v6intThumb.c.
@@ -71,11 +51,11 @@ index 024eb6d..ccecb90 100644
71-v6media_CFLAGS = $(AM_CFLAGS) -g -O0 -mcpu=cortex-a8 -mthumb 51-v6media_CFLAGS = $(AM_CFLAGS) -g -O0 -mcpu=cortex-a8 -mthumb
72+v6media_CFLAGS = $(AM_CFLAGS) -g -O0 -mthumb 52+v6media_CFLAGS = $(AM_CFLAGS) -g -O0 -mthumb
73 53
74 v8crypto_a_CFLAGS = $(AM_CFLAGS) -g -O0 -mfpu=crypto-neon-fp-armv8 -marm 54 v8crypto_a_CFLAGS = $(AM_CFLAGS) -g -O0 -mfpu=crypto-neon-fp-armv8 -marm -march=armv8-a
75 v8crypto_t_CFLAGS = $(AM_CFLAGS) -g -O0 -mfpu=crypto-neon-fp-armv8 -mthumb 55 v8crypto_t_CFLAGS = $(AM_CFLAGS) -g -O0 -mfpu=crypto-neon-fp-armv8 -mthumb -march=armv8-a
76@@ -65,23 +65,23 @@ v8memory_a_CFLAGS = $(AM_CFLAGS) -g -O0 \ 56@@ -74,23 +74,23 @@ v8memory_t_CFLAGS = $(AM_CFLAGS) -g -O0 \
77 v8memory_t_CFLAGS = $(AM_CFLAGS) -g -O0 \ 57
78 -march=armv8-a -mfpu=crypto-neon-fp-armv8 -mthumb 58 vcvt_fixed_float_VFP_CFLAGS = $(AM_CFLAGS) -g -O0 -mcpu=cortex-a8 -mfpu=neon
79 59
80-vfp_CFLAGS = $(AM_CFLAGS) -g -O0 -mcpu=cortex-a8 \ 60-vfp_CFLAGS = $(AM_CFLAGS) -g -O0 -mcpu=cortex-a8 \
81+vfp_CFLAGS = $(AM_CFLAGS) -g -O0 \ 61+vfp_CFLAGS = $(AM_CFLAGS) -g -O0 \
@@ -103,6 +83,3 @@ index 024eb6d..ccecb90 100644
103+vcvt_fixed_float_VFP_CFLAGS = $(AM_CFLAGS) -g -mfpu=vfpv3 83+vcvt_fixed_float_VFP_CFLAGS = $(AM_CFLAGS) -g -mfpu=vfpv3
104 84
105 vfpv4_fma_CFLAGS = $(AM_CFLAGS) -g -O0 -march=armv7ve -mcpu=cortex-a15 -mfpu=vfpv4 -marm 85 vfpv4_fma_CFLAGS = $(AM_CFLAGS) -g -O0 -march=armv7ve -mcpu=cortex-a15 -mfpu=vfpv4 -marm
106--
1072.12.2
108
diff --git a/meta/recipes-devtools/valgrind/valgrind/0001-memcheck-tests-Fix-timerfd-syscall-test.patch b/meta/recipes-devtools/valgrind/valgrind/0001-memcheck-tests-Fix-timerfd-syscall-test.patch
index 15fbbe954f..200b2602cb 100644
--- a/meta/recipes-devtools/valgrind/valgrind/0001-memcheck-tests-Fix-timerfd-syscall-test.patch
+++ b/meta/recipes-devtools/valgrind/valgrind/0001-memcheck-tests-Fix-timerfd-syscall-test.patch
@@ -1,4 +1,4 @@
1From 5d411fd147d652e9d7bb259f4048693c6e4742aa Mon Sep 17 00:00:00 2001 1From 3a51ed107f67732910dec12279a9279e158afbe7 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 9 Mar 2020 16:30:19 -0700 3Date: Mon, 9 Mar 2020 16:30:19 -0700
4Subject: [PATCH] memcheck/tests: Fix timerfd syscall test 4Subject: [PATCH] memcheck/tests: Fix timerfd syscall test
@@ -10,14 +10,16 @@ have the implementation or syscall is not defined
10Upstream-Status: Submitted [https://sourceforge.net/p/valgrind/mailman/message/36943897/] 10Upstream-Status: Submitted [https://sourceforge.net/p/valgrind/mailman/message/36943897/]
11Signed-off-by: Khem Raj <raj.khem@gmail.com> 11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12--- 12---
13 config.h.in | 9 +++++++++ 13 config.h.in | 3 +++
14 configure.ac | 3 +++ 14 configure.ac | 1 +
15 memcheck/tests/linux/timerfd-syscall.c | 10 ++++++++-- 15 memcheck/tests/linux/timerfd-syscall.c | 14 +++++++++++---
16 5 files changed, 32 insertions(+), 2 deletions(-) 16 3 files changed, 15 insertions(+), 3 deletions(-)
17 17
18diff --git a/config.h.in b/config.h.in
19index 00db1a6..23fd77a 100644
18--- a/config.h.in 20--- a/config.h.in
19+++ b/config.h.in 21+++ b/config.h.in
20@@ -301,6 +301,9 @@ 22@@ -409,6 +409,9 @@
21 /* Define to 1 if you have the <sys/sysnvl.h> header file. */ 23 /* Define to 1 if you have the <sys/sysnvl.h> header file. */
22 #undef HAVE_SYS_SYSNVL_H 24 #undef HAVE_SYS_SYSNVL_H
23 25
@@ -27,9 +29,11 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
27 /* Define to 1 if you have the <sys/time.h> header file. */ 29 /* Define to 1 if you have the <sys/time.h> header file. */
28 #undef HAVE_SYS_TIME_H 30 #undef HAVE_SYS_TIME_H
29 31
32diff --git a/configure.ac b/configure.ac
33index b42fdd4..ec95146 100755
30--- a/configure.ac 34--- a/configure.ac
31+++ b/configure.ac 35+++ b/configure.ac
32@@ -4098,6 +4098,7 @@ AC_CHECK_HEADERS([ \ 36@@ -4892,6 +4892,7 @@ AC_CHECK_HEADERS([ \
33 sys/syscall.h \ 37 sys/syscall.h \
34 sys/sysnvl.h \ 38 sys/sysnvl.h \
35 sys/time.h \ 39 sys/time.h \
@@ -37,9 +41,11 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
37 sys/types.h \ 41 sys/types.h \
38 ]) 42 ])
39 43
44diff --git a/memcheck/tests/linux/timerfd-syscall.c b/memcheck/tests/linux/timerfd-syscall.c
45index 61d75b5..1ba888a 100644
40--- a/memcheck/tests/linux/timerfd-syscall.c 46--- a/memcheck/tests/linux/timerfd-syscall.c
41+++ b/memcheck/tests/linux/timerfd-syscall.c 47+++ b/memcheck/tests/linux/timerfd-syscall.c
42@@ -45,6 +45,9 @@ 48@@ -42,6 +42,9 @@
43 #if defined(HAVE_SYS_TIME_H) 49 #if defined(HAVE_SYS_TIME_H)
44 #include <sys/time.h> 50 #include <sys/time.h>
45 #endif 51 #endif
@@ -49,7 +55,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
49 #if defined(HAVE_SYS_TYPES_H) 55 #if defined(HAVE_SYS_TYPES_H)
50 #include <sys/types.h> 56 #include <sys/types.h>
51 #endif 57 #endif
52@@ -54,7 +57,8 @@ 58@@ -51,7 +54,8 @@
53 * timerfd_* system call numbers introduced in 2.6.23. These constants are 59 * timerfd_* system call numbers introduced in 2.6.23. These constants are
54 * not yet in the glibc 2.7 headers, that is why they are defined here. 60 * not yet in the glibc 2.7 headers, that is why they are defined here.
55 */ 61 */
@@ -59,7 +65,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
59 #if defined(__x86_64__) 65 #if defined(__x86_64__)
60 #define __NR_timerfd_create 283 66 #define __NR_timerfd_create 283
61 #elif defined(__i386__) 67 #elif defined(__i386__)
62@@ -67,8 +71,10 @@ 68@@ -64,8 +68,10 @@
63 #error Cannot detect your architecture! 69 #error Cannot detect your architecture!
64 #endif 70 #endif
65 #endif 71 #endif
@@ -71,7 +77,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
71 #if defined(__x86_64__) 77 #if defined(__x86_64__)
72 #define __NR_timerfd_settime 286 78 #define __NR_timerfd_settime 286
73 #define __NR_timerfd_gettime 287 79 #define __NR_timerfd_gettime 287
74@@ -85,7 +91,7 @@ 80@@ -82,7 +88,7 @@
75 #error Cannot detect your architecture! 81 #error Cannot detect your architecture!
76 #endif 82 #endif
77 #endif 83 #endif
@@ -80,7 +86,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
80 86
81 87
82 /* Definitions from include/linux/timerfd.h */ 88 /* Definitions from include/linux/timerfd.h */
83@@ -127,6 +133,7 @@ void set_timespec(struct timespec *tmr, 89@@ -124,6 +130,7 @@ void set_timespec(struct timespec *tmr, unsigned long long ustime)
84 tmr->tv_nsec = (long) (1000ULL * (ustime % 1000000ULL)); 90 tmr->tv_nsec = (long) (1000ULL * (ustime % 1000000ULL));
85 } 91 }
86 92
@@ -88,7 +94,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
88 int timerfd_create(int clockid, int flags) 94 int timerfd_create(int clockid, int flags)
89 { 95 {
90 return syscall(__NR_timerfd_create, clockid, flags); 96 return syscall(__NR_timerfd_create, clockid, flags);
91@@ -142,6 +149,7 @@ int timerfd_gettime(int ufc, struct itim 97@@ -139,6 +146,7 @@ int timerfd_gettime(int ufc, struct itimerspec *otmr)
92 { 98 {
93 return syscall(__NR_timerfd_gettime, ufc, otmr); 99 return syscall(__NR_timerfd_gettime, ufc, otmr);
94 } 100 }
diff --git a/meta/recipes-devtools/valgrind/valgrind/0001-memcheck-vgtests-remove-fullpath-after-flags.patch b/meta/recipes-devtools/valgrind/valgrind/0001-memcheck-vgtests-remove-fullpath-after-flags.patch
index dce8b52ba3..9a3596cac1 100644
--- a/meta/recipes-devtools/valgrind/valgrind/0001-memcheck-vgtests-remove-fullpath-after-flags.patch
+++ b/meta/recipes-devtools/valgrind/valgrind/0001-memcheck-vgtests-remove-fullpath-after-flags.patch
@@ -1,4 +1,4 @@
1From 3ff82dcb844f98dbf67c69f11f6516bc234725a9 Mon Sep 17 00:00:00 2001 1From b703b0d11adc9147a7d97817bd771ac40b8c4d39 Mon Sep 17 00:00:00 2001
2From: Stacy Gaikovaia <Stacy.Gaikovaia@windriver.com> 2From: Stacy Gaikovaia <Stacy.Gaikovaia@windriver.com>
3Date: Wed, 16 Sep 2020 13:45:07 -0400 3Date: Wed, 16 Sep 2020 13:45:07 -0400
4Subject: [PATCH] memcheck vgtests remove fullpath-after flags 4Subject: [PATCH] memcheck vgtests remove fullpath-after flags
@@ -20,7 +20,7 @@ Signed-off-by: Stacy Gaikovaia <Stacy.Gaikovaia@windriver.com>
20 2 files changed, 2 insertions(+), 2 deletions(-) 20 2 files changed, 2 insertions(+), 2 deletions(-)
21 21
22diff --git a/memcheck/tests/badfree3.vgtest b/memcheck/tests/badfree3.vgtest 22diff --git a/memcheck/tests/badfree3.vgtest b/memcheck/tests/badfree3.vgtest
23index 3dfc5fd8a..4ee03f00a 100644 23index 3dfc5fd..4ee03f0 100644
24--- a/memcheck/tests/badfree3.vgtest 24--- a/memcheck/tests/badfree3.vgtest
25+++ b/memcheck/tests/badfree3.vgtest 25+++ b/memcheck/tests/badfree3.vgtest
26@@ -1,3 +1,3 @@ 26@@ -1,3 +1,3 @@
@@ -29,7 +29,7 @@ index 3dfc5fd8a..4ee03f00a 100644
29+vgopts: -q 29+vgopts: -q
30 stderr_filter_args: badfree.c 30 stderr_filter_args: badfree.c
31diff --git a/memcheck/tests/varinfo5.vgtest b/memcheck/tests/varinfo5.vgtest 31diff --git a/memcheck/tests/varinfo5.vgtest b/memcheck/tests/varinfo5.vgtest
32index 063d00dce..79c4a72a4 100644 32index 063d00d..79c4a72 100644
33--- a/memcheck/tests/varinfo5.vgtest 33--- a/memcheck/tests/varinfo5.vgtest
34+++ b/memcheck/tests/varinfo5.vgtest 34+++ b/memcheck/tests/varinfo5.vgtest
35@@ -1,3 +1,3 @@ 35@@ -1,3 +1,3 @@
@@ -37,6 +37,3 @@ index 063d00dce..79c4a72a4 100644
37-vgopts: --fullpath-after=memcheck/ --fullpath-after=coregrind/ --read-var-info=yes --read-inline-info=yes -q 37-vgopts: --fullpath-after=memcheck/ --fullpath-after=coregrind/ --read-var-info=yes --read-inline-info=yes -q
38+vgopts: --read-var-info=yes --read-inline-info=yes -q 38+vgopts: --read-var-info=yes --read-inline-info=yes -q
39 stderr_filter: filter_varinfo3 39 stderr_filter: filter_varinfo3
40--
412.25.1
42
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 e421ac6c80..7deca99202 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
@@ -1,4 +1,4 @@
1From f405297d3382cd98391d02f397e2387da1f42879 Mon Sep 17 00:00:00 2001 1From bbb5e8a6fc5eec178f8077ab006ab42c009528d4 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com> 2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Fri, 24 Jan 2020 17:55:39 +0100 3Date: Fri, 24 Jan 2020 17:55:39 +0100
4Subject: [PATCH] none/tests/fdleak_cmsg.stderr.exp: adjust /tmp paths 4Subject: [PATCH] none/tests/fdleak_cmsg.stderr.exp: adjust /tmp paths
@@ -13,13 +13,13 @@ Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
13 1 file changed, 2 insertions(+), 2 deletions(-) 13 1 file changed, 2 insertions(+), 2 deletions(-)
14 14
15diff --git a/none/tests/fdleak_cmsg.stderr.exp b/none/tests/fdleak_cmsg.stderr.exp 15diff --git a/none/tests/fdleak_cmsg.stderr.exp b/none/tests/fdleak_cmsg.stderr.exp
16index 6e5a797b9..0ede1ab18 100644 16index 6b3b53f..45e7e2f 100644
17--- a/none/tests/fdleak_cmsg.stderr.exp 17--- a/none/tests/fdleak_cmsg.stderr.exp
18+++ b/none/tests/fdleak_cmsg.stderr.exp 18+++ b/none/tests/fdleak_cmsg.stderr.exp
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 (3 std) at exit. 22 FILE DESCRIPTORS: 6 open (3 inherited) at exit.
23-Open file descriptor ...: /tmp/data2 23-Open file descriptor ...: /tmp/data2
24+Open file descriptor ...: ... 24+Open file descriptor ...: ...
25 ... 25 ...
@@ -29,6 +29,3 @@ index 6e5a797b9..0ede1ab18 100644
29 ... 29 ...
30 30
31 Open AF_UNIX socket ...: <unknown> 31 Open AF_UNIX socket ...: <unknown>
32--
332.17.1
34
diff --git a/meta/recipes-devtools/valgrind/valgrind/0001-sigqueue-Rename-_sifields-to-__si_fields-on-musl.patch b/meta/recipes-devtools/valgrind/valgrind/0001-sigqueue-Rename-_sifields-to-__si_fields-on-musl.patch
index 27366153f7..efa6c2c895 100644
--- a/meta/recipes-devtools/valgrind/valgrind/0001-sigqueue-Rename-_sifields-to-__si_fields-on-musl.patch
+++ b/meta/recipes-devtools/valgrind/valgrind/0001-sigqueue-Rename-_sifields-to-__si_fields-on-musl.patch
@@ -1,7 +1,7 @@
1From 64ad2744acfb4fa40b1c114633a053f87125a203 Mon Sep 17 00:00:00 2001 1From c287382a1f3dd9f2db3df54dde54b4b266791bb9 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 10 Jun 2017 00:46:39 -0700 3Date: Sat, 10 Jun 2017 00:46:39 -0700
4Subject: [PATCH 1/6] sigqueue: Rename _sifields to __si_fields on musl 4Subject: [PATCH] sigqueue: Rename _sifields to __si_fields on musl
5 5
6Upstream-Status: Pending 6Upstream-Status: Pending
7 7
@@ -11,7 +11,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
11 1 file changed, 5 insertions(+) 11 1 file changed, 5 insertions(+)
12 12
13diff --git a/memcheck/tests/linux/sigqueue.c b/memcheck/tests/linux/sigqueue.c 13diff --git a/memcheck/tests/linux/sigqueue.c b/memcheck/tests/linux/sigqueue.c
14index d18bd72..acb7cba 100644 14index 4b6fb0f..d37fe93 100644
15--- a/memcheck/tests/linux/sigqueue.c 15--- a/memcheck/tests/linux/sigqueue.c
16+++ b/memcheck/tests/linux/sigqueue.c 16+++ b/memcheck/tests/linux/sigqueue.c
17@@ -8,6 +8,11 @@ 17@@ -8,6 +8,11 @@
@@ -26,6 +26,3 @@ index d18bd72..acb7cba 100644
26 int main(int argc, char **argv) 26 int main(int argc, char **argv)
27 { 27 {
28 siginfo_t *si; 28 siginfo_t *si;
29--
302.13.1
31
diff --git a/meta/recipes-devtools/valgrind/valgrind/0001-tests-arm-Use-O-instead-of-O0.patch b/meta/recipes-devtools/valgrind/valgrind/0001-tests-arm-Use-O-instead-of-O0.patch
new file mode 100644
index 0000000000..3eea195579
--- /dev/null
+++ b/meta/recipes-devtools/valgrind/valgrind/0001-tests-arm-Use-O-instead-of-O0.patch
@@ -0,0 +1,36 @@
1From 8087ae8dcc46f3f81af58ed9b7176761b988ee61 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 10 May 2024 17:44:47 -0700
4Subject: [PATCH] tests/arm: Use -O instead of -O0
5
6GCC-14 fails to compile the testcase with -O2 [1]
7therefore workaround it by using -O1, which works
8and for OE/cross-compiling it is fine, -O0 is used
9to make these tests compile natively on an arm target
10and gcc would take less memory compiling with -O0
11-O would take a bit more memory but in cross compiling
12we have enough of it on build host.
13
14[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115042
15Upstream-Status: Inappropriate [WORKAROUND]
16Signed-off-by: Khem Raj <raj.khem@gmail.com>
17---
18 none/tests/arm/Makefile.am | 4 ++--
19 1 file changed, 2 insertions(+), 2 deletions(-)
20
21diff --git a/none/tests/arm/Makefile.am b/none/tests/arm/Makefile.am
22index a76981e..a198f73 100644
23--- a/none/tests/arm/Makefile.am
24+++ b/none/tests/arm/Makefile.am
25@@ -57,9 +57,9 @@ allexec_CFLAGS = $(AM_CFLAGS) @FLAG_W_NO_NONNULL@
26 # Also force -O0 since -O takes hundreds of MB of memory
27 # for v6intThumb.c.
28 v6intARM_CFLAGS = $(AM_CFLAGS) -g -O0 -marm
29-v6intThumb_CFLAGS = $(AM_CFLAGS) -g -O0 -mthumb
30+v6intThumb_CFLAGS = $(AM_CFLAGS) -g -O -mthumb
31
32-v6media_CFLAGS = $(AM_CFLAGS) -g -O0 -mthumb
33+v6media_CFLAGS = $(AM_CFLAGS) -g -O -mthumb
34
35 v8crypto_a_CFLAGS = $(AM_CFLAGS) -g -O0 -mfpu=crypto-neon-fp-armv8 -marm -march=armv8-a
36 v8crypto_t_CFLAGS = $(AM_CFLAGS) -g -O0 -mfpu=crypto-neon-fp-armv8 -mthumb -march=armv8-a
diff --git a/meta/recipes-devtools/valgrind/valgrind/0001-valgrind-filter_xml_frames-do-not-filter-usr.patch b/meta/recipes-devtools/valgrind/valgrind/0001-valgrind-filter_xml_frames-do-not-filter-usr.patch
index bf0f0ded21..c64c2afd3f 100644
--- a/meta/recipes-devtools/valgrind/valgrind/0001-valgrind-filter_xml_frames-do-not-filter-usr.patch
+++ b/meta/recipes-devtools/valgrind/valgrind/0001-valgrind-filter_xml_frames-do-not-filter-usr.patch
@@ -1,7 +1,7 @@
1From d1dea3c2bcf1e22baab39e2c0b8ca59db8a5bc37 Mon Sep 17 00:00:00 2001 1From f8fbebcf69e4a8bf2122b7c55f2ce372377af1bc Mon Sep 17 00:00:00 2001
2From: Randy MacLeod <Randy.MacLeod@windriver.com> 2From: Randy MacLeod <Randy.MacLeod@windriver.com>
3Date: Mon, 13 May 2019 17:12:21 -0400 3Date: Mon, 13 May 2019 17:12:21 -0400
4Subject: [PATCH 1/2] valgrind: filter_xml_frames: do not filter /usr 4Subject: [PATCH] valgrind: filter_xml_frames: do not filter /usr
5 5
6filter_xml_frames is intended to filter system paths under 6filter_xml_frames is intended to filter system paths under
7'/usr' that vary from platform to platform. In the ptest case 7'/usr' that vary from platform to platform. In the ptest case
@@ -21,7 +21,7 @@ Signed-off-by: Randy MacLeod <Randy.MacLeod@windriver.com>
21 1 file changed, 2 insertions(+), 1 deletion(-) 21 1 file changed, 2 insertions(+), 1 deletion(-)
22 22
23diff --git a/tests/filter_xml_frames b/tests/filter_xml_frames 23diff --git a/tests/filter_xml_frames b/tests/filter_xml_frames
24index f1fa3f070..04fbc82de 100755 24index f1fa3f0..04fbc82 100755
25--- a/tests/filter_xml_frames 25--- a/tests/filter_xml_frames
26+++ b/tests/filter_xml_frames 26+++ b/tests/filter_xml_frames
27@@ -47,7 +47,8 @@ while (my $line = <>) 27@@ -47,7 +47,8 @@ while (my $line = <>)
@@ -34,6 +34,3 @@ index f1fa3f070..04fbc82de 100755
34 } 34 }
35 } 35 }
36 36
37--
382.17.0
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
deleted file mode 100644
index 80a8e3a10b..0000000000
--- a/meta/recipes-devtools/valgrind/valgrind/0001-valgrind-monitor.py-regular-expressions-should-use-r.patch
+++ /dev/null
@@ -1,64 +0,0 @@
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
deleted file mode 100644
index 5759fa039a..0000000000
--- a/meta/recipes-devtools/valgrind/valgrind/0002-Bug-476548-valgrind-3.22.0-fails-on-assertion-when-l.patch
+++ /dev/null
@@ -1,147 +0,0 @@
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/0003-Add-fchmodat2-syscall-on-linux.patch b/meta/recipes-devtools/valgrind/valgrind/0003-Add-fchmodat2-syscall-on-linux.patch
deleted file mode 100644
index 2a09ca52b7..0000000000
--- a/meta/recipes-devtools/valgrind/valgrind/0003-Add-fchmodat2-syscall-on-linux.patch
+++ /dev/null
@@ -1,221 +0,0 @@
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-correct-include-directive-path-for-config.h.patch b/meta/recipes-devtools/valgrind/valgrind/0003-correct-include-directive-path-for-config.h.patch
index c2965c40df..3acb5a28f4 100644
--- a/meta/recipes-devtools/valgrind/valgrind/0003-correct-include-directive-path-for-config.h.patch
+++ b/meta/recipes-devtools/valgrind/valgrind/0003-correct-include-directive-path-for-config.h.patch
@@ -1,7 +1,7 @@
1From ecbdea7bd8b08205f1bc3f6b72d4b4a80f313fcb Mon Sep 17 00:00:00 2001 1From de4d7e478515b63f049b211266d9b946c15cc0b9 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 10 Jun 2017 01:03:17 -0700 3Date: Sat, 10 Jun 2017 01:03:17 -0700
4Subject: [PATCH 3/6] correct include directive path for config.h 4Subject: [PATCH] correct include directive path for config.h
5 5
6when building out of source tree, it can not find 6when building out of source tree, it can not find
7the generated config.h otherwise 7the generated config.h otherwise
@@ -15,7 +15,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
15 2 files changed, 2 insertions(+), 2 deletions(-) 15 2 files changed, 2 insertions(+), 2 deletions(-)
16 16
17diff --git a/memcheck/tests/linux/syscalls-2007.c b/memcheck/tests/linux/syscalls-2007.c 17diff --git a/memcheck/tests/linux/syscalls-2007.c b/memcheck/tests/linux/syscalls-2007.c
18index b61c6d5..cc3fd62 100644 18index b91df82..c15c3eb 100644
19--- a/memcheck/tests/linux/syscalls-2007.c 19--- a/memcheck/tests/linux/syscalls-2007.c
20+++ b/memcheck/tests/linux/syscalls-2007.c 20+++ b/memcheck/tests/linux/syscalls-2007.c
21@@ -10,7 +10,7 @@ 21@@ -10,7 +10,7 @@
@@ -40,6 +40,3 @@ index 1143722..21e758b 100644
40 #include <stdio.h> 40 #include <stdio.h>
41 #if defined(HAVE_SYS_KLOG_H) 41 #if defined(HAVE_SYS_KLOG_H)
42 #include <sys/klog.h> 42 #include <sys/klog.h>
43--
442.13.1
45
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
deleted file mode 100644
index 4e9185508a..0000000000
--- a/meta/recipes-devtools/valgrind/valgrind/0004-Bug-478624-Valgrind-incompatibility-with-binutils-2..patch
+++ /dev/null
@@ -1,137 +0,0 @@
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/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
deleted file mode 100644
index fea3b00f62..0000000000
--- a/meta/recipes-devtools/valgrind/valgrind/0005-Modify-vg_test-wrapper-to-support-PTEST-formats.patch
+++ /dev/null
@@ -1,257 +0,0 @@
1From e244a72c6f8803550f37e81f72bbae039651013b Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Tue, 15 Dec 2015 15:50:44 +0200
4Subject: [PATCH] Modify vg_test wrapper to support PTEST formats
5
6Change the valgrind regression test script vg_regtest to
7support the yocto ptest stdout reporting format. The commit adds
8'--yocto-ptest' as an optional argument to vg_regtest, which alters
9the output to use the ptest infrastructure reporting format:
10 "[PASS|SKIP|FAIL]: testname"
11instead of valgrind's internal test reporting format. Without the added
12option, --yocto-ptest, the valgrind regression test output is unchanged.
13
14Enforce 30 seconds limit for the test.
15This resume execution of the remaining tests when valgrind hangs.
16
17Upstream-Status: Inappropriate [oe-core specific]
18
19Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
20Signed-off-by: Tudor Florea <tudor.florea@enea.com>
21Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
22
23Increase time limit to 90 s.
24(double of the expected time of drd/tests/std_list on qemuarm64)
25
26Signed-off-by: Yi Fan Yu <yifan.yu@windriver.com>
27---
28 tests/vg_regtest.in | 75 +++++++++++++++++++++++++++++++++------------
29 1 file changed, 55 insertions(+), 20 deletions(-)
30
31diff --git a/tests/vg_regtest.in b/tests/vg_regtest.in
32index ad18800..e4bd8cb 100755
33--- a/tests/vg_regtest.in
34+++ b/tests/vg_regtest.in
35@@ -47,6 +47,7 @@
36 # --loop-till-fail: loops on the test(s) till one fail, then exit
37 # This is useful to obtain detailed trace or --keep-unfiltered
38 # output of a non deterministic test failure
39+# --yocto-ptest: output in yocto ptest format
40 #
41 # The easiest way is to run all tests in valgrind/ with (assuming you installed
42 # in $PREFIX):
43@@ -139,7 +140,7 @@ my $usage="\n"
44 . "Usage:\n"
45 . " vg_regtest [--all, --valgrind, --valgrind-lib, --keep-unfiltered\n"
46 . " --outer-valgrind, --outer-tool, --outer-args\n"
47- . " --loop-till-fail]\n"
48+ . " --loop-till-fail, --yocto-ptest]\n"
49 . " Use EXTRA_REGTEST_OPTS to supply extra args for all tests\n"
50 . "\n";
51
52@@ -187,6 +188,7 @@ my $run_outer_args = "";
53 my $valgrind_lib = "$tests_dir/.in_place";
54 my $keepunfiltered = 0;
55 my $looptillfail = 0;
56+my $yoctoptest = 0;
57
58 # default filter is the one named "filter_stderr" in the test's directory
59 my $default_stderr_filter = "filter_stderr";
60@@ -245,6 +247,8 @@ sub process_command_line()
61 $keepunfiltered = 1;
62 } elsif ($arg =~ /^--loop-till-fail$/) {
63 $looptillfail = 1;
64+ } elsif ($arg =~ /^--yocto-ptest$/) {
65+ $yoctoptest = 1;
66 } else {
67 die $usage;
68 }
69@@ -376,13 +380,28 @@ sub read_vgtest_file($)
70 #----------------------------------------------------------------------------
71 # Since most of the program time is spent in system() calls, need this to
72 # propagate a Ctrl-C enabling us to quit.
73-sub mysystem($)
74+# Enforce 90 seconds limit for the test.
75+# This resume execution of the remaining tests if valgrind hangs.
76+sub mysystem($)
77 {
78- my $exit_code = system($_[0]);
79- ($exit_code == 2) and exit 1; # 2 is SIGINT
80- return $exit_code;
81+ my $exit_code=0;
82+ eval {
83+ local $SIG{'ALRM'} = sub { die "timed out\n" };
84+ alarm(90);
85+ $exit_code = system($_[0]);
86+ alarm (0);
87+ ($exit_code == 2) and die "SIGINT\n"; # 2 is SIGINT
88+ };
89+ if ($@) {
90+ if ($@ eq "timed out\n") {
91+ print "timed out\n";
92+ return 1;
93+ }
94+ if ($@ eq "SIGINT\n") {
95+ exit 1;
96+ }
97+ }
98 }
99-
100 # if $keepunfiltered, copies $1 to $1.unfiltered.out
101 # renames $0 tp $1
102 sub filtered_rename($$)
103@@ -430,23 +449,25 @@ sub do_diffs($$$$)
104 # A match; remove .out and any previously created .diff files.
105 unlink("$name.$mid.out");
106 unlink(<$name.$mid.diff*>);
107- return;
108+ return 0;
109 }
110 }
111 }
112 # If we reach here, none of the .exp files matched.
113- print "*** $name failed ($mid) ***\n";
114+ print "*** $name failed ($mid) ***\n" if ($yoctoptest == 0) ;
115 push(@failures, sprintf("%-40s ($mid)", "$fullname"));
116 $num_failures{$mid}++;
117 if ($looptillfail == 1) {
118 print "Failure encountered, stopping to loop\n";
119 exit 1
120 }
121+ return 1;
122 }
123
124 sub do_one_test($$)
125 {
126 my ($dir, $vgtest) = @_;
127+ my $diffStatus = 0;
128 $vgtest =~ /^(.*)\.vgtest/;
129 my $name = $1;
130 my $fullname = "$dir/$name";
131@@ -465,7 +486,11 @@ sub do_one_test($$)
132 } elsif (256 == $prereq_res) {
133 # Nb: weird Perl-ism -- exit code of '1' is seen by Perl as 256...
134 # Prereq failed, skip.
135- printf("%-16s (skipping, prereq failed: $prereq)\n", "$name:");
136+ if ($yoctoptest == 0) {
137+ printf("%-16s (skipping, prereq failed: $prereq)\n", "$name:");
138+ } else {
139+ printf("SKIP: $fullname\n");
140+ }
141 return;
142 } else {
143 # Bad prereq; abort.
144@@ -483,7 +508,7 @@ sub do_one_test($$)
145 }
146 # If there is a progB, let's start it in background:
147 printf("%-16s valgrind $extraopts $vgopts $prog $args (progB: $progB $argsB)\n",
148- "$name:");
149+ "$name:") if ($yoctoptest == 0);
150 # progB.done used to detect child has finished. See below.
151 # Note: redirection of stdout and stderr is before $progB to allow argsB
152 # to e.g. redirect stdoutB to stderrB
153@@ -499,7 +524,8 @@ sub do_one_test($$)
154 . "touch progB.done) &");
155 }
156 } else {
157- printf("%-16s valgrind $extraopts $vgopts $prog $args\n", "$name:");
158+ printf("%-16s valgrind $extraopts $vgopts $prog $args\n", "$name:")
159+ if ($yoctoptest == 0);
160 }
161
162 # Collect environment variables, if any.
163@@ -540,7 +566,7 @@ sub do_one_test($$)
164 # Find all the .stdout.exp files. If none, use /dev/null.
165 my @stdout_exps = <$name.stdout.exp*>;
166 @stdout_exps = ( "/dev/null" ) if (0 == scalar @stdout_exps);
167- do_diffs($fullname, $name, "stdout", \@stdout_exps);
168+ $diffStatus |= do_diffs($fullname, $name, "stdout", \@stdout_exps);
169
170 # Filter stderr
171 $stderr_filter_args = $name if (! defined $stderr_filter_args);
172@@ -549,7 +575,7 @@ sub do_one_test($$)
173 # Find all the .stderr.exp files. At least one must exist.
174 my @stderr_exps = <$name.stderr.exp*>;
175 (0 != scalar @stderr_exps) or die "Could not find `$name.stderr.exp*'\n";
176- do_diffs($fullname, $name, "stderr", \@stderr_exps);
177+ $diffStatus |= do_diffs($fullname, $name, "stderr", \@stderr_exps);
178
179 if (defined $progB) {
180 # wait for the child to be finished
181@@ -573,7 +599,7 @@ sub do_one_test($$)
182 # Find all the .stdoutB.exp files. If none, use /dev/null.
183 my @stdoutB_exps = <$name.stdoutB.exp*>;
184 @stdoutB_exps = ( "/dev/null" ) if (0 == scalar @stdoutB_exps);
185- do_diffs($fullname, $name, "stdoutB", \@stdoutB_exps);
186+ $diffStatus |= do_diffs($fullname, $name, "stdoutB", \@stdoutB_exps);
187
188 # Filter stderr
189 $stderrB_filter_args = $name if (! defined $stderrB_filter_args);
190@@ -582,7 +608,7 @@ sub do_one_test($$)
191 # Find all the .stderrB.exp files. At least one must exist.
192 my @stderrB_exps = <$name.stderrB.exp*>;
193 (0 != scalar @stderrB_exps) or die "Could not find `$name.stderrB.exp*'\n";
194- do_diffs($fullname, $name, "stderrB", \@stderrB_exps);
195+ $diffStatus |= do_diffs($fullname, $name, "stderrB", \@stderrB_exps);
196 }
197
198 # Maybe do post-test check
199@@ -594,7 +620,7 @@ sub do_one_test($$)
200 # Find all the .post.exp files. If none, use /dev/null.
201 my @post_exps = <$name.post.exp*>;
202 @post_exps = ( "/dev/null" ) if (0 == scalar @post_exps);
203- do_diffs($fullname, $name, "post", \@post_exps);
204+ $diffStatus |= do_diffs($fullname, $name, "post", \@post_exps);
205 }
206 }
207
208@@ -603,6 +629,13 @@ sub do_one_test($$)
209 print("(cleanup operation failed: $cleanup)\n");
210 }
211
212+ if ($yoctoptest == 1) {
213+ if ($diffStatus == 0) {
214+ print("PASS: $fullname\n");
215+ } else {
216+ print("FAIL: $fullname\n");
217+ }
218+ }
219 $num_tests_done++;
220 }
221
222@@ -643,7 +676,7 @@ sub test_one_dir($$)
223
224 my $tests_start_time = time;
225 if ($found_tests) {
226- print "-- Running tests in $full_dir $dashes\n";
227+ print "-- Running tests in $full_dir $dashes\n" if ($yoctoptest == 0);
228 }
229 foreach my $f (@fs) {
230 if (-d $f) {
231@@ -657,7 +690,7 @@ sub test_one_dir($$)
232 my $end_time = "(in $tests_cost_time sec)";
233 my $end_dashes = "-" x (50 - (length $full_dir)
234 - (length $end_time) - 1);
235- print "-- Finished tests in $full_dir $end_time $end_dashes\n";
236+ print "-- Finished tests in $full_dir $dashes\n" if ($yoctoptest == 0);
237 }
238
239 chdir("..");
240@@ -683,10 +716,12 @@ sub summarise_results
241 $num_failures{"stdout"}, plural($num_failures{"stdout"}),
242 $num_failures{"stderrB"}, plural($num_failures{"stderrB"}),
243 $num_failures{"stdoutB"}, plural($num_failures{"stdoutB"}),
244- $num_failures{"post"}, plural($num_failures{"post"}));
245+ $num_failures{"post"}, plural($num_failures{"post"}))
246+ if ($yoctoptest == 0);
247
248 foreach my $failure (@failures) {
249- print "$failure\n";
250+ print "$failure\n"
251+ if ($yoctoptest == 0);
252 }
253 print "\n";
254 }
255--
2562.30.2
257
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 51cd3532d3..109caf76ab 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
@@ -1,4 +1,4 @@
1From 0bf4b0ac18d1ea41b32ad781d214b295ca1998f3 Mon Sep 17 00:00:00 2001 1From 85bff993087cd7367ffc35de525c2bf6162398d2 Mon Sep 17 00:00:00 2001
2From: Aneesh Bansal <aneesh.bansal@freescale.com> 2From: 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.
@@ -11,17 +11,16 @@ Upstream-Status: Submitted [https://bugs.kde.org/show_bug.cgi?id=289836]
11 11
12Signed-off-by: Aneesh Bansal <aneesh.bansal@freescale.com> 12Signed-off-by: Aneesh Bansal <aneesh.bansal@freescale.com>
13--- 13---
14 14 VEX/priv/guest_ppc_defs.h | 2 ++
15 VEX/priv/guest_ppc_defs.h | 2 ++ 15 VEX/priv/guest_ppc_helpers.c | 18 ++++++++++++++++++
16 VEX/priv/guest_ppc_helpers.c | 18 ++++++++++++++++++ 16 VEX/priv/guest_ppc_toIR.c | 22 ++++++++++++++++++++++
17 VEX/priv/guest_ppc_toIR.c | 22 ++++++++++++++++++++++ 17 3 files changed, 42 insertions(+)
18 3 files changed, 42 insertions(+), 0 deletions(-)
19 18
20diff --git a/VEX/priv/guest_ppc_defs.h b/VEX/priv/guest_ppc_defs.h 19diff --git a/VEX/priv/guest_ppc_defs.h b/VEX/priv/guest_ppc_defs.h
21index dd3c62e..11a34aa 100644 20index 220fbf1..cd259f3 100644
22--- a/VEX/priv/guest_ppc_defs.h 21--- a/VEX/priv/guest_ppc_defs.h
23+++ b/VEX/priv/guest_ppc_defs.h 22+++ b/VEX/priv/guest_ppc_defs.h
24@@ -146,6 +146,8 @@ extern UInt ppc32g_dirtyhelper_MFSPR_268_269 ( UInt ); 23@@ -233,6 +233,8 @@ extern UInt ppc32g_dirtyhelper_MFSPR_268_269 ( UInt );
25 24
26 extern UInt ppc32g_dirtyhelper_MFSPR_287 ( void ); 25 extern UInt ppc32g_dirtyhelper_MFSPR_287 ( void );
27 26
@@ -31,10 +30,10 @@ index dd3c62e..11a34aa 100644
31 UInt vD_idx, UInt sh, 30 UInt vD_idx, UInt sh,
32 UInt shift_right ); 31 UInt shift_right );
33diff --git a/VEX/priv/guest_ppc_helpers.c b/VEX/priv/guest_ppc_helpers.c 32diff --git a/VEX/priv/guest_ppc_helpers.c b/VEX/priv/guest_ppc_helpers.c
34index 11aa428..b49ea3f 100644 33index 2611e52..72c349b 100644
35--- a/VEX/priv/guest_ppc_helpers.c 34--- a/VEX/priv/guest_ppc_helpers.c
36+++ b/VEX/priv/guest_ppc_helpers.c 35+++ b/VEX/priv/guest_ppc_helpers.c
37@@ -119,6 +119,24 @@ UInt ppc32g_dirtyhelper_MFSPR_287 ( void ) 36@@ -118,6 +118,24 @@ UInt ppc32g_dirtyhelper_MFSPR_287 ( void )
38 # endif 37 # endif
39 } 38 }
40 39
@@ -60,10 +59,10 @@ index 11aa428..b49ea3f 100644
60 /* CALLED FROM GENERATED CODE */ 59 /* CALLED FROM GENERATED CODE */
61 /* DIRTY HELPER (reads guest state, writes guest mem) */ 60 /* DIRTY HELPER (reads guest state, writes guest mem) */
62diff --git a/VEX/priv/guest_ppc_toIR.c b/VEX/priv/guest_ppc_toIR.c 61diff --git a/VEX/priv/guest_ppc_toIR.c b/VEX/priv/guest_ppc_toIR.c
63index f8d220d..37c8974 100644 62index 18716dd..b2e72a0 100644
64--- a/VEX/priv/guest_ppc_toIR.c 63--- a/VEX/priv/guest_ppc_toIR.c
65+++ b/VEX/priv/guest_ppc_toIR.c 64+++ b/VEX/priv/guest_ppc_toIR.c
66@@ -5657,6 +5657,28 @@ static Bool dis_proc_ctl ( VexAbiInfo* vbi, UInt theInstr ) 65@@ -11875,6 +11875,28 @@ static Bool dis_proc_ctl ( const VexAbiInfo* vbi, UInt prefix, UInt theInstr )
67 break; 66 break;
68 } 67 }
69 68
@@ -92,5 +91,3 @@ index f8d220d..37c8974 100644
92 default: 91 default:
93 vex_printf("dis_proc_ctl(ppc)(mfspr,SPR)(0x%x)\n", SPR); 92 vex_printf("dis_proc_ctl(ppc)(mfspr,SPR)(0x%x)\n", SPR);
94 return False; 93 return False;
95--
961.7.0.4
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 82b8344279..1597b3a021 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
@@ -1,4 +1,4 @@
1From 8facc29c3c56e6cf9cfef70986cf73876044a3fb Mon Sep 17 00:00:00 2001 1From 596372bc9b4d31bc9811881cfa747d99a8c25141 Mon Sep 17 00:00:00 2001
2From: Andre McCurdy <armccurdy@gmail.com> 2From: Andre McCurdy <armccurdy@gmail.com>
3Date: Tue, 19 Jan 2016 16:42:36 -0800 3Date: Tue, 19 Jan 2016 16:42:36 -0800
4Subject: [PATCH] avoid neon for targets which don't support it 4Subject: [PATCH] avoid neon for targets which don't support it
@@ -16,7 +16,7 @@ Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
16 1 file changed, 1 insertion(+), 1 deletion(-) 16 1 file changed, 1 insertion(+), 1 deletion(-)
17 17
18diff --git a/memcheck/tests/sh-mem-random.c b/memcheck/tests/sh-mem-random.c 18diff --git a/memcheck/tests/sh-mem-random.c b/memcheck/tests/sh-mem-random.c
19index ae82248..816e139 100644 19index 0e01684..e41957e 100644
20--- a/memcheck/tests/sh-mem-random.c 20--- a/memcheck/tests/sh-mem-random.c
21+++ b/memcheck/tests/sh-mem-random.c 21+++ b/memcheck/tests/sh-mem-random.c
22@@ -191,7 +191,7 @@ void do_test_at ( U1* arr ) 22@@ -191,7 +191,7 @@ void do_test_at ( U1* arr )
@@ -28,6 +28,3 @@ index ae82248..816e139 100644
28 /* On arm32, many compilers generate a 64-bit float move 28 /* On arm32, many compilers generate a 64-bit float move
29 using two 32 bit integer registers, which completely 29 using two 32 bit integer registers, which completely
30 defeats this test. Hence force a 64-bit NEON load and 30 defeats this test. Hence force a 64-bit NEON load and
31--
321.9.1
33
diff --git a/meta/recipes-devtools/valgrind/valgrind/fixed-perl-path.patch b/meta/recipes-devtools/valgrind/valgrind/fixed-perl-path.patch
index b9804e7451..6bfc6035ed 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 beaa5b64c60d501fa9cd59fdc563e5f5bccf6882 Mon Sep 17 00:00:00 2001 1From 408f9b39ca4f5709b668f13829a94c4cae855006 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,7 +17,6 @@ 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
21--- 20---
22 massif/ms_print.in | 2 +- 21 massif/ms_print.in | 2 +-
23 perf/vg_perf.in | 2 +- 22 perf/vg_perf.in | 2 +-
@@ -45,7 +44,7 @@ index 90ee1d2..c585096 100644
45 ##--- Valgrind performance testing script vg_perf ---## 44 ##--- Valgrind performance testing script vg_perf ---##
46 ##--------------------------------------------------------------------## 45 ##--------------------------------------------------------------------##
47diff --git a/tests/vg_regtest.in b/tests/vg_regtest.in 46diff --git a/tests/vg_regtest.in b/tests/vg_regtest.in
48index 7152765..ad18800 100755 47index 3471322..49e1114 100755
49--- a/tests/vg_regtest.in 48--- a/tests/vg_regtest.in
50+++ b/tests/vg_regtest.in 49+++ b/tests/vg_regtest.in
51@@ -1,4 +1,4 @@ 50@@ -1,4 +1,4 @@
diff --git a/meta/recipes-devtools/valgrind/valgrind/remove-for-aarch64 b/meta/recipes-devtools/valgrind/valgrind/remove-for-aarch64
deleted file mode 100644
index 5bfba1c8d3..0000000000
--- a/meta/recipes-devtools/valgrind/valgrind/remove-for-aarch64
+++ /dev/null
@@ -1,32 +0,0 @@
1drd/tests/annotate_sem
2gdbserver_tests/hgtls
3helgrind/tests/hg05_race2
4helgrind/tests/tc20_verifywrap
5memcheck/tests/dw4
6memcheck/tests/varinfo1
7memcheck/tests/varinfo2
8memcheck/tests/varinfo3
9memcheck/tests/varinfo4
10memcheck/tests/varinfo5
11memcheck/tests/varinfo6
12memcheck/tests/varinforestrict
13memcheck/tests/atomic_incs
14memcheck/tests/bug464969_d_demangle
15memcheck/tests/cxx17_aligned_new
16memcheck/tests/demangle
17memcheck/tests/long_namespace_xml
18memcheck/tests/mismatches
19memcheck/tests/mismatches_xml
20memcheck/tests/new_aligned_delete_default
21memcheck/tests/new_delete_mismatch_size
22memcheck/tests/new_nothrow
23memcheck/tests/realloc_size_zero_mismatch
24memcheck/tests/sized_aligned_new_delete_args
25memcheck/tests/sized_aligned_new_delete_misaligned1
26memcheck/tests/sized_aligned_new_delete_misaligned1_xml
27memcheck/tests/sized_aligned_new_delete_misaligned2
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
deleted file mode 100644
index 8435a6d41d..0000000000
--- a/meta/recipes-devtools/valgrind/valgrind/remove-for-all
+++ /dev/null
@@ -1,29 +0,0 @@
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
21drd/tests/bar_bad
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/s390x_vec_op_t.patch b/meta/recipes-devtools/valgrind/valgrind/s390x_vec_op_t.patch
index bde1241dc7..19690e5ebb 100644
--- a/meta/recipes-devtools/valgrind/valgrind/s390x_vec_op_t.patch
+++ b/meta/recipes-devtools/valgrind/valgrind/s390x_vec_op_t.patch
@@ -1,7 +1,7 @@
1From 8154d38bac5cdb3675cfdaf562ab9da01988b263 Mon Sep 17 00:00:00 2001 1From 8c92089741d809cfd18354f1b4df18cd28398a20 Mon Sep 17 00:00:00 2001
2From: Yi Fan Yu <yifan.yu@windriver.com> 2From: Yi Fan Yu <yifan.yu@windriver.com>
3Date: Wed, 17 Mar 2021 12:16:31 -0400 3Date: Wed, 17 Mar 2021 12:16:31 -0400
4Subject: [PATCH 19/20] remove s390x_vec_op_t 4Subject: [PATCH] remove s390x_vec_op_t
5 5
6s390x_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
7removing it ensures that valgrind can be built with -fno-common option 7removing it ensures that valgrind can be built with -fno-common option
@@ -18,18 +18,15 @@ Signed-off-by: Yi Fan Yu <yifan.yu@windriver.com>
18 1 file changed, 1 insertion(+), 1 deletion(-) 18 1 file changed, 1 insertion(+), 1 deletion(-)
19 19
20diff --git a/VEX/priv/guest_s390_defs.h b/VEX/priv/guest_s390_defs.h 20diff --git a/VEX/priv/guest_s390_defs.h b/VEX/priv/guest_s390_defs.h
21index 9054290..dab8002 100644 21index 29efa01..3a8f0a0 100644
22--- a/VEX/priv/guest_s390_defs.h 22--- a/VEX/priv/guest_s390_defs.h
23+++ b/VEX/priv/guest_s390_defs.h 23+++ b/VEX/priv/guest_s390_defs.h
24@@ -284,7 +284,7 @@ typedef enum { 24@@ -285,7 +285,7 @@ typedef enum {
25 S390_VEC_OP_VBPERM, 25 S390_VEC_OP_VCLFNL,
26 S390_VEC_OP_VMSL, 26 S390_VEC_OP_VCRNF,
27 S390_VEC_OP_LAST // supposed to be the last element in enum 27 S390_VEC_OP_LAST // supposed to be the last element in enum
28-} s390x_vec_op_t; 28-} s390x_vec_op_t;
29+}; 29+};
30 30
31 /* Arguments of s390x_dirtyhelper_vec_op(...) which are packed into one 31 /* Arguments of s390x_dirtyhelper_vec_op(...) which are packed into one
32 ULong variable. 32 ULong variable.
33--
342.29.2
35
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 f15d04b173..0c18a63c2b 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
@@ -1,4 +1,4 @@
1From d134dafc2f11e0d247420a0ba360bcdef77b4093 Mon Sep 17 00:00:00 2001 1From a5cd00f1c2d78e2a15f4a0c595f5ac10ca4c3290 Mon Sep 17 00:00:00 2001
2From: Andre McCurdy <armccurdy@gmail.com> 2From: Andre McCurdy <armccurdy@gmail.com>
3Date: Tue, 19 Jan 2016 16:00:00 -0800 3Date: Tue, 19 Jan 2016 16:00:00 -0800
4Subject: [PATCH] use appropriate -march/-mcpu/-mfpu for ARM test apps 4Subject: [PATCH] use appropriate -march/-mcpu/-mfpu for ARM test apps
@@ -23,10 +23,10 @@ Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
23 1 file changed, 4 insertions(+), 2 deletions(-) 23 1 file changed, 4 insertions(+), 2 deletions(-)
24 24
25diff --git a/none/tests/arm/Makefile.am b/none/tests/arm/Makefile.am 25diff --git a/none/tests/arm/Makefile.am b/none/tests/arm/Makefile.am
26index 4507a20..825290f 100644 26index 79b957c..41a5a03 100644
27--- a/none/tests/arm/Makefile.am 27--- a/none/tests/arm/Makefile.am
28+++ b/none/tests/arm/Makefile.am 28+++ b/none/tests/arm/Makefile.am
29@@ -62,8 +62,10 @@ neon64_CFLAGS = $(AM_CFLAGS) -g -O0 -mcpu=cortex-a8 \ 29@@ -87,8 +87,10 @@ neon64_CFLAGS = $(AM_CFLAGS) -g -O0 -mcpu=cortex-a8 \
30 -mfpu=neon \ 30 -mfpu=neon \
31 -mthumb 31 -mthumb
32 32
@@ -39,6 +39,3 @@ index 4507a20..825290f 100644
39+vcvt_fixed_float_VFP_CFLAGS = $(AM_CFLAGS) -g -mcpu=cortex-a8 -mfpu=vfpv3 39+vcvt_fixed_float_VFP_CFLAGS = $(AM_CFLAGS) -g -mcpu=cortex-a8 -mfpu=vfpv3
40+ 40+
41+vfpv4_fma_CFLAGS = $(AM_CFLAGS) -g -O0 -march=armv7ve -mcpu=cortex-a15 -mfpu=vfpv4 -marm 41+vfpv4_fma_CFLAGS = $(AM_CFLAGS) -g -O0 -march=armv7ve -mcpu=cortex-a15 -mfpu=vfpv4 -marm
42--
431.9.1
44
diff --git a/meta/recipes-devtools/valgrind/valgrind/valgrind-make-ld-XXX.so-strlen-intercept-optional.patch b/meta/recipes-devtools/valgrind/valgrind/valgrind-make-ld-XXX.so-strlen-intercept-optional.patch
index d04297dca8..ca7f721d9c 100644
--- a/meta/recipes-devtools/valgrind/valgrind/valgrind-make-ld-XXX.so-strlen-intercept-optional.patch
+++ b/meta/recipes-devtools/valgrind/valgrind/valgrind-make-ld-XXX.so-strlen-intercept-optional.patch
@@ -1,4 +1,4 @@
1From 005bd11809a1ce65e9f2c28e884354a4741650b9 Mon Sep 17 00:00:00 2001 1From b407514aa1a4fd3667b30527260e271da34ce4a7 Mon Sep 17 00:00:00 2001
2From: Andre McCurdy <armccurdy@gmail.com> 2From: Andre McCurdy <armccurdy@gmail.com>
3Date: Tue, 13 Dec 2016 11:29:55 +0800 3Date: Tue, 13 Dec 2016 11:29:55 +0800
4Subject: [PATCH] make ld-XXX.so strlen intercept optional 4Subject: [PATCH] make ld-XXX.so strlen intercept optional
@@ -17,10 +17,10 @@ Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
17 1 file changed, 12 insertions(+), 1 deletion(-) 17 1 file changed, 12 insertions(+), 1 deletion(-)
18 18
19diff --git a/coregrind/m_redir.c b/coregrind/m_redir.c 19diff --git a/coregrind/m_redir.c b/coregrind/m_redir.c
20index ff35009..d7d6816 100644 20index 63172b9..1b5bf95 100644
21--- a/coregrind/m_redir.c 21--- a/coregrind/m_redir.c
22+++ b/coregrind/m_redir.c 22+++ b/coregrind/m_redir.c
23@@ -1275,7 +1275,18 @@ static void add_hardwired_spec (const HChar* sopatt, const HChar* fnpatt, 23@@ -1321,7 +1321,18 @@ static void add_hardwired_spec (const HChar* sopatt, const HChar* fnpatt,
24 spec->to_addr = to_addr; 24 spec->to_addr = to_addr;
25 spec->isWrap = False; 25 spec->isWrap = False;
26 spec->isGlobal = False; 26 spec->isGlobal = False;
@@ -40,6 +40,3 @@ index ff35009..d7d6816 100644
40 /* VARIABLE PARTS */ 40 /* VARIABLE PARTS */
41 spec->mark = False; /* not significant */ 41 spec->mark = False; /* not significant */
42 spec->done = False; /* not significant */ 42 spec->done = False; /* not significant */
43--
441.9.1
45
diff --git a/meta/recipes-devtools/valgrind/valgrind_3.22.0.bb b/meta/recipes-devtools/valgrind/valgrind_3.22.0.bb
deleted file mode 100644
index 563d99f0e2..0000000000
--- a/meta/recipes-devtools/valgrind/valgrind_3.22.0.bb
+++ /dev/null
@@ -1,276 +0,0 @@
1SUMMARY = "Valgrind memory debugger and instrumentation framework"
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."
4BUGTRACKER = "http://valgrind.org/support/bug_reports.html"
5LICENSE = "GPL-2.0-only & GPL-2.0-or-later & BSD-3-Clause"
6LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
7 file://include/pub_tool_basics.h;beginline=6;endline=29;md5=41c410e8d3f305aee7aaa666b2e4f366 \
8 file://include/valgrind.h;beginline=1;endline=56;md5=ad3b317f3286b6b704575d9efe6ca5df \
9 file://COPYING.DOCS;md5=24ea4c7092233849b4394699333b5c56"
10
11DEPENDS = " \
12 ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'boost', '', d)} \
13 "
14
15SRC_URI = "https://sourceware.org/pub/valgrind/valgrind-${PV}.tar.bz2 \
16 file://fixed-perl-path.patch \
17 file://Added-support-for-PPC-instructions-mfatbu-mfatbl.patch \
18 file://run-ptest \
19 file://remove-for-aarch64 \
20 file://remove-for-all \
21 file://taskset_nondeterministic_tests \
22 file://0005-Modify-vg_test-wrapper-to-support-PTEST-formats.patch \
23 file://use-appropriate-march-mcpu-mfpu-for-ARM-test-apps.patch \
24 file://avoid-neon-for-targets-which-don-t-support-it.patch \
25 file://valgrind-make-ld-XXX.so-strlen-intercept-optional.patch \
26 file://0001-makefiles-Drop-setting-mcpu-to-cortex-a8-on-arm-arch.patch \
27 file://0001-sigqueue-Rename-_sifields-to-__si_fields-on-musl.patch \
28 file://0003-correct-include-directive-path-for-config.h.patch \
29 file://0001-Return-a-valid-exit_code-from-vg_regtest.patch \
30 file://0001-valgrind-filter_xml_frames-do-not-filter-usr.patch \
31 file://0001-memcheck-vgtests-remove-fullpath-after-flags.patch \
32 file://s390x_vec_op_t.patch \
33 file://0001-none-tests-fdleak_cmsg.stderr.exp-adjust-tmp-paths.patch \
34 file://0001-memcheck-tests-Fix-timerfd-syscall-test.patch \
35 file://0001-docs-Disable-manual-validation.patch \
36 file://0001-valgrind-monitor.py-regular-expressions-should-use-r.patch \
37 file://0002-Bug-476548-valgrind-3.22.0-fails-on-assertion-when-l.patch \
38 file://0003-Add-fchmodat2-syscall-on-linux.patch \
39 file://0004-Bug-478624-Valgrind-incompatibility-with-binutils-2..patch \
40 "
41SRC_URI[sha256sum] = "c811db5add2c5f729944caf47c4e7a65dcaabb9461e472b578765dd7bf6d2d4c"
42UPSTREAM_CHECK_REGEX = "valgrind-(?P<pver>\d+(\.\d+)+)\.tar"
43
44COMPATIBLE_HOST = '(i.86|x86_64|arm|aarch64|mips|powerpc|powerpc64).*-linux'
45
46# patch 0001-memcheck-vgtests-remove-fullpath-after-flags.patch removes relative path
47# argument. Change expected stderr files accordingly.
48do_patch:append() {
49 bb.build.exec_func('do_sed_paths', d)
50}
51
52do_sed_paths() {
53 sed -i -e 's|tests/||' ${S}/memcheck/tests/badfree3.stderr.exp
54 sed -i -e 's|tests/||' ${S}/memcheck/tests/varinfo5.stderr.exp
55}
56
57# valgrind supports armv7 and above
58COMPATIBLE_HOST:armv4 = 'null'
59COMPATIBLE_HOST:armv5 = 'null'
60COMPATIBLE_HOST:armv6 = 'null'
61
62# valgrind fails with powerpc soft-float
63COMPATIBLE_HOST:powerpc = "${@bb.utils.contains('TARGET_FPU', 'soft', 'null', '.*-linux', d)}"
64
65# X32 isn't supported by valgrind at this time
66COMPATIBLE_HOST:linux-gnux32 = 'null'
67COMPATIBLE_HOST:linux-muslx32 = 'null'
68
69# Disable for some MIPS variants
70COMPATIBLE_HOST:mipsarchr6 = 'null'
71COMPATIBLE_HOST:linux-gnun32 = 'null'
72
73# Disable for powerpc64 with musl
74COMPATIBLE_HOST:libc-musl:powerpc64 = 'null'
75
76# brokenseip is unfortunately required by ptests to pass
77inherit autotools-brokensep ptest multilib_header
78
79EXTRA_OECONF = "--enable-tls --without-mpicc"
80EXTRA_OECONF += "${@['--enable-only32bit','--enable-only64bit'][d.getVar('SITEINFO_BITS') != '32']}"
81
82# valgrind checks host_cpu "armv7*)", so we need to over-ride the autotools.bbclass default --host option
83EXTRA_OECONF:append:arm = " --host=armv7${HOST_VENDOR}-${HOST_OS}"
84
85EXTRA_OEMAKE = "-w"
86
87CACHED_CONFIGUREVARS += "ac_cv_path_PERL='/usr/bin/env perl'"
88
89# valgrind likes to control its own optimisation flags. It generally defaults
90# to -O2 but uses -O0 for some specific test apps etc. Passing our own flags
91# (via CFLAGS) means we interfere with that. Only pass DEBUG_FLAGS to it
92# which fixes build path issue in DWARF.
93SELECTED_OPTIMIZATION = "${DEBUG_FLAGS}"
94
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 () {
108 rm -rf ${S}/config.h
109 sed -i -e 's:$(abs_top_builddir):$(pkglibdir)/ptest:g' ${S}/none/tests/Makefile.am
110 sed -i -e 's:$(top_builddir):$(pkglibdir)/ptest:g' ${S}/memcheck/tests/Makefile.am
111}
112
113do_install:append () {
114 install -m 644 ${B}/default.supp ${D}/${libexecdir}/valgrind/
115 oe_multilib_header valgrind/config.h
116}
117
118VALGRINDARCH ?= "${TARGET_ARCH}"
119VALGRINDARCH:aarch64 = "arm64"
120VALGRINDARCH:x86-64 = "amd64"
121VALGRINDARCH:x86 = "x86"
122VALGRINDARCH:mips = "mips32"
123VALGRINDARCH:mipsel = "mips32"
124VALGRINDARCH:mips64el = "mips64"
125VALGRINDARCH:powerpc = "ppc"
126VALGRINDARCH:powerpc64 = "ppc64"
127VALGRINDARCH:powerpc64le = "ppc64le"
128
129INHIBIT_PACKAGE_STRIP_FILES = "${PKGD}${libexecdir}/valgrind/vgpreload_memcheck-${VALGRINDARCH}-linux.so"
130
131# valgrind needs debug information for ld.so at runtime in order to
132# redirect functions like strlen.
133RRECOMMENDS:${PN} += "${TCLIBC}-dbg"
134
135RDEPENDS:${PN}-ptest += " bash coreutils curl file \
136 gdb \
137 ${TCLIBC}-src gcc-runtime-dbg \
138 libgomp \
139 perl \
140 perl-module-file-basename perl-module-file-glob perl-module-getopt-long \
141 perl-module-overloading perl-module-cwd perl-module-ipc-open3 \
142 perl-module-carp perl-module-symbol \
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"
151
152# One of the tests contains a bogus interpreter path on purpose.
153# Skip file dependency check
154SKIP_FILEDEPS:${PN}-ptest = '1'
155INSANE_SKIP:${PN}-ptest = "debug-deps"
156
157do_compile_ptest() {
158 oe_runmake check
159}
160
161
162do_install_ptest() {
163 chmod +x ${B}/tests/vg_regtest
164
165 # The test application binaries are not automatically installed.
166 # Grab them from the build directory.
167 #
168 # The regression tests require scripts and data files that are not
169 # copied to the build directory. They must be copied from the
170 # source directory.
171 saved_dir=$PWD
172 for parent_dir in ${S} ${B} ; do
173 cd $parent_dir
174
175 subdirs=" \
176 .in_place \
177 cachegrind/tests \
178 callgrind/tests \
179 dhat/tests \
180 drd/tests \
181 gdbserver_tests \
182 helgrind/tests \
183 lackey/tests \
184 massif/tests \
185 memcheck/tests \
186 none/tests \
187 tests \
188 exp-bbv/tests \
189 "
190 # Get the vg test scripts, filters, and expected files
191 for dir in $subdirs ; do
192 find $dir | cpio -pvdu ${D}${PTEST_PATH}
193 done
194 cd $saved_dir
195 done
196
197 # The scripts reference config.h so add it to the top ptest dir.
198 cp ${B}/config.h ${D}${PTEST_PATH}
199 install -D ${WORKDIR}/remove-for-aarch64 ${D}${PTEST_PATH}
200 install -D ${WORKDIR}/remove-for-all ${D}${PTEST_PATH}
201 install -D ${WORKDIR}/taskset_nondeterministic_tests ${D}${PTEST_PATH}
202
203 # Add an executable need by none/tests/bigcode
204 mkdir ${D}${PTEST_PATH}/perf
205 cp ${B}/perf/bigcode ${D}${PTEST_PATH}/perf
206
207 # Add an executable needed by memcheck/tests/vcpu_bz2
208 cp ${B}/perf/bz2 ${D}${PTEST_PATH}/perf
209
210 # Make the ptest dir look like the top level valgrind src dir
211 # This is checked by the gdbserver_tests/make_local_links script
212 mkdir ${D}${PTEST_PATH}/coregrind
213 cp ${B}/coregrind/vgdb ${D}${PTEST_PATH}/coregrind
214
215 # Add an executable needed by massif tests
216 cp ${B}/massif/ms_print ${D}${PTEST_PATH}/massif/ms_print
217
218 find ${D}${PTEST_PATH} \
219 \( \
220 -name "Makefile*" \
221 -o -name "*.o" \
222 \) \
223 -exec rm {} \;
224
225 sed -i s:\.\./\.\./callgrind/callgrind_annotate:${bindir}/callgrind_annotate: ${D}${PTEST_PATH}/callgrind/tests/ann1.vgtest
226 sed -i s:\.\./\.\./callgrind/callgrind_annotate:${bindir}/callgrind_annotate: ${D}${PTEST_PATH}/callgrind/tests/ann2.vgtest
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
232 # handle multilib
233 sed -i s:@libdir@:${libdir}:g ${D}${PTEST_PATH}/run-ptest
234 sed -i s:@libexecdir@:${libexecdir}:g ${D}${PTEST_PATH}/run-ptest
235 sed -i s:@bindir@:${bindir}:g ${D}${PTEST_PATH}/run-ptest
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
242 # This test fails on the host as well, using both 3.15 and git master (as of Jan 24 2020)
243 # https://bugs.kde.org/show_bug.cgi?id=402833
244 rm ${D}${PTEST_PATH}/memcheck/tests/overlap.vgtest
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
252 # As the binary isn't stripped or debug-splitted, the source file isn't fetched
253 # via dwarfsrcfiles either, so it needs to be installed manually.
254 mkdir -p ${D}${TARGET_DBGSRC_DIR}/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
265}
266
267# avoid stripping some generated binaries otherwise some of the tests will fail
268# run-strip-reloc.sh, run-strip-strmerge.sh and so on will fail
269INHIBIT_PACKAGE_STRIP_FILES += "\
270 ${PKGD}${PTEST_PATH}/none/tests/tls \
271 ${PKGD}${PTEST_PATH}/none/tests/tls.so \
272 ${PKGD}${PTEST_PATH}/none/tests/tls2.so \
273 ${PKGD}${PTEST_PATH}/helgrind/tests/tc09_bad_unlock \
274 ${PKGD}${PTEST_PATH}/memcheck/tests/manuel1 \
275 ${PKGD}${PTEST_PATH}/drd/tests/pth_detached3 \
276"
diff --git a/meta/recipes-devtools/valgrind/valgrind_3.25.1.bb b/meta/recipes-devtools/valgrind/valgrind_3.25.1.bb
new file mode 100644
index 0000000000..a8b0be5767
--- /dev/null
+++ b/meta/recipes-devtools/valgrind/valgrind_3.25.1.bb
@@ -0,0 +1,116 @@
1SUMMARY = "Valgrind memory debugger and instrumentation framework"
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."
4BUGTRACKER = "http://valgrind.org/support/bug_reports.html"
5LICENSE = "GPL-2.0-only & GPL-2.0-or-later & BSD-3-Clause"
6LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
7 file://include/pub_tool_basics.h;beginline=6;endline=29;md5=41c410e8d3f305aee7aaa666b2e4f366 \
8 file://include/valgrind.h;beginline=1;endline=56;md5=ad3b317f3286b6b704575d9efe6ca5df \
9 file://COPYING.DOCS;md5=24ea4c7092233849b4394699333b5c56"
10
11SRC_URI = "https://sourceware.org/pub/valgrind/valgrind-${PV}.tar.bz2 \
12 file://fixed-perl-path.patch \
13 file://Added-support-for-PPC-instructions-mfatbu-mfatbl.patch \
14 file://use-appropriate-march-mcpu-mfpu-for-ARM-test-apps.patch \
15 file://avoid-neon-for-targets-which-don-t-support-it.patch \
16 file://0001-configure-Drop-setting-mcpu-cortex-a8-on-arm.patch \
17 file://valgrind-make-ld-XXX.so-strlen-intercept-optional.patch \
18 file://0001-makefiles-Drop-setting-mcpu-to-cortex-a8-on-arm-arch.patch \
19 file://0001-sigqueue-Rename-_sifields-to-__si_fields-on-musl.patch \
20 file://0003-correct-include-directive-path-for-config.h.patch \
21 file://0001-valgrind-filter_xml_frames-do-not-filter-usr.patch \
22 file://0001-memcheck-vgtests-remove-fullpath-after-flags.patch \
23 file://s390x_vec_op_t.patch \
24 file://0001-none-tests-fdleak_cmsg.stderr.exp-adjust-tmp-paths.patch \
25 file://0001-memcheck-tests-Fix-timerfd-syscall-test.patch \
26 file://0001-docs-Disable-manual-validation.patch \
27 file://0001-tests-arm-Use-O-instead-of-O0.patch \
28 file://0001-Use-portable-syntax-for-pushsection-directive-in-inl.patch \
29 "
30SRC_URI[sha256sum] = "61deb8d0727b45c268efdc1b3b6c9e679cd97cbf5ee4b28d1dead7c8b7a271af"
31UPSTREAM_CHECK_REGEX = "valgrind-(?P<pver>\d+(\.\d+)+)\.tar"
32
33COMPATIBLE_HOST = '(i.86|x86_64|arm|aarch64|mips|powerpc|powerpc64|riscv64).*-linux'
34
35# valgrind supports armv7 and above
36COMPATIBLE_HOST:armv4 = 'null'
37COMPATIBLE_HOST:armv5 = 'null'
38COMPATIBLE_HOST:armv6 = 'null'
39
40# valgrind fails with powerpc soft-float
41COMPATIBLE_HOST:powerpc = "${@bb.utils.contains('TARGET_FPU', 'soft', 'null', '.*-linux', d)}"
42
43# X32 isn't supported by valgrind at this time
44COMPATIBLE_HOST:linux-gnux32 = 'null'
45COMPATIBLE_HOST:linux-muslx32 = 'null'
46
47# Disable for some MIPS variants
48COMPATIBLE_HOST:mipsarchr6 = 'null'
49COMPATIBLE_HOST:linux-gnun32 = 'null'
50
51# Disable for powerpc64 with musl
52COMPATIBLE_HOST:libc-musl:powerpc64 = 'null'
53
54inherit autotools-brokensep multilib_header
55
56EXTRA_OECONF = "--enable-tls --without-mpicc"
57EXTRA_OECONF += "${@['--enable-only32bit','--enable-only64bit'][d.getVar('SITEINFO_BITS') != '32']}"
58
59# valgrind checks host_cpu "armv7*)", so we need to over-ride the autotools.bbclass default --host option
60EXTRA_OECONF:append:arm = " --host=armv7${HOST_VENDOR}-${HOST_OS}"
61
62EXTRA_OEMAKE = "-w"
63
64CACHED_CONFIGUREVARS += "ac_cv_path_PERL='/usr/bin/env perl'"
65
66# valgrind likes to control its own optimisation flags. It generally defaults
67# to -O2 but uses -O0 for some specific test apps etc. Passing our own flags
68# (via CFLAGS) means we interfere with that. Only pass DEBUG_FLAGS to it
69# which fixes build path issue in DWARF.
70SELECTED_OPTIMIZATION = "${DEBUG_LEVELFLAG}"
71
72# Split out various helper scripts to separate packages to avoid the
73# main package depending on perl and python.
74PACKAGES =+ "${PN}-cachegrind ${PN}-massif ${PN}-callgrind"
75
76FILES:${PN}-cachegrind = "${bindir}/cg_*"
77FILES:${PN}-massif = "${bindir}/ms_*"
78FILES:${PN}-callgrind = "${bindir}/callgrind_*"
79
80RDEPENDS:${PN}-cachegrind = "${PN} python3-core"
81RDEPENDS:${PN}-massif = "${PN} perl"
82RDEPENDS:${PN}-callgrind = "${PN} perl"
83
84do_configure:prepend () {
85 rm -rf ${S}/config.h
86}
87
88do_install:append () {
89 install -m 644 ${B}/default.supp ${D}/${libexecdir}/valgrind/
90 oe_multilib_header valgrind/config.h
91}
92
93VALGRINDARCH ?= "${TARGET_ARCH}"
94VALGRINDARCH:aarch64 = "arm64"
95VALGRINDARCH:x86-64 = "amd64"
96VALGRINDARCH:x86 = "x86"
97VALGRINDARCH:mips = "mips32"
98VALGRINDARCH:mipsel = "mips32"
99VALGRINDARCH:mips64el = "mips64"
100VALGRINDARCH:powerpc = "ppc"
101VALGRINDARCH:powerpc64 = "ppc64"
102VALGRINDARCH:powerpc64le = "ppc64le"
103
104INHIBIT_PACKAGE_STRIP_FILES = "${PKGD}${libexecdir}/valgrind/vgpreload_memcheck-${VALGRINDARCH}-linux.so"
105
106# valgrind needs debug information for ld.so at runtime in order to
107# redirect functions like strlen.
108RRECOMMENDS:${PN} += "${TCLIBC}-dbg"
109
110# Valgrind needs intrinsics which are not provided by clang
111# m_signals.c:2213:7: error: __builtin_longjmp is not supported for the current target
112# 2213 | VG_MINIMAL_LONGJMP(tst->sched_jmpbuf);
113# | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
114#
115# It needs something like - https://bugs.kde.org/show_bug.cgi?id=369723
116TOOLCHAIN:riscv64 = "gcc"