Complete Yocto mirror with license table for TQMa6UL (2038-compliance)

- 264 license table entries with exact download URLs (224/264 resolved)
- Complete sources/ directory with all BitBake recipes
- Build configuration: tqma6ul-multi-mba6ulx, spaetzle (musl)
- Full traceability for Softwarefreigabeantrag
- GCC 13.4.0, Linux 6.6.102, U-Boot 2023.04, musl 1.2.4
- License distribution: GPL-2.0 (24), MIT (23), GPL-2.0+ (18), BSD-3 (16)
This commit is contained in:
Siggi (OpenClaw Agent)
2026-03-01 20:58:18 +00:00
commit 16accb6b24
15086 changed files with 1292356 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
From 5eebdefd2251803e7d21081745018fcb16b2ba71 Mon Sep 17 00:00:00 2001
From: Randy MacLeod <Randy.MacLeod@windriver.com>
Date: Wed, 8 May 2019 20:16:52 -0400
Subject: [PATCH] Return a valid exit_code from vg_regtest
Upstream-Status: Pending
Signed-off-by: Randy MacLeod <Randy.MacLeod@windriver.com>
---
tests/vg_regtest.in | 1 +
1 file changed, 1 insertion(+)
diff --git a/tests/vg_regtest.in b/tests/vg_regtest.in
index 909af3be8..f2799c4e3 100755
--- a/tests/vg_regtest.in
+++ b/tests/vg_regtest.in
@@ -403,6 +403,7 @@ sub mysystem($)
exit 1;
}
}
+ return $exit_code;
}
# if $keepunfiltered, copies $1 to $1.unfiltered.out
# renames $0 tp $1
--
2.17.0

View File

@@ -0,0 +1,36 @@
From 99fc6fe9b66becac3c94068129e84217330a71a6 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 13 Jan 2022 18:26:02 -0800
Subject: [PATCH] docs: Disable manual validation
validating manual and manpages, this task involves calling xmllint which
accesses network and --nonet option also does not disable this,
therefore disable it.
Fixes
| error : Resource temporarily unavailable
| ../callgrind/docs/cl-manual.xml:4: warning: failed to load external entity "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
| <!ENTITY % vg-entities SYSTEM "../../docs/xml/vg-entities.xml"> %vg-entities; ]
Upstream-Status: Inappropriate [OE-Specific]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
docs/Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/Makefile.am b/docs/Makefile.am
index d4250e8..c500306 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -192,7 +192,7 @@ valid-manpages: $(MANPAGES_XML_FILES)
touch $@; \
fi
-check-local: valid-manual valid-manpages
+check-local:
# The text version of the FAQ.
FAQ.txt:
--
2.34.1

View File

@@ -0,0 +1,108 @@
From 715cf122388f3527afa5649cebf9f1522c240693 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 20 Apr 2017 10:11:16 -0700
Subject: [PATCH] makefiles: Drop setting -mcpu to cortex-a8 on arm
architecture
We can not assume that all arches armv7+ are cortex-a8 only
it fails to build for rpi which is armv7ve based (cortex-a8) cpu
implementation.
Fixes
| cc1: warning: switch -mcpu=cortex-a8 conflicts with -march=armv7ve switch
Upstream-Status: Submitted [https://bugs.kde.org/show_bug.cgi?id=454346]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
Makefile.all.am | 6 +++---
helgrind/tests/Makefile.am | 6 +++---
none/tests/arm/Makefile.am | 18 +++++++++---------
3 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/Makefile.all.am b/Makefile.all.am
index 02059a3..c7c4700 100644
--- a/Makefile.all.am
+++ b/Makefile.all.am
@@ -197,11 +197,11 @@ AM_CCASFLAGS_PPC64LE_LINUX = @FLAG_M64@ -g
AM_FLAG_M3264_ARM_LINUX = @FLAG_M32@
AM_CFLAGS_ARM_LINUX = @FLAG_M32@ \
- $(AM_CFLAGS_BASE) -marm -mcpu=cortex-a8
+ $(AM_CFLAGS_BASE) -marm
AM_CFLAGS_PSO_ARM_LINUX = @FLAG_M32@ $(AM_CFLAGS_BASE) \
- -marm -mcpu=cortex-a8 $(AM_CFLAGS_PSO_BASE)
+ -marm $(AM_CFLAGS_PSO_BASE)
AM_CCASFLAGS_ARM_LINUX = @FLAG_M32@ \
- -marm -mcpu=cortex-a8 -g
+ -marm -g
AM_FLAG_M3264_ARM64_LINUX = @FLAG_M64@
AM_CFLAGS_ARM64_LINUX = @FLAG_M64@ $(AM_CFLAGS_BASE)
diff --git a/helgrind/tests/Makefile.am b/helgrind/tests/Makefile.am
index df82169..07eb66a 100644
--- a/helgrind/tests/Makefile.am
+++ b/helgrind/tests/Makefile.am
@@ -189,9 +189,9 @@ if ! VGCONF_PLATFORMS_INCLUDE_X86_DARWIN
endif
if VGCONF_PLATFORMS_INCLUDE_ARM_LINUX
-annotate_hbefore_CFLAGS = $(AM_CFLAGS) -mcpu=cortex-a8
-tc07_hbl1_CFLAGS = $(AM_CFLAGS) -mcpu=cortex-a8
-tc08_hbl2_CFLAGS = $(AM_CFLAGS) -mcpu=cortex-a8
+annotate_hbefore_CFLAGS = $(AM_CFLAGS)
+tc07_hbl1_CFLAGS = $(AM_CFLAGS)
+tc08_hbl2_CFLAGS = $(AM_CFLAGS)
else
annotate_hbefore_CFLAGS = $(AM_CFLAGS)
tc07_hbl1_CFLAGS = $(AM_CFLAGS)
diff --git a/none/tests/arm/Makefile.am b/none/tests/arm/Makefile.am
index 024eb6d..ccecb90 100644
--- a/none/tests/arm/Makefile.am
+++ b/none/tests/arm/Makefile.am
@@ -52,10 +52,10 @@ allexec_CFLAGS = $(AM_CFLAGS) @FLAG_W_NO_NONNULL@
# need special helping w.r.t -mfpu and -mfloat-abi, though.
# Also force -O0 since -O takes hundreds of MB of memory
# for v6intThumb.c.
-v6intARM_CFLAGS = $(AM_CFLAGS) -g -O0 -mcpu=cortex-a8 -marm
-v6intThumb_CFLAGS = $(AM_CFLAGS) -g -O0 -mcpu=cortex-a8 -mthumb
+v6intARM_CFLAGS = $(AM_CFLAGS) -g -O0 -marm
+v6intThumb_CFLAGS = $(AM_CFLAGS) -g -O0 -mthumb
-v6media_CFLAGS = $(AM_CFLAGS) -g -O0 -mcpu=cortex-a8 -mthumb
+v6media_CFLAGS = $(AM_CFLAGS) -g -O0 -mthumb
v8crypto_a_CFLAGS = $(AM_CFLAGS) -g -O0 -mfpu=crypto-neon-fp-armv8 -marm
v8crypto_t_CFLAGS = $(AM_CFLAGS) -g -O0 -mfpu=crypto-neon-fp-armv8 -mthumb
@@ -65,23 +65,23 @@ v8memory_a_CFLAGS = $(AM_CFLAGS) -g -O0 \
v8memory_t_CFLAGS = $(AM_CFLAGS) -g -O0 \
-march=armv8-a -mfpu=crypto-neon-fp-armv8 -mthumb
-vfp_CFLAGS = $(AM_CFLAGS) -g -O0 -mcpu=cortex-a8 \
+vfp_CFLAGS = $(AM_CFLAGS) -g -O0 \
-mfpu=neon \
-mthumb
-neon128_CFLAGS = $(AM_CFLAGS) -g -O0 -mcpu=cortex-a8 \
+neon128_CFLAGS = $(AM_CFLAGS) -g -O0 \
-mfpu=neon \
-mthumb
-neon64_CFLAGS = $(AM_CFLAGS) -g -O0 -mcpu=cortex-a8 \
+neon64_CFLAGS = $(AM_CFLAGS) -g -O0 \
-mfpu=neon \
-mthumb
intdiv_CFLAGS = $(AM_CFLAGS) -g -march=armv7ve -mcpu=cortex-a15 -mthumb
-ldrt_CFLAGS = $(AM_CFLAGS) -g -mcpu=cortex-a8 -mthumb
-ldrt_arm_CFLAGS = $(AM_CFLAGS) -g -mcpu=cortex-a8 -marm
+ldrt_CFLAGS = $(AM_CFLAGS) -g -mthumb
+ldrt_arm_CFLAGS = $(AM_CFLAGS) -g -marm
-vcvt_fixed_float_VFP_CFLAGS = $(AM_CFLAGS) -g -mcpu=cortex-a8 -mfpu=vfpv3
+vcvt_fixed_float_VFP_CFLAGS = $(AM_CFLAGS) -g -mfpu=vfpv3
vfpv4_fma_CFLAGS = $(AM_CFLAGS) -g -O0 -march=armv7ve -mcpu=cortex-a15 -mfpu=vfpv4 -marm
--
2.12.2

View File

@@ -0,0 +1,98 @@
From 5d411fd147d652e9d7bb259f4048693c6e4742aa Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 9 Mar 2020 16:30:19 -0700
Subject: [PATCH] memcheck/tests: Fix timerfd syscall test
modern libc provides these functions, moreover this also ensures that we
are 64bit time_t safe. Fallback to existing definitions if libc does not
have the implementation or syscall is not defined
Upstream-Status: Submitted [https://sourceforge.net/p/valgrind/mailman/message/36943897/]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
config.h.in | 9 +++++++++
configure.ac | 3 +++
memcheck/tests/linux/timerfd-syscall.c | 10 ++++++++--
5 files changed, 32 insertions(+), 2 deletions(-)
--- a/config.h.in
+++ b/config.h.in
@@ -301,6 +301,9 @@
/* Define to 1 if you have the <sys/sysnvl.h> header file. */
#undef HAVE_SYS_SYSNVL_H
+/* Define to 1 if you have the <sys/timerfd.h> header file. */
+#undef HAVE_SYS_TIMERFD_H
+
/* Define to 1 if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
--- a/configure.ac
+++ b/configure.ac
@@ -4098,6 +4098,7 @@ AC_CHECK_HEADERS([ \
sys/syscall.h \
sys/sysnvl.h \
sys/time.h \
+ sys/timerfd.h \
sys/types.h \
])
--- a/memcheck/tests/linux/timerfd-syscall.c
+++ b/memcheck/tests/linux/timerfd-syscall.c
@@ -45,6 +45,9 @@
#if defined(HAVE_SYS_TIME_H)
#include <sys/time.h>
#endif
+#if defined(HAVE_SYS_TIMERFD_H)
+#include <sys/timerfd.h>
+#endif
#if defined(HAVE_SYS_TYPES_H)
#include <sys/types.h>
#endif
@@ -54,7 +57,8 @@
* timerfd_* system call numbers introduced in 2.6.23. These constants are
* not yet in the glibc 2.7 headers, that is why they are defined here.
*/
-#ifndef __NR_timerfd_create
+#if !defined(HAVE_SYS_TIMERFD_H)
+#if !defined(__NR_timerfd_create)
#if defined(__x86_64__)
#define __NR_timerfd_create 283
#elif defined(__i386__)
@@ -67,8 +71,10 @@
#error Cannot detect your architecture!
#endif
#endif
+#endif
-#ifndef __NR_timerfd_settime
+#if !defined(HAVE_SYS_TIMERFD_H)
+#if !defined(__NR_timerfd_settime)
#if defined(__x86_64__)
#define __NR_timerfd_settime 286
#define __NR_timerfd_gettime 287
@@ -85,7 +91,7 @@
#error Cannot detect your architecture!
#endif
#endif
-
+#endif
/* Definitions from include/linux/timerfd.h */
@@ -127,6 +133,7 @@ void set_timespec(struct timespec *tmr,
tmr->tv_nsec = (long) (1000ULL * (ustime % 1000000ULL));
}
+#if !defined(HAVE_SYS_TIMERFD_H)
int timerfd_create(int clockid, int flags)
{
return syscall(__NR_timerfd_create, clockid, flags);
@@ -142,6 +149,7 @@ int timerfd_gettime(int ufc, struct itim
{
return syscall(__NR_timerfd_gettime, ufc, otmr);
}
+#endif
long waittmr(int tfd, int timeo)
{

View File

@@ -0,0 +1,42 @@
From 3ff82dcb844f98dbf67c69f11f6516bc234725a9 Mon Sep 17 00:00:00 2001
From: Stacy Gaikovaia <Stacy.Gaikovaia@windriver.com>
Date: Wed, 16 Sep 2020 13:45:07 -0400
Subject: [PATCH] memcheck vgtests remove fullpath-after flags
Test executables produced when cross-compiling can contain
relative paths containing version number, such as:
coregrind/tests/../../../valgrind-3.16.1/coregrind
Remove the --fullpath-after option so yocto project doesn't
have to upgrade patch every valgrind uprev. Upgrade test stderr
paths in corresponding tests .bb script.
Upstream-Status: Inappropriate [embedded specific]
Signed-off-by: Stacy Gaikovaia <Stacy.Gaikovaia@windriver.com>
---
memcheck/tests/badfree3.vgtest | 2 +-
memcheck/tests/varinfo5.vgtest | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/memcheck/tests/badfree3.vgtest b/memcheck/tests/badfree3.vgtest
index 3dfc5fd8a..4ee03f00a 100644
--- a/memcheck/tests/badfree3.vgtest
+++ b/memcheck/tests/badfree3.vgtest
@@ -1,3 +1,3 @@
prog: badfree
-vgopts: -q --fullpath-after=memcheck/ --fullpath-after=coregrind/
+vgopts: -q
stderr_filter_args: badfree.c
diff --git a/memcheck/tests/varinfo5.vgtest b/memcheck/tests/varinfo5.vgtest
index 063d00dce..79c4a72a4 100644
--- a/memcheck/tests/varinfo5.vgtest
+++ b/memcheck/tests/varinfo5.vgtest
@@ -1,3 +1,3 @@
prog: varinfo5
-vgopts: --fullpath-after=memcheck/ --fullpath-after=coregrind/ --read-var-info=yes --read-inline-info=yes -q
+vgopts: --read-var-info=yes --read-inline-info=yes -q
stderr_filter: filter_varinfo3
--
2.25.1

View File

@@ -0,0 +1,34 @@
From f405297d3382cd98391d02f397e2387da1f42879 Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex.kanavin@gmail.com>
Date: Fri, 24 Jan 2020 17:55:39 +0100
Subject: [PATCH] none/tests/fdleak_cmsg.stderr.exp: adjust /tmp paths
In oe-core, /tmp is linked to /var/volatile/tmp and
valgrind output changes accordingly
Upstream-Status: Inappropriate [oe-core specific]
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
---
none/tests/fdleak_cmsg.stderr.exp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/none/tests/fdleak_cmsg.stderr.exp b/none/tests/fdleak_cmsg.stderr.exp
index 6e5a797b9..0ede1ab18 100644
--- a/none/tests/fdleak_cmsg.stderr.exp
+++ b/none/tests/fdleak_cmsg.stderr.exp
@@ -25,10 +25,10 @@ Open file descriptor ...: /dev/null
FILE DESCRIPTORS: 6 open (3 std) at exit.
-Open file descriptor ...: /tmp/data2
+Open file descriptor ...: ...
...
-Open file descriptor ...: /tmp/data1
+Open file descriptor ...: ...
...
Open AF_UNIX socket ...: <unknown>
--
2.17.1

View File

@@ -0,0 +1,31 @@
From 64ad2744acfb4fa40b1c114633a053f87125a203 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 10 Jun 2017 00:46:39 -0700
Subject: [PATCH 1/6] sigqueue: Rename _sifields to __si_fields on musl
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
memcheck/tests/linux/sigqueue.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/memcheck/tests/linux/sigqueue.c b/memcheck/tests/linux/sigqueue.c
index d18bd72..acb7cba 100644
--- a/memcheck/tests/linux/sigqueue.c
+++ b/memcheck/tests/linux/sigqueue.c
@@ -8,6 +8,11 @@
#include <syscall.h>
#include <unistd.h>
+/* musl libc defines siginfo_t __si_fields instead of _sifields */
+#if defined(__linux__) && !defined(__GLIBC__)
+#define _sifields __si_fields
+#endif
+
int main(int argc, char **argv)
{
siginfo_t *si;
--
2.13.1

View File

@@ -0,0 +1,39 @@
From d1dea3c2bcf1e22baab39e2c0b8ca59db8a5bc37 Mon Sep 17 00:00:00 2001
From: Randy MacLeod <Randy.MacLeod@windriver.com>
Date: Mon, 13 May 2019 17:12:21 -0400
Subject: [PATCH 1/2] valgrind: filter_xml_frames: do not filter /usr
filter_xml_frames is intended to filter system paths under
'/usr' that vary from platform to platform. In the ptest case
for Yocto's valgrind, the ptest executables are placed under:
/usr/lib/valgrind/ptest
and if these frames are filtered out, then the 'drd' tests fail
the comparision between exepected and actual output.
Changing this filter allows the comparison to succeed without
any negative impact.
Upstream-Status: Inappropriate [Yocto specific]
Signed-off-by: Randy MacLeod <Randy.MacLeod@windriver.com>
---
tests/filter_xml_frames | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tests/filter_xml_frames b/tests/filter_xml_frames
index f1fa3f070..04fbc82de 100755
--- a/tests/filter_xml_frames
+++ b/tests/filter_xml_frames
@@ -47,7 +47,8 @@ while (my $line = <>)
$has_function_name = 1 if ($line =~ /<fn>/);
# This may require tweaking; currently /lib and /usr/lib are matched
$has_system_obj = 1 if ($line =~ /<obj>\/lib/);
- $has_system_obj = 1 if ($line =~ /<obj>\/usr\/lib/);
+# for Yocto, skip /usr since tests are under /usr/lib/...
+# $has_system_obj = 1 if ($line =~ /<obj>\/usr\/lib/);
}
}
--
2.17.0

View File

@@ -0,0 +1,64 @@
From 027b649fdb831868e71be01cafdacc49a5f419ab Mon Sep 17 00:00:00 2001
From: Mark Wielaard <mark@klomp.org>
Date: Fri, 17 Nov 2023 14:01:21 +0100
Subject: [PATCH 1/4] valgrind-monitor.py regular expressions should use raw
strings
With python 3.12 gdb will produce the following SyntaxWarning when
loading valgrind-monitor-def.py:
/usr/share/gdb/auto-load/valgrind-monitor-def.py:214:
SyntaxWarning: invalid escape sequence '\['
if re.fullmatch("^0x[0123456789ABCDEFabcdef]+\[[^\[\]]+\]$", arg_str):
In a future python version this will become an SyntaxError.
Use a raw strings for the regular expression.
https://bugs.kde.org/show_bug.cgi?id=476708
(cherry picked from commit 0fbfbe05028ad18efda786a256a2738d2c231ed4)
Upstream-Status: Backport [https://sourceware.org/git/?p=valgrind.git;a=commit;h=027b649fdb831868e71be01cafdacc49a5f419ab]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
NEWS | 13 +++++++++++++
coregrind/m_gdbserver/valgrind-monitor-def.py | 2 +-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/NEWS b/NEWS
index f11da4be8..ee5b4ff11 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,16 @@
+Branch 3.22
+~~~~~~~~~~~
+
+* ==================== FIXED BUGS ====================
+
+The following bugs have been fixed or resolved on this branch.
+
+476708 valgrind-monitor.py regular expressions should use raw strings
+
+To see details of a given bug, visit
+ https://bugs.kde.org/show_bug.cgi?id=XXXXXX
+where XXXXXX is the bug number as listed above.
+
Release 3.22.0 (31 Oct 2023)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/coregrind/m_gdbserver/valgrind-monitor-def.py b/coregrind/m_gdbserver/valgrind-monitor-def.py
index b4e7b992d..d74b1590c 100644
--- a/coregrind/m_gdbserver/valgrind-monitor-def.py
+++ b/coregrind/m_gdbserver/valgrind-monitor-def.py
@@ -211,7 +211,7 @@ class Valgrind_ADDR_LEN_opt(Valgrind_Command):
For compatibility reason with the Valgrind gdbserver monitor command,
we detect and accept usages such as 0x1234ABCD[10]."""
def invoke(self, arg_str : str, from_tty : bool) -> None:
- if re.fullmatch("^0x[0123456789ABCDEFabcdef]+\[[^\[\]]+\]$", arg_str):
+ if re.fullmatch(r"^0x[0123456789ABCDEFabcdef]+\[[^\[\]]+\]$", arg_str):
arg_str = arg_str.replace("[", " ")
arg_str = arg_str.replace("]", " ")
eval_execute_2(self, arg_str,
--
2.44.0

View File

@@ -0,0 +1,147 @@
From 1d00e5ce0fb069911c4b525ec38289fb5d9021b0 Mon Sep 17 00:00:00 2001
From: Paul Floyd <pjfloyd@wanadoo.fr>
Date: Sat, 18 Nov 2023 08:49:34 +0100
Subject: [PATCH 2/4] Bug 476548 - valgrind 3.22.0 fails on assertion when
loading debuginfo file produced by mold
(cherry picked from commit 9ea4ae66707a4dcc6f4328e11911652e4418c585)
Upstream-Status: Backport [https://sourceware.org/git/?p=valgrind.git;a=commit;h=1d00e5ce0fb069911c4b525ec38289fb5d9021b0]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
NEWS | 2 ++
coregrind/m_debuginfo/image.c | 14 +++++++++
coregrind/m_debuginfo/priv_image.h | 4 +++
coregrind/m_debuginfo/readelf.c | 49 ++++++++++++++++++++++++++++--
4 files changed, 66 insertions(+), 3 deletions(-)
diff --git a/NEWS b/NEWS
index ee5b4ff11..6cd13429a 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,8 @@ Branch 3.22
The following bugs have been fixed or resolved on this branch.
+476548 valgrind 3.22.0 fails on assertion when loading debuginfo
+ file produced by mold
476708 valgrind-monitor.py regular expressions should use raw strings
To see details of a given bug, visit
diff --git a/coregrind/m_debuginfo/image.c b/coregrind/m_debuginfo/image.c
index 02e509071..445f95555 100644
--- a/coregrind/m_debuginfo/image.c
+++ b/coregrind/m_debuginfo/image.c
@@ -1221,6 +1221,20 @@ Int ML_(img_strcmp_c)(DiImage* img, DiOffT off1, const HChar* str2)
}
}
+Int ML_(img_strcmp_n)(DiImage* img, DiOffT off1, const HChar* str2, Word n)
+{
+ ensure_valid(img, off1, 1, "ML_(img_strcmp_c)");
+ while (n) {
+ UChar c1 = get(img, off1);
+ UChar c2 = *(const UChar*)str2;
+ if (c1 < c2) return -1;
+ if (c1 > c2) return 1;
+ if (c1 == 0) return 0;
+ off1++; str2++; --n;
+ }
+ return 0;
+}
+
UChar ML_(img_get_UChar)(DiImage* img, DiOffT offset)
{
ensure_valid(img, offset, 1, "ML_(img_get_UChar)");
diff --git a/coregrind/m_debuginfo/priv_image.h b/coregrind/m_debuginfo/priv_image.h
index a49846f14..c91e49f01 100644
--- a/coregrind/m_debuginfo/priv_image.h
+++ b/coregrind/m_debuginfo/priv_image.h
@@ -115,6 +115,10 @@ Int ML_(img_strcmp)(DiImage* img, DiOffT off1, DiOffT off2);
cast to HChar before comparison. */
Int ML_(img_strcmp_c)(DiImage* img, DiOffT off1, const HChar* str2);
+/* Do strncmp of a C string in the image vs a normal one. Chars are
+ cast to HChar before comparison. */
+Int ML_(img_strcmp_n)(DiImage* img, DiOffT off1, const HChar* str2, Word n);
+
/* Do strlen of a C string in the image. */
SizeT ML_(img_strlen)(DiImage* img, DiOffT off);
diff --git a/coregrind/m_debuginfo/readelf.c b/coregrind/m_debuginfo/readelf.c
index fb64ed976..46f8c8343 100644
--- a/coregrind/m_debuginfo/readelf.c
+++ b/coregrind/m_debuginfo/readelf.c
@@ -2501,8 +2501,7 @@ Bool ML_(read_elf_object) ( struct _DebugInfo* di )
di->rodata_avma += inrw1->bias;
di->rodata_bias = inrw1->bias;
di->rodata_debug_bias = inrw1->bias;
- }
- else {
+ } else {
BAD(".rodata"); /* should not happen? */
}
di->rodata_present = True;
@@ -2977,6 +2976,46 @@ Bool ML_(read_elf_object) ( struct _DebugInfo* di )
return retval;
}
+static void find_rodata(Word i, Word shnum, DiImage* dimg, struct _DebugInfo* di, DiOffT shdr_dioff,
+ UWord shdr_dent_szB, DiOffT shdr_strtab_dioff, PtrdiffT rw_dbias)
+{
+ ElfXX_Shdr a_shdr;
+ ElfXX_Shdr a_extra_shdr;
+ ML_(img_get)(&a_shdr, dimg,
+ INDEX_BIS(shdr_dioff, i, shdr_dent_szB),
+ sizeof(a_shdr));
+ if (di->rodata_present &&
+ 0 == ML_(img_strcmp_c)(dimg, shdr_strtab_dioff
+ + a_shdr.sh_name, ".rodata")) {
+ Word sh_size = a_shdr.sh_size;
+ Word j;
+ Word next_addr = a_shdr.sh_addr + a_shdr.sh_size;
+ for (j = i + 1; j < shnum; ++j) {
+ ML_(img_get)(&a_extra_shdr, dimg,
+ INDEX_BIS(shdr_dioff, j, shdr_dent_szB),
+ sizeof(a_shdr));
+ if (0 == ML_(img_strcmp_n)(dimg, shdr_strtab_dioff
+ + a_extra_shdr.sh_name, ".rodata", 7)) {
+ if (a_extra_shdr.sh_addr ==
+ VG_ROUNDUP(next_addr, a_extra_shdr.sh_addralign)) {
+ sh_size = VG_ROUNDUP(sh_size, a_extra_shdr.sh_addralign) + a_extra_shdr.sh_size;
+ }
+ next_addr = a_extra_shdr.sh_addr + a_extra_shdr.sh_size;
+ } else {
+ break;
+ }
+ }
+ vg_assert(di->rodata_size == sh_size);
+ vg_assert(di->rodata_avma + a_shdr.sh_addr + rw_dbias);
+ di->rodata_debug_svma = a_shdr.sh_addr;
+ di->rodata_debug_bias = di->rodata_bias +
+ di->rodata_svma - di->rodata_debug_svma;
+ TRACE_SYMTAB("acquiring .rodata debug svma = %#lx .. %#lx\n",
+ di->rodata_debug_svma,
+ di->rodata_debug_svma + di->rodata_size - 1);
+ TRACE_SYMTAB("acquiring .rodata debug bias = %#lx\n", (UWord)di->rodata_debug_bias);
+ }
+}
Bool ML_(read_elf_debug) ( struct _DebugInfo* di )
{
Word i, j;
@@ -3391,7 +3430,11 @@ Bool ML_(read_elf_debug) ( struct _DebugInfo* di )
FIND(text, rx)
FIND(data, rw)
FIND(sdata, rw)
- FIND(rodata, rw)
+ // https://bugs.kde.org/show_bug.cgi?id=476548
+ // special handling for rodata as adjacent
+ // rodata sections may have been merged in ML_(read_elf_object)
+ //FIND(rodata, rw)
+ find_rodata(i, ehdr_dimg.e_shnum, dimg, di, shdr_dioff, shdr_dent_szB, shdr_strtab_dioff, rw_dbias);
FIND(bss, rw)
FIND(sbss, rw)
--
2.44.0

View File

@@ -0,0 +1,221 @@
From a43e62dddcf51ec6578a90c5988a41e856b44b05 Mon Sep 17 00:00:00 2001
From: Mark Wielaard <mark@klomp.org>
Date: Sat, 18 Nov 2023 21:17:02 +0100
Subject: [PATCH 3/4] Add fchmodat2 syscall on linux
fchmodat2 is a new syscall on linux 6.6. It is a variant of fchmodat
that takes an extra flags argument.
https://bugs.kde.org/show_bug.cgi?id=477198
(cherry picked from commit 372d09fd9a8d76847c81092ebff71c80fd6c145d)
Upstream-Status: Backport [https://sourceware.org/git/?p=valgrind.git;a=commit;h=a43e62dddcf51ec6578a90c5988a41e856b44b05]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
NEWS | 1 +
coregrind/m_syswrap/priv_syswrap-linux.h | 3 +++
coregrind/m_syswrap/syswrap-amd64-linux.c | 2 ++
coregrind/m_syswrap/syswrap-arm-linux.c | 2 ++
coregrind/m_syswrap/syswrap-arm64-linux.c | 2 ++
coregrind/m_syswrap/syswrap-linux.c | 11 +++++++++++
coregrind/m_syswrap/syswrap-mips32-linux.c | 2 ++
coregrind/m_syswrap/syswrap-mips64-linux.c | 1 +
coregrind/m_syswrap/syswrap-nanomips-linux.c | 1 +
coregrind/m_syswrap/syswrap-ppc32-linux.c | 2 ++
coregrind/m_syswrap/syswrap-ppc64-linux.c | 2 ++
coregrind/m_syswrap/syswrap-s390x-linux.c | 2 ++
coregrind/m_syswrap/syswrap-x86-linux.c | 2 ++
include/vki/vki-scnums-shared-linux.h | 2 ++
14 files changed, 35 insertions(+)
diff --git a/NEWS b/NEWS
index 6cd13429a..da0f8c1aa 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,7 @@ The following bugs have been fixed or resolved on this branch.
476548 valgrind 3.22.0 fails on assertion when loading debuginfo
file produced by mold
476708 valgrind-monitor.py regular expressions should use raw strings
+477198 Add fchmodat2 syscall on linux
To see details of a given bug, visit
https://bugs.kde.org/show_bug.cgi?id=XXXXXX
diff --git a/coregrind/m_syswrap/priv_syswrap-linux.h b/coregrind/m_syswrap/priv_syswrap-linux.h
index 7c9decf5a..798c456c9 100644
--- a/coregrind/m_syswrap/priv_syswrap-linux.h
+++ b/coregrind/m_syswrap/priv_syswrap-linux.h
@@ -331,6 +331,9 @@ DECL_TEMPLATE(linux, sys_openat2);
// Linux-specific (new in Linux 5.14)
DECL_TEMPLATE(linux, sys_memfd_secret);
+// Since Linux 6.6
+DECL_TEMPLATE(linux, sys_fchmodat2);
+
/* ---------------------------------------------------------------------
Wrappers for sockets and ipc-ery. These are split into standalone
procedures because x86-linux hides them inside multiplexors
diff --git a/coregrind/m_syswrap/syswrap-amd64-linux.c b/coregrind/m_syswrap/syswrap-amd64-linux.c
index 008600798..fe17d118b 100644
--- a/coregrind/m_syswrap/syswrap-amd64-linux.c
+++ b/coregrind/m_syswrap/syswrap-amd64-linux.c
@@ -886,6 +886,8 @@ static SyscallTableEntry syscall_table[] = {
LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), // 441
LINXY(__NR_memfd_secret, sys_memfd_secret), // 447
+
+ LINX_(__NR_fchmodat2, sys_fchmodat2), // 452
};
SyscallTableEntry* ML_(get_linux_syscall_entry) ( UInt sysno )
diff --git a/coregrind/m_syswrap/syswrap-arm-linux.c b/coregrind/m_syswrap/syswrap-arm-linux.c
index 9a7a1e0d2..811931d3b 100644
--- a/coregrind/m_syswrap/syswrap-arm-linux.c
+++ b/coregrind/m_syswrap/syswrap-arm-linux.c
@@ -1059,6 +1059,8 @@ static SyscallTableEntry syscall_main_table[] = {
LINX_(__NR_faccessat2, sys_faccessat2), // 439
LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), // 441
+
+ LINX_(__NR_fchmodat2, sys_fchmodat2), // 452
};
diff --git a/coregrind/m_syswrap/syswrap-arm64-linux.c b/coregrind/m_syswrap/syswrap-arm64-linux.c
index 6af7bab83..3307bc2ca 100644
--- a/coregrind/m_syswrap/syswrap-arm64-linux.c
+++ b/coregrind/m_syswrap/syswrap-arm64-linux.c
@@ -840,6 +840,8 @@ static SyscallTableEntry syscall_main_table[] = {
LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), // 441
LINXY(__NR_memfd_secret, sys_memfd_secret), // 447
+
+ LINX_(__NR_fchmodat2, sys_fchmodat2), // 452
};
diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c
index d571fc327..efa47f2e6 100644
--- a/coregrind/m_syswrap/syswrap-linux.c
+++ b/coregrind/m_syswrap/syswrap-linux.c
@@ -6059,6 +6059,17 @@ PRE(sys_fchmodat)
PRE_MEM_RASCIIZ( "fchmodat(path)", ARG2 );
}
+PRE(sys_fchmodat2)
+{
+ PRINT("sys_fchmodat2 ( %ld, %#" FMT_REGWORD "x(%s), %" FMT_REGWORD "u, %"
+ FMT_REGWORD "u )",
+ SARG1, ARG2, (HChar*)(Addr)ARG2, ARG3, ARG4);
+ PRE_REG_READ4(long, "fchmodat2",
+ int, dfd, const char *, path, vki_mode_t, mode,
+ unsigned int, flags);
+ PRE_MEM_RASCIIZ( "fchmodat2(pathname)", ARG2 );
+}
+
PRE(sys_faccessat)
{
PRINT("sys_faccessat ( %ld, %#" FMT_REGWORD "x(%s), %ld )",
diff --git a/coregrind/m_syswrap/syswrap-mips32-linux.c b/coregrind/m_syswrap/syswrap-mips32-linux.c
index 6268a00dd..74a1f6eac 100644
--- a/coregrind/m_syswrap/syswrap-mips32-linux.c
+++ b/coregrind/m_syswrap/syswrap-mips32-linux.c
@@ -1143,6 +1143,8 @@ static SyscallTableEntry syscall_main_table[] = {
LINX_ (__NR_faccessat2, sys_faccessat2), // 439
LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), // 441
+
+ LINX_(__NR_fchmodat2, sys_fchmodat2), // 452
};
SyscallTableEntry* ML_(get_linux_syscall_entry) (UInt sysno)
diff --git a/coregrind/m_syswrap/syswrap-mips64-linux.c b/coregrind/m_syswrap/syswrap-mips64-linux.c
index 6cdf25893..4e8508b7a 100644
--- a/coregrind/m_syswrap/syswrap-mips64-linux.c
+++ b/coregrind/m_syswrap/syswrap-mips64-linux.c
@@ -820,6 +820,7 @@ static SyscallTableEntry syscall_main_table[] = {
LINXY (__NR_close_range, sys_close_range),
LINX_ (__NR_faccessat2, sys_faccessat2),
LINXY(__NR_epoll_pwait2, sys_epoll_pwait2),
+ LINX_ (__NR_fchmodat2, sys_fchmodat2),
};
SyscallTableEntry * ML_(get_linux_syscall_entry) ( UInt sysno )
diff --git a/coregrind/m_syswrap/syswrap-nanomips-linux.c b/coregrind/m_syswrap/syswrap-nanomips-linux.c
index d724cde74..7859900c1 100644
--- a/coregrind/m_syswrap/syswrap-nanomips-linux.c
+++ b/coregrind/m_syswrap/syswrap-nanomips-linux.c
@@ -829,6 +829,7 @@ static SyscallTableEntry syscall_main_table[] = {
LINXY (__NR_close_range, sys_close_range),
LINX_ (__NR_faccessat2, sys_faccessat2),
LINXY (__NR_epoll_pwait2, sys_epoll_pwait2),
+ LINX_ (__NR_fchmodat2, sys_fchmodat2),
};
SyscallTableEntry* ML_(get_linux_syscall_entry) (UInt sysno)
diff --git a/coregrind/m_syswrap/syswrap-ppc32-linux.c b/coregrind/m_syswrap/syswrap-ppc32-linux.c
index c0cfef235..1e19116ee 100644
--- a/coregrind/m_syswrap/syswrap-ppc32-linux.c
+++ b/coregrind/m_syswrap/syswrap-ppc32-linux.c
@@ -1063,6 +1063,8 @@ static SyscallTableEntry syscall_table[] = {
LINX_(__NR_faccessat2, sys_faccessat2), // 439
LINXY (__NR_epoll_pwait2, sys_epoll_pwait2), // 441
+
+ LINX_ (__NR_fchmodat2, sys_fchmodat2), // 452
};
SyscallTableEntry* ML_(get_linux_syscall_entry) ( UInt sysno )
diff --git a/coregrind/m_syswrap/syswrap-ppc64-linux.c b/coregrind/m_syswrap/syswrap-ppc64-linux.c
index f5976f30c..1097212a4 100644
--- a/coregrind/m_syswrap/syswrap-ppc64-linux.c
+++ b/coregrind/m_syswrap/syswrap-ppc64-linux.c
@@ -1032,6 +1032,8 @@ static SyscallTableEntry syscall_table[] = {
LINX_(__NR_faccessat2, sys_faccessat2), // 439
LINXY (__NR_epoll_pwait2, sys_epoll_pwait2), // 441
+
+ LINX_ (__NR_fchmodat2, sys_fchmodat2), // 452
};
SyscallTableEntry* ML_(get_linux_syscall_entry) ( UInt sysno )
diff --git a/coregrind/m_syswrap/syswrap-s390x-linux.c b/coregrind/m_syswrap/syswrap-s390x-linux.c
index afba154e7..3588672c7 100644
--- a/coregrind/m_syswrap/syswrap-s390x-linux.c
+++ b/coregrind/m_syswrap/syswrap-s390x-linux.c
@@ -873,6 +873,8 @@ static SyscallTableEntry syscall_table[] = {
LINX_(__NR_faccessat2, sys_faccessat2), // 439
LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), // 441
+
+ LINX_ (__NR_fchmodat2, sys_fchmodat2), // 452
};
SyscallTableEntry* ML_(get_linux_syscall_entry) ( UInt sysno )
diff --git a/coregrind/m_syswrap/syswrap-x86-linux.c b/coregrind/m_syswrap/syswrap-x86-linux.c
index da4fd8fa2..58badc6b0 100644
--- a/coregrind/m_syswrap/syswrap-x86-linux.c
+++ b/coregrind/m_syswrap/syswrap-x86-linux.c
@@ -1658,6 +1658,8 @@ static SyscallTableEntry syscall_table[] = {
LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), // 441
LINXY(__NR_memfd_secret, sys_memfd_secret), // 447
+
+ LINX_(__NR_fchmodat2, sys_fchmodat2), // 452
};
SyscallTableEntry* ML_(get_linux_syscall_entry) ( UInt sysno )
diff --git a/include/vki/vki-scnums-shared-linux.h b/include/vki/vki-scnums-shared-linux.h
index 542382b53..a4cd87149 100644
--- a/include/vki/vki-scnums-shared-linux.h
+++ b/include/vki/vki-scnums-shared-linux.h
@@ -50,4 +50,6 @@
#define __NR_memfd_secret 447
+#define __NR_fchmodat2 452
+
#endif
--
2.44.0

View File

@@ -0,0 +1,45 @@
From ecbdea7bd8b08205f1bc3f6b72d4b4a80f313fcb Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 10 Jun 2017 01:03:17 -0700
Subject: [PATCH 3/6] correct include directive path for config.h
when building out of source tree, it can not find
the generated config.h otherwise
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
memcheck/tests/linux/syscalls-2007.c | 2 +-
memcheck/tests/linux/syslog-syscall.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/memcheck/tests/linux/syscalls-2007.c b/memcheck/tests/linux/syscalls-2007.c
index b61c6d5..cc3fd62 100644
--- a/memcheck/tests/linux/syscalls-2007.c
+++ b/memcheck/tests/linux/syscalls-2007.c
@@ -10,7 +10,7 @@
#define _GNU_SOURCE
-#include "../../config.h"
+#include "config.h"
#include <fcntl.h>
#include <signal.h>
#include <stdint.h>
diff --git a/memcheck/tests/linux/syslog-syscall.c b/memcheck/tests/linux/syslog-syscall.c
index 1143722..21e758b 100644
--- a/memcheck/tests/linux/syslog-syscall.c
+++ b/memcheck/tests/linux/syslog-syscall.c
@@ -6,7 +6,7 @@
* klogctl().
*/
-#include "../../config.h"
+#include "config.h"
#include <stdio.h>
#if defined(HAVE_SYS_KLOG_H)
#include <sys/klog.h>
--
2.13.1

View File

@@ -0,0 +1,137 @@
From 41ff9aa49f6c54c66d0e6b37f265fd9cb0176057 Mon Sep 17 00:00:00 2001
From: Paul Floyd <pjfloyd@wanadoo.fr>
Date: Sun, 17 Dec 2023 14:18:51 +0100
Subject: [PATCH 4/4] Bug 478624 - Valgrind incompatibility with binutils-2.42
on x86 with new nop patterns (unhandled instruction bytes: 0x2E 0x8D 0xB4
0x26)
It was a bit of a struggle to get the testcase to build
with both clang and gcc (oddly enough gcc was more difficult) so
I just resorted to using .byte arrays.
(cherry picked from commit d35005cef8ad8207542738812705ceabf137d7e0)
Upstream-Status: Backport [https://sourceware.org/git/?p=valgrind.git;a=commit;h=41ff9aa49f6c54c66d0e6b37f265fd9cb0176057]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
.gitignore | 1 +
NEWS | 2 ++
VEX/priv/guest_x86_toIR.c | 22 +++++++++++++-
none/tests/x86/Makefile.am | 2 ++
none/tests/x86/gnu_binutils_nop.c | 34 ++++++++++++++++++++++
none/tests/x86/gnu_binutils_nop.stderr.exp | 0
none/tests/x86/gnu_binutils_nop.vgtest | 2 ++
7 files changed, 62 insertions(+), 1 deletion(-)
create mode 100644 none/tests/x86/gnu_binutils_nop.c
create mode 100644 none/tests/x86/gnu_binutils_nop.stderr.exp
create mode 100644 none/tests/x86/gnu_binutils_nop.vgtest
--- a/NEWS
+++ b/NEWS
@@ -9,6 +9,8 @@ The following bugs have been fixed or re
file produced by mold
476708 valgrind-monitor.py regular expressions should use raw strings
477198 Add fchmodat2 syscall on linux
+478624 Valgrind incompatibility with binutils-2.42 on x86 with new nop patterns
+ (unhandled instruction bytes: 0x2E 0x8D 0xB4 0x26)
To see details of a given bug, visit
https://bugs.kde.org/show_bug.cgi?id=XXXXXX
--- a/VEX/priv/guest_x86_toIR.c
+++ b/VEX/priv/guest_x86_toIR.c
@@ -8198,7 +8198,7 @@ DisResult disInstr_X86_WRK (
delta += 5;
goto decode_success;
}
- /* Don't barf on recent binutils padding,
+ /* Don't barf on recent (2010) binutils padding,
all variants of which are: nopw %cs:0x0(%eax,%eax,1)
66 2e 0f 1f 84 00 00 00 00 00
66 66 2e 0f 1f 84 00 00 00 00 00
@@ -8222,6 +8222,26 @@ DisResult disInstr_X86_WRK (
goto decode_success;
}
}
+
+ /* bug478624 GNU binutils uses a leal of esi into itself with
+ a zero offset and CS prefix as an 8 byte no-op (Dec 2023).
+ Since the CS prefix is hardly ever used we don't do much
+ to decode it, just a few cases for conditional branches.
+ So add handling here with other pseudo-no-ops.
+ */
+ if (code[0] == 0x2E && code[1] == 0x8D) {
+ if (code[2] == 0x74 && code[3] == 0x26 && code[4] == 0x00) {
+ DIP("leal %%cs:0(%%esi,%%eiz,1),%%esi\n");
+ delta += 5;
+ goto decode_success;
+ }
+ if (code[2] == 0xB4 && code[3] == 0x26 && code[4] == 0x00
+ && code[5] == 0x00 && code[6] == 0x00 && code[7] == 0x00) {
+ DIP("leal %%cs:0(%%esi,%%eiz,1),%%esi\n");
+ delta += 8;
+ goto decode_success;
+ }
+ }
// Intel CET requires the following opcodes to be treated as NOPs
// with any prefix and ModRM, SIB and disp combination:
--- a/none/tests/x86/Makefile.am
+++ b/none/tests/x86/Makefile.am
@@ -52,6 +52,7 @@ EXTRA_DIST = \
fxtract.stdout.exp fxtract.stderr.exp fxtract.vgtest \
fxtract.stdout.exp-older-glibc \
getseg.stdout.exp getseg.stderr.exp getseg.vgtest \
+ gnu_binutils_nop.stderr.exp gnu_binutils_nop.vgtest \
incdec_alt.stdout.exp incdec_alt.stderr.exp incdec_alt.vgtest \
int.stderr.exp int.stdout.exp int.disabled \
$(addsuffix .stderr.exp,$(INSN_TESTS)) \
@@ -100,6 +101,7 @@ check_PROGRAMS = \
fpu_lazy_eflags \
fxtract \
getseg \
+ gnu_binutils_nop \
incdec_alt \
$(INSN_TESTS) \
int \
--- /dev/null
+++ b/none/tests/x86/gnu_binutils_nop.c
@@ -0,0 +1,34 @@
+int main(void)
+{
+ // GNU binutils uses various opcodes as alternatives for nop
+ // the idea is that it is faster to execute one large opcode
+ // with no side-effects than multiple repetitions of the
+ // single byte 'nop'. This gives more choice when code
+ // needs to be padded.
+
+ // the following is based on
+ // https://sourceware.org/cgit/binutils-gdb/tree/gas/config/tc-i386.c#n1256
+
+ // one byte
+ __asm__ __volatile__("nop");
+ // two bytes
+ __asm__ __volatile__("xchg %ax,%ax");
+ // three bytes
+ //__asm__ __volatile__("leal 0(%esi),%esi");
+ __asm__ __volatile__(".byte 0x8d,0x76,0x00");
+ // four bytes
+ //__asm__ __volatile__("leal 0(%esi,%eiz),%esi");
+ __asm__ __volatile__(".byte 0x8d,0x74,0x26,0x00");
+ // five bytes
+ //__asm__ __volatile__("leal %cs:0(%esi,%eiz),%esi");
+ __asm__ __volatile__(".byte 0x2e,0x8d,0x74,0x26,0x00");
+ // six bytes
+ //__asm__ __volatile__("leal 0L(%esi),%esi");
+ __asm__ __volatile__(".byte 0x8d,0xb6,0x00,0x00,0x00,0x00");
+ // seven bytes
+ //__asm__ __volatile__("leal 0L(%esi,%eiz),%esi");
+ __asm__ __volatile__(".byte 0x8d,0xb4,0x26,0x00,0x00,0x00,0x00");
+ // eight bytes
+ //__asm__ __volatile__("leal %cs:0L(%esi,%eiz),%esi");
+ __asm__ __volatile__(".byte 0x2e,0x8d,0xb4,0x26,0x00,0x00,0x00,0x00");
+}
--- /dev/null
+++ b/none/tests/x86/gnu_binutils_nop.vgtest
@@ -0,0 +1,2 @@
+prog: gnu_binutils_nop
+vgopts: -q

View File

@@ -0,0 +1,257 @@
From e244a72c6f8803550f37e81f72bbae039651013b Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex.kanavin@gmail.com>
Date: Tue, 15 Dec 2015 15:50:44 +0200
Subject: [PATCH] Modify vg_test wrapper to support PTEST formats
Change the valgrind regression test script vg_regtest to
support the yocto ptest stdout reporting format. The commit adds
'--yocto-ptest' as an optional argument to vg_regtest, which alters
the output to use the ptest infrastructure reporting format:
"[PASS|SKIP|FAIL]: testname"
instead of valgrind's internal test reporting format. Without the added
option, --yocto-ptest, the valgrind regression test output is unchanged.
Enforce 30 seconds limit for the test.
This resume execution of the remaining tests when valgrind hangs.
Upstream-Status: Inappropriate [oe-core specific]
Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Increase time limit to 90 s.
(double of the expected time of drd/tests/std_list on qemuarm64)
Signed-off-by: Yi Fan Yu <yifan.yu@windriver.com>
---
tests/vg_regtest.in | 75 +++++++++++++++++++++++++++++++++------------
1 file changed, 55 insertions(+), 20 deletions(-)
diff --git a/tests/vg_regtest.in b/tests/vg_regtest.in
index ad18800..e4bd8cb 100755
--- a/tests/vg_regtest.in
+++ b/tests/vg_regtest.in
@@ -47,6 +47,7 @@
# --loop-till-fail: loops on the test(s) till one fail, then exit
# This is useful to obtain detailed trace or --keep-unfiltered
# output of a non deterministic test failure
+# --yocto-ptest: output in yocto ptest format
#
# The easiest way is to run all tests in valgrind/ with (assuming you installed
# in $PREFIX):
@@ -139,7 +140,7 @@ my $usage="\n"
. "Usage:\n"
. " vg_regtest [--all, --valgrind, --valgrind-lib, --keep-unfiltered\n"
. " --outer-valgrind, --outer-tool, --outer-args\n"
- . " --loop-till-fail]\n"
+ . " --loop-till-fail, --yocto-ptest]\n"
. " Use EXTRA_REGTEST_OPTS to supply extra args for all tests\n"
. "\n";
@@ -187,6 +188,7 @@ my $run_outer_args = "";
my $valgrind_lib = "$tests_dir/.in_place";
my $keepunfiltered = 0;
my $looptillfail = 0;
+my $yoctoptest = 0;
# default filter is the one named "filter_stderr" in the test's directory
my $default_stderr_filter = "filter_stderr";
@@ -245,6 +247,8 @@ sub process_command_line()
$keepunfiltered = 1;
} elsif ($arg =~ /^--loop-till-fail$/) {
$looptillfail = 1;
+ } elsif ($arg =~ /^--yocto-ptest$/) {
+ $yoctoptest = 1;
} else {
die $usage;
}
@@ -376,13 +380,28 @@ sub read_vgtest_file($)
#----------------------------------------------------------------------------
# Since most of the program time is spent in system() calls, need this to
# propagate a Ctrl-C enabling us to quit.
-sub mysystem($)
+# Enforce 90 seconds limit for the test.
+# This resume execution of the remaining tests if valgrind hangs.
+sub mysystem($)
{
- my $exit_code = system($_[0]);
- ($exit_code == 2) and exit 1; # 2 is SIGINT
- return $exit_code;
+ my $exit_code=0;
+ eval {
+ local $SIG{'ALRM'} = sub { die "timed out\n" };
+ alarm(90);
+ $exit_code = system($_[0]);
+ alarm (0);
+ ($exit_code == 2) and die "SIGINT\n"; # 2 is SIGINT
+ };
+ if ($@) {
+ if ($@ eq "timed out\n") {
+ print "timed out\n";
+ return 1;
+ }
+ if ($@ eq "SIGINT\n") {
+ exit 1;
+ }
+ }
}
-
# if $keepunfiltered, copies $1 to $1.unfiltered.out
# renames $0 tp $1
sub filtered_rename($$)
@@ -430,23 +449,25 @@ sub do_diffs($$$$)
# A match; remove .out and any previously created .diff files.
unlink("$name.$mid.out");
unlink(<$name.$mid.diff*>);
- return;
+ return 0;
}
}
}
# If we reach here, none of the .exp files matched.
- print "*** $name failed ($mid) ***\n";
+ print "*** $name failed ($mid) ***\n" if ($yoctoptest == 0) ;
push(@failures, sprintf("%-40s ($mid)", "$fullname"));
$num_failures{$mid}++;
if ($looptillfail == 1) {
print "Failure encountered, stopping to loop\n";
exit 1
}
+ return 1;
}
sub do_one_test($$)
{
my ($dir, $vgtest) = @_;
+ my $diffStatus = 0;
$vgtest =~ /^(.*)\.vgtest/;
my $name = $1;
my $fullname = "$dir/$name";
@@ -465,7 +486,11 @@ sub do_one_test($$)
} elsif (256 == $prereq_res) {
# Nb: weird Perl-ism -- exit code of '1' is seen by Perl as 256...
# Prereq failed, skip.
- printf("%-16s (skipping, prereq failed: $prereq)\n", "$name:");
+ if ($yoctoptest == 0) {
+ printf("%-16s (skipping, prereq failed: $prereq)\n", "$name:");
+ } else {
+ printf("SKIP: $fullname\n");
+ }
return;
} else {
# Bad prereq; abort.
@@ -483,7 +508,7 @@ sub do_one_test($$)
}
# If there is a progB, let's start it in background:
printf("%-16s valgrind $extraopts $vgopts $prog $args (progB: $progB $argsB)\n",
- "$name:");
+ "$name:") if ($yoctoptest == 0);
# progB.done used to detect child has finished. See below.
# Note: redirection of stdout and stderr is before $progB to allow argsB
# to e.g. redirect stdoutB to stderrB
@@ -499,7 +524,8 @@ sub do_one_test($$)
. "touch progB.done) &");
}
} else {
- printf("%-16s valgrind $extraopts $vgopts $prog $args\n", "$name:");
+ printf("%-16s valgrind $extraopts $vgopts $prog $args\n", "$name:")
+ if ($yoctoptest == 0);
}
# Collect environment variables, if any.
@@ -540,7 +566,7 @@ sub do_one_test($$)
# Find all the .stdout.exp files. If none, use /dev/null.
my @stdout_exps = <$name.stdout.exp*>;
@stdout_exps = ( "/dev/null" ) if (0 == scalar @stdout_exps);
- do_diffs($fullname, $name, "stdout", \@stdout_exps);
+ $diffStatus |= do_diffs($fullname, $name, "stdout", \@stdout_exps);
# Filter stderr
$stderr_filter_args = $name if (! defined $stderr_filter_args);
@@ -549,7 +575,7 @@ sub do_one_test($$)
# Find all the .stderr.exp files. At least one must exist.
my @stderr_exps = <$name.stderr.exp*>;
(0 != scalar @stderr_exps) or die "Could not find `$name.stderr.exp*'\n";
- do_diffs($fullname, $name, "stderr", \@stderr_exps);
+ $diffStatus |= do_diffs($fullname, $name, "stderr", \@stderr_exps);
if (defined $progB) {
# wait for the child to be finished
@@ -573,7 +599,7 @@ sub do_one_test($$)
# Find all the .stdoutB.exp files. If none, use /dev/null.
my @stdoutB_exps = <$name.stdoutB.exp*>;
@stdoutB_exps = ( "/dev/null" ) if (0 == scalar @stdoutB_exps);
- do_diffs($fullname, $name, "stdoutB", \@stdoutB_exps);
+ $diffStatus |= do_diffs($fullname, $name, "stdoutB", \@stdoutB_exps);
# Filter stderr
$stderrB_filter_args = $name if (! defined $stderrB_filter_args);
@@ -582,7 +608,7 @@ sub do_one_test($$)
# Find all the .stderrB.exp files. At least one must exist.
my @stderrB_exps = <$name.stderrB.exp*>;
(0 != scalar @stderrB_exps) or die "Could not find `$name.stderrB.exp*'\n";
- do_diffs($fullname, $name, "stderrB", \@stderrB_exps);
+ $diffStatus |= do_diffs($fullname, $name, "stderrB", \@stderrB_exps);
}
# Maybe do post-test check
@@ -594,7 +620,7 @@ sub do_one_test($$)
# Find all the .post.exp files. If none, use /dev/null.
my @post_exps = <$name.post.exp*>;
@post_exps = ( "/dev/null" ) if (0 == scalar @post_exps);
- do_diffs($fullname, $name, "post", \@post_exps);
+ $diffStatus |= do_diffs($fullname, $name, "post", \@post_exps);
}
}
@@ -603,6 +629,13 @@ sub do_one_test($$)
print("(cleanup operation failed: $cleanup)\n");
}
+ if ($yoctoptest == 1) {
+ if ($diffStatus == 0) {
+ print("PASS: $fullname\n");
+ } else {
+ print("FAIL: $fullname\n");
+ }
+ }
$num_tests_done++;
}
@@ -643,7 +676,7 @@ sub test_one_dir($$)
my $tests_start_time = time;
if ($found_tests) {
- print "-- Running tests in $full_dir $dashes\n";
+ print "-- Running tests in $full_dir $dashes\n" if ($yoctoptest == 0);
}
foreach my $f (@fs) {
if (-d $f) {
@@ -657,7 +690,7 @@ sub test_one_dir($$)
my $end_time = "(in $tests_cost_time sec)";
my $end_dashes = "-" x (50 - (length $full_dir)
- (length $end_time) - 1);
- print "-- Finished tests in $full_dir $end_time $end_dashes\n";
+ print "-- Finished tests in $full_dir $dashes\n" if ($yoctoptest == 0);
}
chdir("..");
@@ -683,10 +716,12 @@ sub summarise_results
$num_failures{"stdout"}, plural($num_failures{"stdout"}),
$num_failures{"stderrB"}, plural($num_failures{"stderrB"}),
$num_failures{"stdoutB"}, plural($num_failures{"stdoutB"}),
- $num_failures{"post"}, plural($num_failures{"post"}));
+ $num_failures{"post"}, plural($num_failures{"post"}))
+ if ($yoctoptest == 0);
foreach my $failure (@failures) {
- print "$failure\n";
+ print "$failure\n"
+ if ($yoctoptest == 0);
}
print "\n";
}
--
2.30.2

View File

@@ -0,0 +1,96 @@
From 0bf4b0ac18d1ea41b32ad781d214b295ca1998f3 Mon Sep 17 00:00:00 2001
From: Aneesh Bansal <aneesh.bansal@freescale.com>
Date: Mon, 21 Nov 2011 17:31:39 +0530
Subject: [PATCH] Added support for PPC instructions mfatbu, mfatbl.
Currently Valgrind 3.7.0 does not have support for PPC instructions mfatbu and mfatbl. When we run a USDPAA application with VALGRIND, the following error is given by valgrind :
dis_proc_ctl(ppc)(mfspr,SPR)(0x20F)
disInstr(ppc): unhandled instruction: 0x7C0F82A6
Upstream-Status: Submitted [https://bugs.kde.org/show_bug.cgi?id=289836]
Signed-off-by: Aneesh Bansal <aneesh.bansal@freescale.com>
---
VEX/priv/guest_ppc_defs.h | 2 ++
VEX/priv/guest_ppc_helpers.c | 18 ++++++++++++++++++
VEX/priv/guest_ppc_toIR.c | 22 ++++++++++++++++++++++
3 files changed, 42 insertions(+), 0 deletions(-)
diff --git a/VEX/priv/guest_ppc_defs.h b/VEX/priv/guest_ppc_defs.h
index dd3c62e..11a34aa 100644
--- a/VEX/priv/guest_ppc_defs.h
+++ b/VEX/priv/guest_ppc_defs.h
@@ -146,6 +146,8 @@ extern UInt ppc32g_dirtyhelper_MFSPR_268_269 ( UInt );
extern UInt ppc32g_dirtyhelper_MFSPR_287 ( void );
+extern UInt ppc32g_dirtyhelper_MFSPR_526_527 ( UInt );
+
extern void ppc32g_dirtyhelper_LVS ( VexGuestPPC32State* gst,
UInt vD_idx, UInt sh,
UInt shift_right );
diff --git a/VEX/priv/guest_ppc_helpers.c b/VEX/priv/guest_ppc_helpers.c
index 11aa428..b49ea3f 100644
--- a/VEX/priv/guest_ppc_helpers.c
+++ b/VEX/priv/guest_ppc_helpers.c
@@ -119,6 +119,24 @@ UInt ppc32g_dirtyhelper_MFSPR_287 ( void )
# endif
}
+/* CALLED FROM GENERATED CODE */
+/* DIRTY HELPER (non-referentially transparent) */
+UInt ppc32g_dirtyhelper_MFSPR_526_527 ( UInt r527 )
+{
+# if defined(__powerpc__) || defined(_AIX)
+ UInt spr;
+ if (r527) {
+ __asm__ __volatile__("mfspr %0,527" : "=b"(spr));
+ } else {
+ __asm__ __volatile__("mfspr %0,526" : "=b"(spr));
+ }
+ return spr;
+# else
+ return 0;
+# endif
+}
+
+
/* CALLED FROM GENERATED CODE */
/* DIRTY HELPER (reads guest state, writes guest mem) */
diff --git a/VEX/priv/guest_ppc_toIR.c b/VEX/priv/guest_ppc_toIR.c
index f8d220d..37c8974 100644
--- a/VEX/priv/guest_ppc_toIR.c
+++ b/VEX/priv/guest_ppc_toIR.c
@@ -5657,6 +5657,28 @@ static Bool dis_proc_ctl ( VexAbiInfo* vbi, UInt theInstr )
break;
}
+
+ case 526 /* 0x20E */:
+ case 527 /* 0x20F */: {
+ UInt arg = SPR==526 ? 0 : 1;
+ IRTemp val = newTemp(Ity_I32);
+ IRExpr** args = mkIRExprVec_1( mkU32(arg) );
+ IRDirty* d = unsafeIRDirty_1_N(
+ val,
+ 0/*regparms*/,
+ "ppc32g_dirtyhelper_MFSPR_526_527",
+ fnptr_to_fnentry
+ (vbi, &ppc32g_dirtyhelper_MFSPR_526_527),
+ args
+ );
+ /* execute the dirty call, dumping the result in val. */
+ stmt( IRStmt_Dirty(d) );
+ putIReg( rD_addr,
+ mkWidenFrom32(ty, mkexpr(val), False/*unsigned*/) );
+ DIP("mfspr r%u,%u", rD_addr, (UInt)SPR);
+ break;
+ }
+
default:
vex_printf("dis_proc_ctl(ppc)(mfspr,SPR)(0x%x)\n", SPR);
return False;
--
1.7.0.4

View File

@@ -0,0 +1,33 @@
From 8facc29c3c56e6cf9cfef70986cf73876044a3fb Mon Sep 17 00:00:00 2001
From: Andre McCurdy <armccurdy@gmail.com>
Date: Tue, 19 Jan 2016 16:42:36 -0800
Subject: [PATCH] avoid neon for targets which don't support it
The sh-mem-random.c test app tries to use neon loads and stores to
test 64-bit float copies when building for ARM. Allow it to do so if
possible, but fallback to C when building for ARM targets which don't
support neon.
Upstream-Status: Submitted [https://bugs.kde.org/show_bug.cgi?id=454346]
Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
---
memcheck/tests/sh-mem-random.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/memcheck/tests/sh-mem-random.c b/memcheck/tests/sh-mem-random.c
index ae82248..816e139 100644
--- a/memcheck/tests/sh-mem-random.c
+++ b/memcheck/tests/sh-mem-random.c
@@ -191,7 +191,7 @@ void do_test_at ( U1* arr )
"emms"
: : "r"(arr+dst), "r"(arr+src) : "memory"
);
-#elif defined(__linux__) && defined(__arm__) && !defined(__aarch64__)
+#elif defined(__linux__) && defined(__arm__) && defined(__ARM_NEON__) && !defined(__aarch64__)
/* On arm32, many compilers generate a 64-bit float move
using two 32 bit integer registers, which completely
defeats this test. Hence force a 64-bit NEON load and
--
1.9.1

View File

@@ -0,0 +1,56 @@
From beaa5b64c60d501fa9cd59fdc563e5f5bccf6882 Mon Sep 17 00:00:00 2001
From: Qing He <qing.he@intel.com>
Date: Tue, 31 Aug 2010 22:51:58 +0800
Subject: [PATCH] valgrind: fix perl scripts
this is a temporary patch to workaround cross compilation.
otherwise @PERL@ will be replaced to perl-native binary,
this creates unusable scripts and fails FILERDEPENDS mechanism
(esp. rpm)
a better fix would need:
1. configure.ac should differentiate PERL and HOSTPERL
2. optionally remove ${STAGING_DIR} in #! line before do_install
8/31/2010 - created by Qing He <qing.he@intel.com>
Upstream-Status: Inappropriate [configuration]
Signed-off-by: Maxin B. John <maxin.john@intel.com>
---
massif/ms_print.in | 2 +-
perf/vg_perf.in | 2 +-
tests/vg_regtest.in | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/massif/ms_print.in b/massif/ms_print.in
index a206ce4..df1bc31 100755
--- a/massif/ms_print.in
+++ b/massif/ms_print.in
@@ -1,4 +1,4 @@
-#! @PERL@
+#! /usr/bin/perl
##--------------------------------------------------------------------##
##--- Massif's results printer ms_print.in ---##
diff --git a/perf/vg_perf.in b/perf/vg_perf.in
index 90ee1d2..c585096 100644
--- a/perf/vg_perf.in
+++ b/perf/vg_perf.in
@@ -1,4 +1,4 @@
-#! @PERL@
+#! /usr/bin/perl
##--------------------------------------------------------------------##
##--- Valgrind performance testing script vg_perf ---##
##--------------------------------------------------------------------##
diff --git a/tests/vg_regtest.in b/tests/vg_regtest.in
index 7152765..ad18800 100755
--- a/tests/vg_regtest.in
+++ b/tests/vg_regtest.in
@@ -1,4 +1,4 @@
-#! @PERL@
+#! /usr/bin/perl
##--------------------------------------------------------------------##
##--- Valgrind regression testing script vg_regtest ---##
##--------------------------------------------------------------------##

View File

@@ -0,0 +1,32 @@
drd/tests/annotate_sem
gdbserver_tests/hgtls
helgrind/tests/hg05_race2
helgrind/tests/tc20_verifywrap
memcheck/tests/dw4
memcheck/tests/varinfo1
memcheck/tests/varinfo2
memcheck/tests/varinfo3
memcheck/tests/varinfo4
memcheck/tests/varinfo5
memcheck/tests/varinfo6
memcheck/tests/varinforestrict
memcheck/tests/atomic_incs
memcheck/tests/bug464969_d_demangle
memcheck/tests/cxx17_aligned_new
memcheck/tests/demangle
memcheck/tests/long_namespace_xml
memcheck/tests/mismatches
memcheck/tests/mismatches_xml
memcheck/tests/new_aligned_delete_default
memcheck/tests/new_delete_mismatch_size
memcheck/tests/new_nothrow
memcheck/tests/realloc_size_zero_mismatch
memcheck/tests/sized_aligned_new_delete_args
memcheck/tests/sized_aligned_new_delete_misaligned1
memcheck/tests/sized_aligned_new_delete_misaligned1_xml
memcheck/tests/sized_aligned_new_delete_misaligned2
memcheck/tests/sized_aligned_new_delete_misaligned2_xml
memcheck/tests/sized_aligned_new_delete_misaligned3
memcheck/tests/sized_aligned_new_delete_misaligned3_xml
memcheck/tests/sized_delete
none/tests/bigcode

View File

@@ -0,0 +1,29 @@
cachegrind/tests/wrap5
drd/tests/boost_thread
none/tests/amd64/fb_test_amd64
none/tests/tls
gdbserver_tests/hginfo
gdbserver_tests/mcinvokeRU
memcheck/tests/linux/dlclose_leak-no-keep
memcheck/tests/linux/dlclose_leak
memcheck/tests/linux/timerfd-syscall
memcheck/tests/supp_unknown
memcheck/tests/wrap1
memcheck/tests/wrap2
memcheck/tests/wrap3
memcheck/tests/wrap4
memcheck/tests/wrap5
memcheck/tests/wrap6
memcheck/tests/wrap7
memcheck/tests/wrap8
helgrind/tests/tls_threads
helgrind/tests/pth_mempcpy_false_races
drd/tests/bar_bad
drd/tests/bar_bad_xml
drd/tests/pth_barrier_thr_cr
drd/tests/std_thread2
drd/tests/thread_name_xml
massif/tests/deep-D
massif/tests/bug469146
massif/tests/new-cpp
massif/tests/overloaded-new

View File

@@ -0,0 +1,96 @@
#!/bin/sh
# run-ptest - 'ptest' test infrastructure shell script that
# wraps the valgrind regression script vg_regtest.
#
# Dave Lerner <dave.lerner@windriver.com>
# Randy MacLeod <Randy.MacLeod@windriver.com>
###############################################################
VALGRIND_LIB=@libdir@/valgrind
VALGRIND_LIBEXECDIR=@libexecdir@/valgrind
VALGRIND_BIN=@bindir@/valgrind
LOG="${VALGRIND_LIB}/ptest/valgrind_ptest_$(date +%Y%m%d-%H%M%S).log"
TOOLS="memcheck cachegrind callgrind helgrind drd massif dhat lackey none"
EXP_TOOLS="exp-bbv"
GDB_BIN=@bindir@/gdb
cd ${VALGRIND_LIB}/ptest && ./gdbserver_tests/make_local_links ${GDB_BIN}
echo "Hide valgrind tests that are non-deterministic"
echo "Reported at https://bugs.kde.org/show_bug.cgi?id=430321"
for i in `cat remove-for-all`; do
mv $i.vgtest $i.IGNORE;
done
arch=`arch`
if [ "$arch" = "aarch64" ]; then
echo "Aarch64: Hide valgrind tests that result in defunct process and then out of memory"
for i in `cat remove-for-aarch64`; do
mv $i.vgtest $i.IGNORE;
done
fi
echo "Run non-deterministic tests using taskset to limit them to a single core."
for i in `cat taskset_nondeterministic_tests`; do
# The remove-for-aarch64 and taskset_nondeterministic_tests may overlap so
# check if a file exist.
if test -f "${i}.vgtest"; then
taskset 0x00000001 perl tests/vg_regtest --valgrind=${VALGRIND_BIN} --valgrind-lib=${VALGRIND_LIBEXECDIR} --yocto-ptest $i 2>&1|tee -a ${LOG}
mv $i.vgtest $i.IGNORE
fi
done
cd ${VALGRIND_LIB}/ptest && ./tests/vg_regtest \
--valgrind=${VALGRIND_BIN} \
--valgrind-lib=${VALGRIND_LIBEXECDIR} \
--yocto-ptest \
gdbserver_tests ${TOOLS} ${EXP_TOOLS} \
2>&1|tee -a ${LOG}
cd ${VALGRIND_LIB}/ptest && \
./tests/post_regtest_checks $(pwd) \
gdbserver_tests ${TOOLS} ${EXP_TOOLS} \
2>&1|tee -a ${LOG}
echo "Restore non-deterministic tests"
for i in `cat taskset_nondeterministic_tests`; do
if test -f "${i}.vgtest.IGNORE"; then
mv $i.IGNORE $i.vgtest;
fi
done
if [ "$arch" = "aarch64" ]; then
echo "Aarch64: Restore valgrind tests that result in defunct process and then out of memory"
for i in `cat remove-for-aarch64`; do
mv $i.IGNORE $i.vgtest;
done
fi
echo "Restore valgrind tests that are non-deterministc"
for i in `cat remove-for-all`; do
mv $i.IGNORE $i.vgtest;
done
echo "Failed test details..."
failed_tests=`grep FAIL: ${LOG} | awk '{print $2}'`
for test in $failed_tests; do
for diff_results in `ls $test*.diff`; do
echo $diff_results
echo '************'
cat $diff_results
done
done
passed=`grep PASS: ${LOG}|wc -l`
failed=`grep FAIL: ${LOG}|wc -l`
skipped=`grep SKIP: ${LOG}|wc -l`
all=$((passed + failed + skipped))
( echo "=== Test Summary ==="
echo "TOTAL: ${all}"
echo "PASSED: ${passed}"
echo "FAILED: ${failed}"
echo "SKIPPED: ${skipped}"
) | tee -a /${LOG}

View File

@@ -0,0 +1,35 @@
From 8154d38bac5cdb3675cfdaf562ab9da01988b263 Mon Sep 17 00:00:00 2001
From: Yi Fan Yu <yifan.yu@windriver.com>
Date: Wed, 17 Mar 2021 12:16:31 -0400
Subject: [PATCH 19/20] remove s390x_vec_op_t
s390x_vec_op_t is not needed anywhere, only elements of enum are accessed
removing it ensures that valgrind can be built with -fno-common option
Fixes
ld: ../../VEX/libvex-amd64-linux.a(libvex_amd64_linux_a-guest_s390_helpers.o):/usr/src/debug/valgrind/3.15.0-r0/build/VEX/../../valgrind-3.15.0/VEX/priv/guest_s390_defs.h:289: multiple definition of `s390x_vec_op_t'; ../../VEX/libvexmultiarch-amd64-linux.a(libvexmultiarch_amd64_linux_a-multiarch_main_main.o):/usr/src/debug/valgrind/3.15.0-r0/build/VEX/../../valgrind-3.15.0/VEX/priv/guest_s390_defs.h:289: first defined here
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Yi Fan Yu <yifan.yu@windriver.com>
---
VEX/priv/guest_s390_defs.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/VEX/priv/guest_s390_defs.h b/VEX/priv/guest_s390_defs.h
index 9054290..dab8002 100644
--- a/VEX/priv/guest_s390_defs.h
+++ b/VEX/priv/guest_s390_defs.h
@@ -284,7 +284,7 @@ typedef enum {
S390_VEC_OP_VBPERM,
S390_VEC_OP_VMSL,
S390_VEC_OP_LAST // supposed to be the last element in enum
-} s390x_vec_op_t;
+};
/* Arguments of s390x_dirtyhelper_vec_op(...) which are packed into one
ULong variable.
--
2.29.2

View File

@@ -0,0 +1,2 @@
helgrind/tests/hg05_race2
helgrind/tests/tc09_bad_unlock

View File

@@ -0,0 +1,44 @@
From d134dafc2f11e0d247420a0ba360bcdef77b4093 Mon Sep 17 00:00:00 2001
From: Andre McCurdy <armccurdy@gmail.com>
Date: Tue, 19 Jan 2016 16:00:00 -0800
Subject: [PATCH] use appropriate -march/-mcpu/-mfpu for ARM test apps
Ensure that test apps in none/tests/arm are compiled with appropriate
-march/-mcpu/-mfpu flags to support the instructions being tested.
The aim is to build all tests, even ones which may not run correctly
on all target CPUs.
For tests requiring armv7ve instructions, ensure that we set both
-march=armv7ve and -mcpu=cortex-a15 (since some TUNE_CCARGS may set
-march=armv7-a and adding -mcpu=cortex-a15 alone is not enough to
over-ride that).
See similar cases in none/tests/arm/Makefile.am
Upstream-Status: Submitted [https://bugs.kde.org/show_bug.cgi?id=454346]
Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
---
none/tests/arm/Makefile.am | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/none/tests/arm/Makefile.am b/none/tests/arm/Makefile.am
index 4507a20..825290f 100644
--- a/none/tests/arm/Makefile.am
+++ b/none/tests/arm/Makefile.am
@@ -62,8 +62,10 @@ neon64_CFLAGS = $(AM_CFLAGS) -g -O0 -mcpu=cortex-a8 \
-mfpu=neon \
-mthumb
-intdiv_CFLAGS = $(AM_CFLAGS) -g -mcpu=cortex-a15 -mthumb
+intdiv_CFLAGS = $(AM_CFLAGS) -g -march=armv7ve -mcpu=cortex-a15 -mthumb
ldrt_CFLAGS = $(AM_CFLAGS) -g -mcpu=cortex-a8 -mthumb
ldrt_arm_CFLAGS = $(AM_CFLAGS) -g -mcpu=cortex-a8 -marm
-vfpv4_fma_CFLAGS = $(AM_CFLAGS) -g -O0 -mcpu=cortex-a15 -mfpu=vfpv4 -marm
+vcvt_fixed_float_VFP_CFLAGS = $(AM_CFLAGS) -g -mcpu=cortex-a8 -mfpu=vfpv3
+
+vfpv4_fma_CFLAGS = $(AM_CFLAGS) -g -O0 -march=armv7ve -mcpu=cortex-a15 -mfpu=vfpv4 -marm
--
1.9.1

View File

@@ -0,0 +1,45 @@
From 005bd11809a1ce65e9f2c28e884354a4741650b9 Mon Sep 17 00:00:00 2001
From: Andre McCurdy <armccurdy@gmail.com>
Date: Tue, 13 Dec 2016 11:29:55 +0800
Subject: [PATCH] make ld-XXX.so strlen intercept optional
Hack: Depending on how glibc was compiled (e.g. optimised for size or
built with _FORTIFY_SOURCE enabled) the strlen symbol might not be
found in ld-XXX.so. Therefore although we should still try to
intercept it, don't make it mandatory to do so.
Upstream-Status: Inappropriate
Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
---
coregrind/m_redir.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/coregrind/m_redir.c b/coregrind/m_redir.c
index ff35009..d7d6816 100644
--- a/coregrind/m_redir.c
+++ b/coregrind/m_redir.c
@@ -1275,7 +1275,18 @@ static void add_hardwired_spec (const HChar* sopatt, const HChar* fnpatt,
spec->to_addr = to_addr;
spec->isWrap = False;
spec->isGlobal = False;
- spec->mandatory = mandatory;
+
+ /* Hack: Depending on how glibc was compiled (e.g. optimised for size or
+ built with _FORTIFY_SOURCE enabled) the strlen symbol might not be found.
+ Therefore although we should still try to intercept it, don't make it
+ mandatory to do so. We over-ride "mandatory" here to avoid the need to
+ patch the many different architecture specific callers to
+ add_hardwired_spec(). */
+ if (0==VG_(strcmp)("strlen", fnpatt))
+ spec->mandatory = NULL;
+ else
+ spec->mandatory = mandatory;
+
/* VARIABLE PARTS */
spec->mark = False; /* not significant */
spec->done = False; /* not significant */
--
1.9.1

View File

@@ -0,0 +1,276 @@
SUMMARY = "Valgrind memory debugger and instrumentation framework"
HOMEPAGE = "http://valgrind.org/"
DESCRIPTION = "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."
BUGTRACKER = "http://valgrind.org/support/bug_reports.html"
LICENSE = "GPL-2.0-only & GPL-2.0-or-later & BSD-3-Clause"
LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
file://include/pub_tool_basics.h;beginline=6;endline=29;md5=41c410e8d3f305aee7aaa666b2e4f366 \
file://include/valgrind.h;beginline=1;endline=56;md5=ad3b317f3286b6b704575d9efe6ca5df \
file://COPYING.DOCS;md5=24ea4c7092233849b4394699333b5c56"
DEPENDS = " \
${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'boost', '', d)} \
"
SRC_URI = "https://sourceware.org/pub/valgrind/valgrind-${PV}.tar.bz2 \
file://fixed-perl-path.patch \
file://Added-support-for-PPC-instructions-mfatbu-mfatbl.patch \
file://run-ptest \
file://remove-for-aarch64 \
file://remove-for-all \
file://taskset_nondeterministic_tests \
file://0005-Modify-vg_test-wrapper-to-support-PTEST-formats.patch \
file://use-appropriate-march-mcpu-mfpu-for-ARM-test-apps.patch \
file://avoid-neon-for-targets-which-don-t-support-it.patch \
file://valgrind-make-ld-XXX.so-strlen-intercept-optional.patch \
file://0001-makefiles-Drop-setting-mcpu-to-cortex-a8-on-arm-arch.patch \
file://0001-sigqueue-Rename-_sifields-to-__si_fields-on-musl.patch \
file://0003-correct-include-directive-path-for-config.h.patch \
file://0001-Return-a-valid-exit_code-from-vg_regtest.patch \
file://0001-valgrind-filter_xml_frames-do-not-filter-usr.patch \
file://0001-memcheck-vgtests-remove-fullpath-after-flags.patch \
file://s390x_vec_op_t.patch \
file://0001-none-tests-fdleak_cmsg.stderr.exp-adjust-tmp-paths.patch \
file://0001-memcheck-tests-Fix-timerfd-syscall-test.patch \
file://0001-docs-Disable-manual-validation.patch \
file://0001-valgrind-monitor.py-regular-expressions-should-use-r.patch \
file://0002-Bug-476548-valgrind-3.22.0-fails-on-assertion-when-l.patch \
file://0003-Add-fchmodat2-syscall-on-linux.patch \
file://0004-Bug-478624-Valgrind-incompatibility-with-binutils-2..patch \
"
SRC_URI[sha256sum] = "c811db5add2c5f729944caf47c4e7a65dcaabb9461e472b578765dd7bf6d2d4c"
UPSTREAM_CHECK_REGEX = "valgrind-(?P<pver>\d+(\.\d+)+)\.tar"
COMPATIBLE_HOST = '(i.86|x86_64|arm|aarch64|mips|powerpc|powerpc64).*-linux'
# patch 0001-memcheck-vgtests-remove-fullpath-after-flags.patch removes relative path
# argument. Change expected stderr files accordingly.
do_patch:append() {
bb.build.exec_func('do_sed_paths', d)
}
do_sed_paths() {
sed -i -e 's|tests/||' ${S}/memcheck/tests/badfree3.stderr.exp
sed -i -e 's|tests/||' ${S}/memcheck/tests/varinfo5.stderr.exp
}
# valgrind supports armv7 and above
COMPATIBLE_HOST:armv4 = 'null'
COMPATIBLE_HOST:armv5 = 'null'
COMPATIBLE_HOST:armv6 = 'null'
# valgrind fails with powerpc soft-float
COMPATIBLE_HOST:powerpc = "${@bb.utils.contains('TARGET_FPU', 'soft', 'null', '.*-linux', d)}"
# X32 isn't supported by valgrind at this time
COMPATIBLE_HOST:linux-gnux32 = 'null'
COMPATIBLE_HOST:linux-muslx32 = 'null'
# Disable for some MIPS variants
COMPATIBLE_HOST:mipsarchr6 = 'null'
COMPATIBLE_HOST:linux-gnun32 = 'null'
# Disable for powerpc64 with musl
COMPATIBLE_HOST:libc-musl:powerpc64 = 'null'
# brokenseip is unfortunately required by ptests to pass
inherit autotools-brokensep ptest multilib_header
EXTRA_OECONF = "--enable-tls --without-mpicc"
EXTRA_OECONF += "${@['--enable-only32bit','--enable-only64bit'][d.getVar('SITEINFO_BITS') != '32']}"
# valgrind checks host_cpu "armv7*)", so we need to over-ride the autotools.bbclass default --host option
EXTRA_OECONF:append:arm = " --host=armv7${HOST_VENDOR}-${HOST_OS}"
EXTRA_OEMAKE = "-w"
CACHED_CONFIGUREVARS += "ac_cv_path_PERL='/usr/bin/env perl'"
# valgrind likes to control its own optimisation flags. It generally defaults
# to -O2 but uses -O0 for some specific test apps etc. Passing our own flags
# (via CFLAGS) means we interfere with that. Only pass DEBUG_FLAGS to it
# which fixes build path issue in DWARF.
SELECTED_OPTIMIZATION = "${DEBUG_FLAGS}"
# Split out various helper scripts to separate packages to avoid the
# main package depending on perl and python.
PACKAGES =+ "${PN}-cachegrind ${PN}-massif ${PN}-callgrind"
FILES:${PN}-cachegrind = "${bindir}/cg_*"
FILES:${PN}-massif = "${bindir}/ms_*"
FILES:${PN}-callgrind = "${bindir}/callgrind_*"
RDEPENDS:${PN}-cachegrind = "${PN} python3-core"
RDEPENDS:${PN}-massif = "${PN} perl"
RDEPENDS:${PN}-callgrind = "${PN} perl"
do_configure:prepend () {
rm -rf ${S}/config.h
sed -i -e 's:$(abs_top_builddir):$(pkglibdir)/ptest:g' ${S}/none/tests/Makefile.am
sed -i -e 's:$(top_builddir):$(pkglibdir)/ptest:g' ${S}/memcheck/tests/Makefile.am
}
do_install:append () {
install -m 644 ${B}/default.supp ${D}/${libexecdir}/valgrind/
oe_multilib_header valgrind/config.h
}
VALGRINDARCH ?= "${TARGET_ARCH}"
VALGRINDARCH:aarch64 = "arm64"
VALGRINDARCH:x86-64 = "amd64"
VALGRINDARCH:x86 = "x86"
VALGRINDARCH:mips = "mips32"
VALGRINDARCH:mipsel = "mips32"
VALGRINDARCH:mips64el = "mips64"
VALGRINDARCH:powerpc = "ppc"
VALGRINDARCH:powerpc64 = "ppc64"
VALGRINDARCH:powerpc64le = "ppc64le"
INHIBIT_PACKAGE_STRIP_FILES = "${PKGD}${libexecdir}/valgrind/vgpreload_memcheck-${VALGRINDARCH}-linux.so"
# valgrind needs debug information for ld.so at runtime in order to
# redirect functions like strlen.
RRECOMMENDS:${PN} += "${TCLIBC}-dbg"
RDEPENDS:${PN}-ptest += " bash coreutils curl file \
gdb \
${TCLIBC}-src gcc-runtime-dbg \
libgomp \
perl \
perl-module-file-basename perl-module-file-glob perl-module-getopt-long \
perl-module-overloading perl-module-cwd perl-module-ipc-open3 \
perl-module-carp perl-module-symbol \
procps \
python3-compile \
sed \
util-linux-taskset \
${PN}-dbg ${PN}-src \
${PN}-cachegrind ${PN}-massif ${PN}-callgrind \
"
RDEPENDS:${PN}-ptest:append:libc-glibc = " glibc-utils glibc-gconv-utf-32"
# One of the tests contains a bogus interpreter path on purpose.
# Skip file dependency check
SKIP_FILEDEPS:${PN}-ptest = '1'
INSANE_SKIP:${PN}-ptest = "debug-deps"
do_compile_ptest() {
oe_runmake check
}
do_install_ptest() {
chmod +x ${B}/tests/vg_regtest
# The test application binaries are not automatically installed.
# Grab them from the build directory.
#
# The regression tests require scripts and data files that are not
# copied to the build directory. They must be copied from the
# source directory.
saved_dir=$PWD
for parent_dir in ${S} ${B} ; do
cd $parent_dir
subdirs=" \
.in_place \
cachegrind/tests \
callgrind/tests \
dhat/tests \
drd/tests \
gdbserver_tests \
helgrind/tests \
lackey/tests \
massif/tests \
memcheck/tests \
none/tests \
tests \
exp-bbv/tests \
"
# Get the vg test scripts, filters, and expected files
for dir in $subdirs ; do
find $dir | cpio -pvdu ${D}${PTEST_PATH}
done
cd $saved_dir
done
# The scripts reference config.h so add it to the top ptest dir.
cp ${B}/config.h ${D}${PTEST_PATH}
install -D ${WORKDIR}/remove-for-aarch64 ${D}${PTEST_PATH}
install -D ${WORKDIR}/remove-for-all ${D}${PTEST_PATH}
install -D ${WORKDIR}/taskset_nondeterministic_tests ${D}${PTEST_PATH}
# Add an executable need by none/tests/bigcode
mkdir ${D}${PTEST_PATH}/perf
cp ${B}/perf/bigcode ${D}${PTEST_PATH}/perf
# Add an executable needed by memcheck/tests/vcpu_bz2
cp ${B}/perf/bz2 ${D}${PTEST_PATH}/perf
# Make the ptest dir look like the top level valgrind src dir
# This is checked by the gdbserver_tests/make_local_links script
mkdir ${D}${PTEST_PATH}/coregrind
cp ${B}/coregrind/vgdb ${D}${PTEST_PATH}/coregrind
# Add an executable needed by massif tests
cp ${B}/massif/ms_print ${D}${PTEST_PATH}/massif/ms_print
find ${D}${PTEST_PATH} \
\( \
-name "Makefile*" \
-o -name "*.o" \
\) \
-exec rm {} \;
sed -i s:\.\./\.\./callgrind/callgrind_annotate:${bindir}/callgrind_annotate: ${D}${PTEST_PATH}/callgrind/tests/ann1.vgtest
sed -i s:\.\./\.\./callgrind/callgrind_annotate:${bindir}/callgrind_annotate: ${D}${PTEST_PATH}/callgrind/tests/ann2.vgtest
# point the expanded @abs_top_builddir@ of the host to PTEST_PATH
sed -i s:${S}:${PTEST_PATH}:g \
${D}${PTEST_PATH}/memcheck/tests/linux/debuginfod-check.vgtest
# handle multilib
sed -i s:@libdir@:${libdir}:g ${D}${PTEST_PATH}/run-ptest
sed -i s:@libexecdir@:${libexecdir}:g ${D}${PTEST_PATH}/run-ptest
sed -i s:@bindir@:${bindir}:g ${D}${PTEST_PATH}/run-ptest
# enable cachegrind ptests
ln -s ${bindir}/cg_annotate ${D}/${PTEST_PATH}/cachegrind/cg_annotate
ln -s ${bindir}/cg_diff ${D}/${PTEST_PATH}/cachegrind/cg_diff
ln -s ${bindir}/cg_merge ${D}/${PTEST_PATH}/cachegrind/cg_merge
# This test fails on the host as well, using both 3.15 and git master (as of Jan 24 2020)
# https://bugs.kde.org/show_bug.cgi?id=402833
rm ${D}${PTEST_PATH}/memcheck/tests/overlap.vgtest
# This is known failure see https://bugs.kde.org/show_bug.cgi?id=435732
rm ${D}${PTEST_PATH}/memcheck/tests/leak_cpp_interior.vgtest
# https://bugs.kde.org/show_bug.cgi?id=445743
rm ${D}${PTEST_PATH}/drd/tests/pth_mutex_signal
# As the binary isn't stripped or debug-splitted, the source file isn't fetched
# via dwarfsrcfiles either, so it needs to be installed manually.
mkdir -p ${D}${TARGET_DBGSRC_DIR}/none/tests/
install ${S}/none/tests/tls.c ${D}${TARGET_DBGSRC_DIR}/none/tests/
}
do_install_ptest:append:x86-64 () {
# https://bugs.kde.org/show_bug.cgi?id=463456
rm ${D}${PTEST_PATH}/memcheck/tests/origin6-fp.vgtest
# https://bugs.kde.org/show_bug.cgi?id=463458
rm ${D}${PTEST_PATH}/memcheck/tests/vcpu_fnfns.vgtest
# https://bugs.kde.org/show_bug.cgi?id=463463
rm ${D}${PTEST_PATH}/none/tests/amd64/fma.vgtest
}
# avoid stripping some generated binaries otherwise some of the tests will fail
# run-strip-reloc.sh, run-strip-strmerge.sh and so on will fail
INHIBIT_PACKAGE_STRIP_FILES += "\
${PKGD}${PTEST_PATH}/none/tests/tls \
${PKGD}${PTEST_PATH}/none/tests/tls.so \
${PKGD}${PTEST_PATH}/none/tests/tls2.so \
${PKGD}${PTEST_PATH}/helgrind/tests/tc09_bad_unlock \
${PKGD}${PTEST_PATH}/memcheck/tests/manuel1 \
${PKGD}${PTEST_PATH}/drd/tests/pth_detached3 \
"