Compare commits

..

No commits in common. "rawhide" and "f33" have entirely different histories.

29 changed files with 7930 additions and 675 deletions

View file

@ -1 +0,0 @@
1

27
.gitignore vendored
View file

@ -38,30 +38,3 @@
/valgrind-3.16.0.RC2.tar.bz2
/valgrind-3.16.0.tar.bz2
/valgrind-3.16.1.tar.bz2
/valgrind-3.17.0.RC1.tar.bz2
/valgrind-3.17.0.RC2.tar.bz2
/valgrind-3.17.0.tar.bz2
/valgrind-3.18.0.RC1.tar.bz2
/valgrind-3.18.1.tar.bz2
/valgrind-3.19.0.tar.bz2
/valgrind-3.20.0.tar.bz2
/valgrind-3.21.0.RC1.tar.bz2
/valgrind-3.21.0.RC2.tar.bz2
/valgrind-3.21.0.tar.bz2
/valgrind-3.22.0.RC1.tar.bz2
/valgrind-3.22.0.RC2.tar.bz2
/valgrind-3.22.0.tar.bz2
/valgrind-3.23.0.RC1.tar.bz2
/valgrind-3.23.0.RC2.tar.bz2
/valgrind-3.23.0.tar.bz2
/valgrind-3.24.0.tar.bz2
/valgrind-3.25.0.RC1.tar.bz2
/valgrind-3.25.0.RC2.tar.bz2
/valgrind-3.25.0.tar.bz2
/valgrind-3.25.1.tar.bz2
/valgrind-3.26.0.RC1.tar.bz2
/valgrind-3.26.0.tar.bz2
/valgrind-3.27.0.RC1.tar.bz2
/valgrind-3.27.0.RC2.tar.bz2
/valgrind-3.27.0.tar.bz2
/valgrind-3.27.1.tar.bz2

View file

@ -1,20 +0,0 @@
--- !Policy
product_versions:
- fedora-*
decision_context: bodhi_update_push_stable
subject_type: koji_build
rules:
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.rpminspect.static-analysis}
--- !Policy
product_versions:
- rhel-8
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}
--- !Policy
product_versions:
- rhel-9
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}

View file

@ -1,6 +0,0 @@
summary: CI test plan, runs all tests from tests repo.
discover:
how: fmf
url: https://src.fedoraproject.org/tests/valgrind
execute:
how: tmt

View file

@ -1,52 +0,0 @@
---
inspections:
# xml files shipped are GDB register set descriptions which can only be
# verified with gdb/features/gdb-target.dtd, provided in GDB sources.
xml: off
annocheck:
# Currently lto is disabled globally for valgrind, it should be able
# to be enabled through upstream configure --enable-lto in the future.
# Note that all (default hardened) flags need to be repeated here, if
# you override some config flags it will completely overwrite the
# defaults (--ignore-unknown --verbose).
jobs:
- hardened: --ignore-unknown --verbose --skip-lto
# Ignore files built specially without hardening flags
ignore:
# Valgrind tools themselves (memcheck, cachegrind, massif, etc) are
# statically linked and need to be built without PIE to be loaded at
# a fixed address in the program's address space.
# Also need to be built without stack protection so the generated
# code (valgrind VEX jit) interacts correctly with their own static code.
- /usr/libexec/valgrind/*-*-linux
# Wrappers for various string and mem functions such as memcpy, strlen, etc
# that valgrind uses to keep track of memory usage. Hardening settings such
# as optimizations need to be disabled so they don't interfere or break
# the checks that valgrind does internally.
- /usr/libexec/valgrind/vgpreload*so
# libmpiwrap is special since it is a LD_PRELOAD wrapper used by valgrind
# memcheck for MPI using programs, the wrapper is against a specific MPI
# implementation though, in our case openmpi. We don't want to have a hard
# dependency on openmpi however, so a user can use the wrapper without
# explicitly pulling in openmpi unless the program explicitly uses it.
- /usr/lib*/openmpi/valgrind/libmpiwrap-*-linux.so
# These static archives (to create custom valgrind tools) are only
# distributed in valgrind-tools-devel and don't have hardening flags
# for the same reason as the standard tools (see above).
- /usr/lib*/valgrind/*-*linux.a
debuginfo:
ignore:
# We add the debuginfo to vgpreload libraries because we want to show the
# user exactly where the issue is, which we cannot without always having
# the symtab around. The vgpreload libraries are really tiny, so it doesn't
# have a big impact on the package size.
- /usr/libexec/valgrind/vgpreload*.so
runpath:
allowed_paths:
# As described above, libmpiwrap is a wrapper against openmpi
# so we set DT_RUNPATH to openmpi libs path
- /usr/lib/openmpi/lib
- /usr/lib64/openmpi/lib

View file

@ -1 +1 @@
SHA512 (valgrind-3.27.1.tar.bz2) = 4522e345fe31bc10478f21ab261cf7b3e509d80fe98fd0c7c9778ac9a9f90e1d8fa6e54a37c2e23114c01c95131035103fc1e78661710d7f45f5d564a31c1015
SHA512 (valgrind-3.16.1.tar.bz2) = 2a4173efe1b6facdd2f5c5ee8ed006704168eba1813736fccc8191d60363afd96197512cf42037e65f18d4ddd49adc74a54c47210df216fba3c46bf68ef0f950

View file

@ -0,0 +1,117 @@
diff --git a/Makefile.all.am b/Makefile.all.am
index 3786e34..1befef5 100644
--- a/Makefile.all.am
+++ b/Makefile.all.am
@@ -50,20 +50,20 @@ inplace-noinst_DSYMS: build-noinst_DSYMS
done
# This is used by coregrind/Makefile.am and by <tool>/Makefile.am for doing
-# "make install". It copies $(noinst_PROGRAMS) into $prefix/lib/valgrind/.
+# "make install". It copies $(noinst_PROGRAMS) into $prefix/libexec/valgrind/.
# It needs to be depended on by an 'install-exec-local' rule.
install-noinst_PROGRAMS: $(noinst_PROGRAMS)
- $(mkinstalldirs) $(DESTDIR)$(pkglibdir); \
+ $(mkinstalldirs) $(DESTDIR)$(pkglibexecdir); \
for f in $(noinst_PROGRAMS); do \
- $(INSTALL_PROGRAM) $$f $(DESTDIR)$(pkglibdir); \
+ $(INSTALL_PROGRAM) $$f $(DESTDIR)$(pkglibexecdir); \
done
# This is used by coregrind/Makefile.am and by <tool>/Makefile.am for doing
-# "make uninstall". It removes $(noinst_PROGRAMS) from $prefix/lib/valgrind/.
+# "make uninstall". It removes $(noinst_PROGRAMS) from $prefix/libexec/valgrind/.
# It needs to be depended on by an 'uninstall-local' rule.
uninstall-noinst_PROGRAMS:
for f in $(noinst_PROGRAMS); do \
- rm -f $(DESTDIR)$(pkglibdir)/$$f; \
+ rm -f $(DESTDIR)$(pkglibexecdir)/$$f; \
done
# Similar to install-noinst_PROGRAMS.
@@ -71,15 +71,15 @@ uninstall-noinst_PROGRAMS:
# directories. XXX: not sure whether the resulting permissions will be
# correct when using 'cp -R'...
install-noinst_DSYMS: build-noinst_DSYMS
- $(mkinstalldirs) $(DESTDIR)$(pkglibdir); \
+ $(mkinstalldirs) $(DESTDIR)$(pkglibexecdir); \
for f in $(noinst_DSYMS); do \
- cp -R $$f.dSYM $(DESTDIR)$(pkglibdir); \
+ cp -R $$f.dSYM $(DESTDIR)$(pkglibexecdir); \
done
# Similar to uninstall-noinst_PROGRAMS.
uninstall-noinst_DSYMS:
for f in $(noinst_DSYMS); do \
- rm -f $(DESTDIR)$(pkglibdir)/$$f.dSYM; \
+ rm -f $(DESTDIR)$(pkglibexecdir)/$$f.dSYM; \
done
# This needs to be depended on by a 'clean-local' rule.
diff --git a/Makefile.am b/Makefile.am
index 242b38a..3b7c806 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -58,7 +58,7 @@ DEFAULT_SUPP_FILES = @DEFAULT_SUPP@
# default.supp, as it is built from the base .supp files at compile-time.
dist_noinst_DATA = $(SUPP_FILES)
-vglibdir = $(pkglibdir)
+vglibdir = $(pkglibexecdir)
vglib_DATA = default.supp
pkgconfigdir = $(libdir)/pkgconfig
diff --git a/coregrind/Makefile.am b/coregrind/Makefile.am
index 94030fd..f09763a 100644
--- a/coregrind/Makefile.am
+++ b/coregrind/Makefile.am
@@ -11,12 +11,12 @@ include $(top_srcdir)/Makefile.all.am
AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@ += \
-I$(top_srcdir)/coregrind \
- -DVG_LIBDIR="\"$(pkglibdir)"\" \
+ -DVG_LIBDIR="\"$(pkglibexecdir)"\" \
-DVG_PLATFORM="\"@VGCONF_ARCH_PRI@-@VGCONF_OS@\""
if VGCONF_HAVE_PLATFORM_SEC
AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@ += \
-I$(top_srcdir)/coregrind \
- -DVG_LIBDIR="\"$(pkglibdir)"\" \
+ -DVG_LIBDIR="\"$(pkglibexecdir)"\" \
-DVG_PLATFORM="\"@VGCONF_ARCH_SEC@-@VGCONF_OS@\""
endif
@@ -714,7 +714,7 @@ GDBSERVER_XML_FILES = \
m_gdbserver/mips64-fpu.xml
# so as to make sure these get copied into the install tree
-vglibdir = $(pkglibdir)
+vglibdir = $(pkglibexecdir)
vglib_DATA = $(GDBSERVER_XML_FILES)
# so as to make sure these get copied into the tarball
diff --git a/mpi/Makefile.am b/mpi/Makefile.am
index 7ad9a25..471fee0 100644
--- a/mpi/Makefile.am
+++ b/mpi/Makefile.am
@@ -18,16 +18,18 @@ EXTRA_DIST = \
# libmpiwrap-<platform>.so
#----------------------------------------------------------------------------
-noinst_PROGRAMS =
+# These are really real libraries, so they should go to libdir, not libexec.
+mpidir = $(pkglibdir)
+mpi_PROGRAMS =
if BUILD_MPIWRAP_PRI
-noinst_PROGRAMS += libmpiwrap-@VGCONF_ARCH_PRI@-@VGCONF_OS@.so
+mpi_PROGRAMS += libmpiwrap-@VGCONF_ARCH_PRI@-@VGCONF_OS@.so
endif
if BUILD_MPIWRAP_SEC
-noinst_PROGRAMS += libmpiwrap-@VGCONF_ARCH_SEC@-@VGCONF_OS@.so
+mpi_PROGRAMS += libmpiwrap-@VGCONF_ARCH_SEC@-@VGCONF_OS@.so
endif
if VGCONF_OS_IS_DARWIN
-noinst_DSYMS = $(noinst_PROGRAMS)
+mpi_DSYMS = $(mpi_PROGRAMS)
endif

View file

@ -0,0 +1,111 @@
commit 232893d9b3c7d79d018db7f303aee219161a86d0
Author: Anssi Hannula <anssi.hannula@bitwise.fi>
Date: Thu Jul 2 14:49:17 2020 +0300
Fix shmat() on Linux nanomips and x86
On Linux, there are two variants of the direct shmctl syscall:
- sys_shmctl: always uses shmid64_ds, does not accept IPC_64
- sys_old_shmctl: uses shmid_ds or shmid64_ds depending on IPC_64
The following Linux ABIs have the sys_old_shmctl variant:
alpha, arm, microblaze, mips n32/n64, xtensa
Other ABIs (and future ABIs) have the sys_shmctl variant, including ABIs
that only got sys_shmctl in Linux 5.1 (such as x86, mips o32, ppc,
s390x).
We incorrectly assume the sys_old_shmctl variant on nanomips and x86,
causing shmat() calls under valgrind to fail with EINVAL.
On x86, the issue was previously masked by the non-existence of
__NR_shmctl until a9fc7bceeb0b0 ("Update Linux x86 system call number
definitions") in 2019.
On mips o32, ppc, and s390x this issue is not visible as our headers do
not have __NR_shmctl for those ABIs (396 since Linux 5.1).
Fix the issue by correcting the preprocessor check in get_shm_size() to
only assume the old Linux sys_old_shmctl behavior on the specific
affected platforms.
Also, exclude the use of direct shmctl entirely on Linux x86, ppc,
mips o32, s390x in order to keep compatibility with pre-5.1 kernel
versions that did not yet have direct shmctl for those ABIs.
This currently only has actual effect on x86 as only it has __NR_shmctl
in our headers.
Fixes tests mremap4, mremap5, mremap6.
https://bugs.kde.org/show_bug.cgi?id=410743
diff --git a/coregrind/m_syswrap/syswrap-generic.c b/coregrind/m_syswrap/syswrap-generic.c
index badb8c778..7d4b385a3 100644
--- a/coregrind/m_syswrap/syswrap-generic.c
+++ b/coregrind/m_syswrap/syswrap-generic.c
@@ -1960,11 +1960,27 @@ ML_(generic_POST_sys_semctl) ( ThreadId tid,
static
SizeT get_shm_size ( Int shmid )
{
-#if defined(__NR_shmctl)
+ /*
+ * The excluded platforms below gained direct shmctl in Linux 5.1. Keep
+ * using ipc-multiplexed shmctl to keep compatibility with older kernel
+ * versions.
+ */
+#if defined(__NR_shmctl) && \
+ !defined(VGP_x86_linux) && !defined(VGP_mips32_linux) && \
+ !defined(VGP_ppc32_linux) && !defined(VGP_ppc64be_linux) && \
+ !defined(VGP_ppc64le_linux) && !defined(VGP_s390x_linux)
# ifdef VKI_IPC_64
struct vki_shmid64_ds buf;
-# if defined(VGP_amd64_linux) || defined(VGP_arm64_linux)
- /* See bug 222545 comment 7 */
+ /*
+ * On Linux, the following ABIs use old shmid_ds by default with direct
+ * shmctl and require IPC_64 for shmid64_ds (i.e. the direct syscall is
+ * mapped to sys_old_shmctl):
+ * alpha, arm, microblaze, mips n32/n64, xtensa
+ * Other Linux ABIs use shmid64_ds by default and do not recognize IPC_64
+ * with the direct shmctl syscall (but still recognize it for the
+ * ipc-multiplexed version if that exists for the ABI).
+ */
+# if defined(VGO_linux) && !defined(VGP_arm_linux) && !defined(VGP_mips64_linux)
SysRes __res = VG_(do_syscall3)(__NR_shmctl, shmid,
VKI_IPC_STAT, (UWord)&buf);
# else
commit 620dba22be67dea2ada9fa825b2ed4d61774af82
Author: Mark Wielaard <mark@klomp.org>
Date: Wed Feb 3 16:56:14 2021 +0100
syswrap-linux.c: Pass implicit VKI_IPC_64 for shmctl also on arm64.
The shmctl syscall on amd64, arm64 and riscv (but we don't have a port
for that last one) always use IPC_64. Explicitly pass it to the generic
PRE/POST handlers so they select the correct (64bit) data structures on
those architectures.
https://bugzilla.redhat.com/show_bug.cgi?id=1909548
diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c
index 328e02a98..52074149d 100644
--- a/coregrind/m_syswrap/syswrap-linux.c
+++ b/coregrind/m_syswrap/syswrap-linux.c
@@ -5127,7 +5127,7 @@ PRE(sys_shmctl)
PRINT("sys_shmctl ( %ld, %ld, %#" FMT_REGWORD "x )", SARG1, SARG2, ARG3);
PRE_REG_READ3(long, "shmctl",
int, shmid, int, cmd, struct shmid_ds *, buf);
-#ifdef VGP_amd64_linux
+#if defined(VGP_amd64_linux) || defined(VGP_arm64_linux)
ML_(generic_PRE_sys_shmctl)(tid, ARG1,ARG2|VKI_IPC_64,ARG3);
#else
ML_(generic_PRE_sys_shmctl)(tid, ARG1,ARG2,ARG3);
@@ -5136,7 +5136,7 @@ PRE(sys_shmctl)
POST(sys_shmctl)
{
-#ifdef VGP_amd64_linux
+#if defined(VGP_amd64_linux) || defined(VGP_arm64_linux)
ML_(generic_POST_sys_shmctl)(tid, RES,ARG1,ARG2|VKI_IPC_64,ARG3);
#else
ML_(generic_POST_sys_shmctl)(tid, RES,ARG1,ARG2,ARG3);

View file

@ -1,50 +1,69 @@
commit d3c977726064ba09fed6dfc7daf22b16824c97b4
Author: Mark Wielaard <mark@klomp.org>
Date: Fri May 24 18:24:56 2019 +0200
Add -Wl,-z,now to some binaries.
diff --git a/auxprogs/Makefile.am b/auxprogs/Makefile.am
index 2b8703cf1a63..8cb828b85c57 100644
index 1b7842b..e211eec 100644
--- a/auxprogs/Makefile.am
+++ b/auxprogs/Makefile.am
@@ -50,7 +50,7 @@ valgrind_listener_SOURCES = valgrind-listener.c
@@ -32,7 +32,7 @@ valgrind_listener_SOURCES = valgrind-listener.c
valgrind_listener_CPPFLAGS = $(AM_CPPFLAGS_PRI) -I$(top_srcdir)/coregrind
valgrind_listener_CFLAGS = $(AM_CFLAGS_PRI) -fhosted -fstack-protector-strong
valgrind_listener_CFLAGS = $(AM_CFLAGS_PRI) -fstack-protector-strong
valgrind_listener_CCASFLAGS = $(AM_CCASFLAGS_PRI)
-valgrind_listener_LDFLAGS = $(AM_CFLAGS_PRI)
+valgrind_listener_LDFLAGS = $(AM_CFLAGS_PRI) -Wl,-z,now
if VGCONF_PLATVARIANT_IS_ANDROID
valgrind_listener_CFLAGS += -static
endif
@@ -69,7 +69,7 @@ valgrind_di_server_SOURCES = valgrind-di-server.c
@@ -51,7 +51,7 @@ valgrind_di_server_SOURCES = valgrind-di-server.c
valgrind_di_server_CPPFLAGS = $(AM_CPPFLAGS_PRI) -I$(top_srcdir)/coregrind
valgrind_di_server_CFLAGS = $(AM_CFLAGS_PRI) -fhosted -fstack-protector-strong
valgrind_di_server_CFLAGS = $(AM_CFLAGS_PRI) -fstack-protector-strong
valgrind_di_server_CCASFLAGS = $(AM_CCASFLAGS_PRI)
-valgrind_di_server_LDFLAGS = $(AM_CFLAGS_PRI)
+valgrind_di_server_LDFLAGS = $(AM_CFLAGS_PRI) -Wl,-z,now
if VGCONF_PLATVARIANT_IS_ANDROID
valgrind_di_server_CFLAGS += -static
endif
@@ -104,7 +104,7 @@ getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_SOURCES = getoff.c
@@ -86,7 +86,7 @@ getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_SOURCES = getoff.c
getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CPPFLAGS = $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CFLAGS = $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) -fhosted -fstack-protector-strong
getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CFLAGS = $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) -fstack-protector-strong
getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CCASFLAGS = $(AM_CCASFLAGS_PRI)
-getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LDFLAGS = $(AM_CFLAGS_PRI) @LIB_UBSAN@
+getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LDFLAGS = $(AM_CFLAGS_PRI) @LIB_UBSAN@ -Wl,-z,now
if HAVE_DLINFO_RTLD_DI_TLS_MODID
getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LDADD = $(LDADD) -ldl
endif
diff --git a/cachegrind/Makefile.am b/cachegrind/Makefile.am
index f572741..1c07e50 100644
--- a/cachegrind/Makefile.am
+++ b/cachegrind/Makefile.am
@@ -27,7 +27,7 @@ cg_merge_SOURCES = cg_merge.c
cg_merge_CPPFLAGS = $(AM_CPPFLAGS_PRI)
cg_merge_CFLAGS = $(AM_CFLAGS_PRI) -fstack-protector-strong
cg_merge_CCASFLAGS = $(AM_CCASFLAGS_PRI)
-cg_merge_LDFLAGS = $(AM_CFLAGS_PRI)
+cg_merge_LDFLAGS = $(AM_CFLAGS_PRI) -Wl,-z,now
# If there is no secondary platform, and the platforms include x86-darwin,
# then the primary platform must be x86-darwin. Hence:
if ! VGCONF_HAVE_PLATFORM_SEC
diff --git a/coregrind/Makefile.am b/coregrind/Makefile.am
index 0bcb4a4f423f..59fc48052e50 100644
index 3c73210..fb6b7bb 100644
--- a/coregrind/Makefile.am
+++ b/coregrind/Makefile.am
@@ -64,7 +64,7 @@ RANLIB = ${LTO_RANLIB}
@@ -57,7 +57,7 @@ RANLIB = ${LTO_RANLIB}
valgrind_CPPFLAGS = $(AM_CPPFLAGS_PRI)
valgrind_CFLAGS = $(AM_CFLAGS_PRI) $(LTO_CFLAGS) -fhosted -fstack-protector-strong
valgrind_CFLAGS = $(AM_CFLAGS_PRI) $(LTO_CFLAGS) -fstack-protector-strong
valgrind_CCASFLAGS = $(AM_CCASFLAGS_PRI)
-valgrind_LDFLAGS = $(AM_CFLAGS_PRI) @LIB_UBSAN@
+valgrind_LDFLAGS = $(AM_CFLAGS_PRI) @LIB_UBSAN@ -Wl,-z,now
# If there is no secondary platform, and the platforms include x86-darwin,
# then the primary platform must be x86-darwin. Hence:
if ! VGCONF_HAVE_PLATFORM_SEC
@@ -106,7 +106,7 @@ endif
vgdb_CPPFLAGS = $(AM_CPPFLAGS_PRI) $(GDB_SCRIPTS_DIR)
vgdb_CFLAGS = $(AM_CFLAGS_PRI) $(LTO_CFLAGS) -fhosted -fstack-protector-strong
@@ -96,7 +96,7 @@ endif
vgdb_CPPFLAGS = $(AM_CPPFLAGS_PRI)
vgdb_CFLAGS = $(AM_CFLAGS_PRI) $(LTO_CFLAGS) -fstack-protector-strong
vgdb_CCASFLAGS = $(AM_CCASFLAGS_PRI)
-vgdb_LDFLAGS = $(AM_CFLAGS_PRI) @LIB_UBSAN@
+vgdb_LDFLAGS = $(AM_CFLAGS_PRI) @LIB_UBSAN@ -Wl,-z,now

View file

@ -1,49 +1,59 @@
commit b73fb7a614e1b5d60af23fb0752b5cead995e02e
Author: Mark Wielaard <mark@klomp.org>
Date: Sun Apr 14 00:30:05 2019 +0200
Remove no-stack-protector, add stack-protector-strong to some.
diff --git a/auxprogs/Makefile.am b/auxprogs/Makefile.am
index d96e7fd0a968..2b8703cf1a63 100644
index 56cc5ef..1b7842b 100644
--- a/auxprogs/Makefile.am
+++ b/auxprogs/Makefile.am
@@ -48,7 +48,7 @@ bin_PROGRAMS = valgrind-listener valgrind-di-server
@@ -30,7 +30,7 @@ bin_PROGRAMS = valgrind-listener valgrind-di-server
valgrind_listener_SOURCES = valgrind-listener.c
valgrind_listener_CPPFLAGS = $(AM_CPPFLAGS_PRI) -I$(top_srcdir)/coregrind
-valgrind_listener_CFLAGS = $(AM_CFLAGS_PRI) -fhosted
+valgrind_listener_CFLAGS = $(AM_CFLAGS_PRI) -fhosted -fstack-protector-strong
-valgrind_listener_CFLAGS = $(AM_CFLAGS_PRI)
+valgrind_listener_CFLAGS = $(AM_CFLAGS_PRI) -fstack-protector-strong
valgrind_listener_CCASFLAGS = $(AM_CCASFLAGS_PRI)
valgrind_listener_LDFLAGS = $(AM_CFLAGS_PRI)
if VGCONF_PLATVARIANT_IS_ANDROID
@@ -67,7 +67,7 @@ endif
@@ -49,7 +49,7 @@ endif
valgrind_di_server_SOURCES = valgrind-di-server.c
valgrind_di_server_CPPFLAGS = $(AM_CPPFLAGS_PRI) -I$(top_srcdir)/coregrind
-valgrind_di_server_CFLAGS = $(AM_CFLAGS_PRI) -fhosted
+valgrind_di_server_CFLAGS = $(AM_CFLAGS_PRI) -fhosted -fstack-protector-strong
-valgrind_di_server_CFLAGS = $(AM_CFLAGS_PRI)
+valgrind_di_server_CFLAGS = $(AM_CFLAGS_PRI) -fstack-protector-strong
valgrind_di_server_CCASFLAGS = $(AM_CCASFLAGS_PRI)
valgrind_di_server_LDFLAGS = $(AM_CFLAGS_PRI)
if VGCONF_PLATVARIANT_IS_ANDROID
@@ -102,7 +102,7 @@ endif
@@ -84,7 +84,7 @@ endif
getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_SOURCES = getoff.c
getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CPPFLAGS = $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
-getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CFLAGS = $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) -fhosted
+getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CFLAGS = $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) -fhosted -fstack-protector-strong
-getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CFLAGS = $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
+getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CFLAGS = $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) -fstack-protector-strong
getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CCASFLAGS = $(AM_CCASFLAGS_PRI)
getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LDFLAGS = $(AM_CFLAGS_PRI) @LIB_UBSAN@
if HAVE_DLINFO_RTLD_DI_TLS_MODID
@@ -119,7 +119,7 @@ endif
if VGCONF_HAVE_PLATFORM_SEC
getoff_@VGCONF_ARCH_SEC@_@VGCONF_OS@_SOURCES = getoff.c
getoff_@VGCONF_ARCH_SEC@_@VGCONF_OS@_CPPFLAGS = $(AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@)
-getoff_@VGCONF_ARCH_SEC@_@VGCONF_OS@_CFLAGS = $(AM_CFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) -fhosted
+getoff_@VGCONF_ARCH_SEC@_@VGCONF_OS@_CFLAGS = $(AM_CFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) -fhosted -fstack-protector-strong
getoff_@VGCONF_ARCH_SEC@_@VGCONF_OS@_CCASFLAGS = $(AM_CCASFLAGS_SEC)
getoff_@VGCONF_ARCH_SEC@_@VGCONF_OS@_LDFLAGS = $(AM_CFLAGS_SEC)
if HAVE_DLINFO_RTLD_DI_TLS_MODID
diff --git a/cachegrind/Makefile.am b/cachegrind/Makefile.am
index f8447a1..f572741 100644
--- a/cachegrind/Makefile.am
+++ b/cachegrind/Makefile.am
@@ -25,7 +25,7 @@ bin_PROGRAMS = cg_merge
cg_merge_SOURCES = cg_merge.c
cg_merge_CPPFLAGS = $(AM_CPPFLAGS_PRI)
-cg_merge_CFLAGS = $(AM_CFLAGS_PRI)
+cg_merge_CFLAGS = $(AM_CFLAGS_PRI) -fstack-protector-strong
cg_merge_CCASFLAGS = $(AM_CCASFLAGS_PRI)
cg_merge_LDFLAGS = $(AM_CFLAGS_PRI)
# If there is no secondary platform, and the platforms include x86-darwin,
diff --git a/configure.ac b/configure.ac
index 90fafaf1c557..84a3d22c5bff 100644
index f8c798b..ccc8f52 100755
--- a/configure.ac
+++ b/configure.ac
@@ -3004,24 +3004,24 @@
fi
@@ -2188,24 +2188,24 @@ AC_LANG(C)
AC_SUBST(FLAG_FALIGNED_NEW)
# does this compiler support -fno-stack-protector ?
-AC_MSG_CHECKING([if gcc accepts -fno-stack-protector])
@ -85,24 +95,24 @@ index 90fafaf1c557..84a3d22c5bff 100644
# does this compiler support -finline-functions ?
diff --git a/coregrind/Makefile.am b/coregrind/Makefile.am
index 4ead1542b0c7..0bcb4a4f423f 100644
index 94030fd..3c73210 100644
--- a/coregrind/Makefile.am
+++ b/coregrind/Makefile.am
@@ -62,7 +62,7 @@ AR = ${LTO_AR}
@@ -55,7 +55,7 @@ AR = ${LTO_AR}
RANLIB = ${LTO_RANLIB}
valgrind_CPPFLAGS = $(AM_CPPFLAGS_PRI)
-valgrind_CFLAGS = $(AM_CFLAGS_PRI) $(LTO_CFLAGS) -fhosted
+valgrind_CFLAGS = $(AM_CFLAGS_PRI) $(LTO_CFLAGS) -fhosted -fstack-protector-strong
-valgrind_CFLAGS = $(AM_CFLAGS_PRI) $(LTO_CFLAGS)
+valgrind_CFLAGS = $(AM_CFLAGS_PRI) $(LTO_CFLAGS) -fstack-protector-strong
valgrind_CCASFLAGS = $(AM_CCASFLAGS_PRI)
valgrind_LDFLAGS = $(AM_CFLAGS_PRI) @LIB_UBSAN@
# If there is no secondary platform, and the platforms include x86-darwin,
@@ -104,7 +104,7 @@ vgdb_SOURCES += vgdb-invoker-freebsd.c
@@ -94,7 +94,7 @@ vgdb_SOURCES += vgdb-invoker-solaris.c
endif
vgdb_CPPFLAGS = $(AM_CPPFLAGS_PRI) $(GDB_SCRIPTS_DIR)
-vgdb_CFLAGS = $(AM_CFLAGS_PRI) $(LTO_CFLAGS) -fhosted
+vgdb_CFLAGS = $(AM_CFLAGS_PRI) $(LTO_CFLAGS) -fhosted -fstack-protector-strong
vgdb_CPPFLAGS = $(AM_CPPFLAGS_PRI)
-vgdb_CFLAGS = $(AM_CFLAGS_PRI) $(LTO_CFLAGS)
+vgdb_CFLAGS = $(AM_CFLAGS_PRI) $(LTO_CFLAGS) -fstack-protector-strong
vgdb_CCASFLAGS = $(AM_CCASFLAGS_PRI)
vgdb_LDFLAGS = $(AM_CFLAGS_PRI) @LIB_UBSAN@
if VGCONF_PLATVARIANT_IS_ANDROID

View file

@ -0,0 +1,34 @@
diff --git a/none/tests/ppc64/ldst_multiple.vgtest b/none/tests/ppc64/ldst_multiple.vgtest
index 87e668e09..22dd46c99 100644
--- a/none/tests/ppc64/ldst_multiple.vgtest
+++ b/none/tests/ppc64/ldst_multiple.vgtest
@@ -1 +1,2 @@
+prereq: ../../../tests/is_ppc64_BE
prog: ldst_multiple
--- valgrind-3.16.1/none/tests/ppc64/Makefile.am.orig 2020-10-18 20:43:34.579699246 +0200
+++ valgrind-3.16.1/none/tests/ppc64/Makefile.am 2020-10-18 20:44:52.950198040 +0200
@@ -54,17 +54,22 @@
check_PROGRAMS = \
allexec \
- lsw jm-insns round \
+ jm-insns round \
test_isa_2_06_part1 test_isa_2_06_part2 test_isa_2_06_part3 \
test_dfp1 test_dfp2 test_dfp3 test_dfp4 test_dfp5 \
test_isa_2_07_part1 test_isa_2_07_part2 \
test_isa_3_0 \
subnormal_test \
- test_tm test_touch_tm ldst_multiple data-cache-instructions \
+ test_tm test_touch_tm data-cache-instructions \
power6_mf_gpr std_reg_imm \
twi_tdi tw_td power6_bcmp
+# lsw and ldst_multiple compile (and run) only on big endian.
+if VGCONF_PLATFORMS_INCLUDE_PPC64BE_LINUX
+check_PROGRAMS += lsw ldst_multiple
+endif
+
AM_CFLAGS += @FLAG_M64@
AM_CXXFLAGS += @FLAG_M64@
AM_CCASFLAGS += @FLAG_M64@

View file

@ -0,0 +1,38 @@
commit e2dec0ff9b1e071779bee2c4e6fc82f8194b1c1d
Author: Mark Wielaard <mark@klomp.org>
Date: Sun Jul 26 21:17:23 2020 +0200
Handle REX prefixed JMP instruction.
The NET Core runtime might generate a JMP with a REX prefix.
For Jv (32bit offset) and Jb (8bit offset) this is valid.
Prefixes that change operand size are ignored for such JMPs.
So remove the check for sz == 4 and force sz = 4 for Jv.
https://bugs.kde.org/show_bug.cgi?id=422174
diff --git a/VEX/priv/guest_amd64_toIR.c b/VEX/priv/guest_amd64_toIR.c
index fadf47d41..7888132eb 100644
--- a/VEX/priv/guest_amd64_toIR.c
+++ b/VEX/priv/guest_amd64_toIR.c
@@ -21392,8 +21392,8 @@ Long dis_ESC_NONE (
case 0xE9: /* Jv (jump, 16/32 offset) */
if (haveF3(pfx)) goto decode_failure;
- if (sz != 4)
- goto decode_failure; /* JRS added 2004 July 11 */
+ sz = 4; /* Prefixes that change operand size are ignored for this
+ instruction. Operand size is forced to 32bit. */
if (haveF2(pfx)) DIP("bnd ; "); /* MPX bnd prefix. */
d64 = (guest_RIP_bbstart+delta+sz) + getSDisp(sz,delta);
delta += sz;
@@ -21404,8 +21404,7 @@ Long dis_ESC_NONE (
case 0xEB: /* Jb (jump, byte offset) */
if (haveF3(pfx)) goto decode_failure;
- if (sz != 4)
- goto decode_failure; /* JRS added 2004 July 11 */
+ /* Prefixes that change operand size are ignored for this instruction. */
if (haveF2(pfx)) DIP("bnd ; "); /* MPX bnd prefix. */
d64 = (guest_RIP_bbstart+delta+1) + getSDisp8(delta);
delta++;

View file

@ -0,0 +1,19 @@
commit 359b98828ced9cfff8c1badfed75c7ef999cfee5
Author: Julian Seward <jseward@acm.org>
Date: Sun Nov 15 18:28:09 2020 +0100
memcheck: on arm64, use expensive instrumentation for Cmp{EQ,NE}64 by default.
diff --git a/memcheck/mc_translate.c b/memcheck/mc_translate.c
index b32c9c9c5..e91d51094 100644
--- a/memcheck/mc_translate.c
+++ b/memcheck/mc_translate.c
@@ -8485,6 +8485,8 @@ IRSB* MC_(instrument) ( VgCallbackClosure* closure,
# elif defined(VGA_ppc64le)
// Needed by (at least) set_AV_CR6() in the front end.
mce.dlbo.dl_CmpEQ64_CmpNE64 = DLexpensive;
+# elif defined(VGA_arm64)
+ mce.dlbo.dl_CmpEQ64_CmpNE64 = DLexpensive;
# endif
/* preInstrumentationAnalysis() will allocate &mce.tmpHowUsed and then

View file

@ -0,0 +1,729 @@
From 04cdc29b007594a0e58ffef0c9dd87df3ea595ea Mon Sep 17 00:00:00 2001
From: Mark Wielaard <mark@klomp.org>
Date: Wed, 14 Oct 2020 06:11:34 -0400
Subject: [PATCH] arm64 VEX frontend and backend support for
Iop_M{Add,Sub}F{32,64}
The arm64 frontend used to implement the scalar fmadd, fmsub, fnmadd
and fnmsub iinstructions into separate addition/substraction and
multiplication instructions, which caused rounding issues.
This patch turns them into Iop_M{Add,Sub}F{32,64} instructions
(with some arguments negated). And the backend now emits fmadd or fmsub
instructions.
Alexandra Hajkova <ahajkova@redhat.com> added tests and fixed up the
implementation to make sure rounding (and sign) are correct now.
https://bugs.kde.org/show_bug.cgi?id=426014
---
VEX/priv/guest_arm64_toIR.c | 58 ++++++++---
VEX/priv/host_arm64_defs.c | 136 +++++++++++++++++++++++++-
VEX/priv/host_arm64_defs.h | 30 ++++++
VEX/priv/host_arm64_isel.c | 39 ++++++++
none/tests/arm64/Makefile.am | 6 +-
none/tests/arm64/fmadd_sub.c | 98 +++++++++++++++++++
none/tests/arm64/fmadd_sub.stderr.exp | 0
none/tests/arm64/fmadd_sub.stdout.exp | 125 +++++++++++++++++++++++
none/tests/arm64/fmadd_sub.vgtest | 3 +
9 files changed, 479 insertions(+), 16 deletions(-)
create mode 100644 none/tests/arm64/fmadd_sub.c
create mode 100644 none/tests/arm64/fmadd_sub.stderr.exp
create mode 100644 none/tests/arm64/fmadd_sub.stdout.exp
create mode 100644 none/tests/arm64/fmadd_sub.vgtest
diff --git a/VEX/priv/guest_arm64_toIR.c b/VEX/priv/guest_arm64_toIR.c
index 556b85a6a..d242d43c0 100644
--- a/VEX/priv/guest_arm64_toIR.c
+++ b/VEX/priv/guest_arm64_toIR.c
@@ -286,6 +286,12 @@ static IRExpr* triop ( IROp op, IRExpr* a1, IRExpr* a2, IRExpr* a3 )
return IRExpr_Triop(op, a1, a2, a3);
}
+static IRExpr* qop ( IROp op, IRExpr* a1, IRExpr* a2,
+ IRExpr* a3, IRExpr* a4 )
+{
+ return IRExpr_Qop(op, a1, a2, a3, a4);
+}
+
static IRExpr* loadLE ( IRType ty, IRExpr* addr )
{
return IRExpr_Load(Iend_LE, ty, addr);
@@ -532,6 +538,22 @@ static IROp mkADDF ( IRType ty ) {
}
}
+static IROp mkFMADDF ( IRType ty ) {
+ switch (ty) {
+ case Ity_F32: return Iop_MAddF32;
+ case Ity_F64: return Iop_MAddF64;
+ default: vpanic("mkFMADDF");
+ }
+}
+
+static IROp mkFMSUBF ( IRType ty ) {
+ switch (ty) {
+ case Ity_F32: return Iop_MSubF32;
+ case Ity_F64: return Iop_MSubF64;
+ default: vpanic("mkFMSUBF");
+ }
+}
+
static IROp mkSUBF ( IRType ty ) {
switch (ty) {
case Ity_F32: return Iop_SubF32;
@@ -14368,30 +14390,40 @@ Bool dis_AdvSIMD_fp_data_proc_3_source(/*MB_OUT*/DisResult* dres, UInt insn)
where Fx=Dx when sz=1, Fx=Sx when sz=0
-----SPEC------ ----IMPL----
- fmadd a + n * m a + n * m
- fmsub a + (-n) * m a - n * m
- fnmadd (-a) + (-n) * m -(a + n * m)
- fnmsub (-a) + n * m -(a - n * m)
+ fmadd a + n * m fmadd (a, n, m)
+ fmsub a + (-n) * m fmsub (a, n, m)
+ fnmadd (-a) + (-n) * m fmadd (-a, -n, m)
+ fnmsub (-a) + n * m fmadd (-a, n, m)
+
+ Note Iop_MAdd/SubF32/64 take arguments in the order: rm, N, M, A
*/
Bool isD = (ty & 1) == 1;
UInt ix = (bitO1 << 1) | bitO0;
IRType ity = isD ? Ity_F64 : Ity_F32;
- IROp opADD = mkADDF(ity);
- IROp opSUB = mkSUBF(ity);
- IROp opMUL = mkMULF(ity);
+ IROp opFMADD = mkFMADDF(ity);
+ IROp opFMSUB = mkFMSUBF(ity);
IROp opNEG = mkNEGF(ity);
IRTemp res = newTemp(ity);
IRExpr* eA = getQRegLO(aa, ity);
IRExpr* eN = getQRegLO(nn, ity);
IRExpr* eM = getQRegLO(mm, ity);
IRExpr* rm = mkexpr(mk_get_IR_rounding_mode());
- IRExpr* eNxM = triop(opMUL, rm, eN, eM);
switch (ix) {
- case 0: assign(res, triop(opADD, rm, eA, eNxM)); break;
- case 1: assign(res, triop(opSUB, rm, eA, eNxM)); break;
- case 2: assign(res, unop(opNEG, triop(opADD, rm, eA, eNxM))); break;
- case 3: assign(res, unop(opNEG, triop(opSUB, rm, eA, eNxM))); break;
- default: vassert(0);
+ case 0: /* FMADD */
+ assign(res, qop(opFMADD, rm, eN, eM, eA));
+ break;
+ case 1: /* FMSUB */
+ assign(res, qop(opFMSUB, rm, eN, eM, eA));
+ break;
+ case 2: /* FNMADD */
+ assign(res, qop(opFMADD, rm, unop(opNEG, eN), eM,
+ unop(opNEG,eA)));
+ break;
+ case 3: /* FNMSUB */
+ assign(res, qop(opFMADD, rm, eN, eM, unop(opNEG, eA)));
+ break;
+ default:
+ vassert(0);
}
putQReg128(dd, mkV128(0x0000));
putQRegLO(dd, mkexpr(res));
diff --git a/VEX/priv/host_arm64_defs.c b/VEX/priv/host_arm64_defs.c
index e4ef56986..13b497f60 100644
--- a/VEX/priv/host_arm64_defs.c
+++ b/VEX/priv/host_arm64_defs.c
@@ -546,6 +546,14 @@ static const HChar* showARM64FpBinOp ( ARM64FpBinOp op ) {
}
}
+static const HChar* showARM64FpTriOp ( ARM64FpTriOp op ) {
+ switch (op) {
+ case ARM64fpt_FMADD: return "fmadd";
+ case ARM64fpt_FMSUB: return "fmsub";
+ default: vpanic("showARM64FpTriOp");
+ }
+}
+
static const HChar* showARM64FpUnaryOp ( ARM64FpUnaryOp op ) {
switch (op) {
case ARM64fpu_NEG: return "neg ";
@@ -1154,6 +1162,28 @@ ARM64Instr* ARM64Instr_VBinS ( ARM64FpBinOp op,
i->ARM64in.VBinS.argR = argR;
return i;
}
+ARM64Instr* ARM64Instr_VTriD ( ARM64FpTriOp op,
+ HReg dst, HReg arg1, HReg arg2, HReg arg3 ) {
+ ARM64Instr* i = LibVEX_Alloc_inline(sizeof(ARM64Instr));
+ i->tag = ARM64in_VTriD;
+ i->ARM64in.VTriD.op = op;
+ i->ARM64in.VTriD.dst = dst;
+ i->ARM64in.VTriD.arg1 = arg1;
+ i->ARM64in.VTriD.arg2 = arg2;
+ i->ARM64in.VTriD.arg3 = arg3;
+ return i;
+}
+ARM64Instr* ARM64Instr_VTriS ( ARM64FpTriOp op,
+ HReg dst, HReg arg1, HReg arg2, HReg arg3 ) {
+ ARM64Instr* i = LibVEX_Alloc_inline(sizeof(ARM64Instr));
+ i->tag = ARM64in_VTriS;
+ i->ARM64in.VTriS.op = op;
+ i->ARM64in.VTriS.dst = dst;
+ i->ARM64in.VTriS.arg1 = arg1;
+ i->ARM64in.VTriS.arg2 = arg2;
+ i->ARM64in.VTriS.arg3 = arg3;
+ return i;
+}
ARM64Instr* ARM64Instr_VCmpD ( HReg argL, HReg argR ) {
ARM64Instr* i = LibVEX_Alloc_inline(sizeof(ARM64Instr));
i->tag = ARM64in_VCmpD;
@@ -1756,6 +1786,26 @@ void ppARM64Instr ( const ARM64Instr* i ) {
vex_printf(", ");
ppHRegARM64asSreg(i->ARM64in.VBinS.argR);
return;
+ case ARM64in_VTriD:
+ vex_printf("f%s ", showARM64FpTriOp(i->ARM64in.VTriD.op));
+ ppHRegARM64(i->ARM64in.VTriD.dst);
+ vex_printf(", ");
+ ppHRegARM64(i->ARM64in.VTriD.arg1);
+ vex_printf(", ");
+ ppHRegARM64(i->ARM64in.VTriD.arg2);
+ vex_printf(", ");
+ ppHRegARM64(i->ARM64in.VTriD.arg3);
+ return;
+ case ARM64in_VTriS:
+ vex_printf("f%s ", showARM64FpTriOp(i->ARM64in.VTriS.op));
+ ppHRegARM64asSreg(i->ARM64in.VTriS.dst);
+ vex_printf(", ");
+ ppHRegARM64asSreg(i->ARM64in.VTriS.arg1);
+ vex_printf(", ");
+ ppHRegARM64asSreg(i->ARM64in.VTriS.arg2);
+ vex_printf(", ");
+ ppHRegARM64asSreg(i->ARM64in.VTriS.arg3);
+ return;
case ARM64in_VCmpD:
vex_printf("fcmp ");
ppHRegARM64(i->ARM64in.VCmpD.argL);
@@ -2197,6 +2247,18 @@ void getRegUsage_ARM64Instr ( HRegUsage* u, const ARM64Instr* i, Bool mode64 )
addHRegUse(u, HRmRead, i->ARM64in.VBinS.argL);
addHRegUse(u, HRmRead, i->ARM64in.VBinS.argR);
return;
+ case ARM64in_VTriD:
+ addHRegUse(u, HRmWrite, i->ARM64in.VTriD.dst);
+ addHRegUse(u, HRmRead, i->ARM64in.VTriD.arg1);
+ addHRegUse(u, HRmRead, i->ARM64in.VTriD.arg2);
+ addHRegUse(u, HRmRead, i->ARM64in.VTriD.arg3);
+ return;
+ case ARM64in_VTriS:
+ addHRegUse(u, HRmWrite, i->ARM64in.VTriS.dst);
+ addHRegUse(u, HRmRead, i->ARM64in.VTriS.arg1);
+ addHRegUse(u, HRmRead, i->ARM64in.VTriS.arg2);
+ addHRegUse(u, HRmRead, i->ARM64in.VTriS.arg3);
+ return;
case ARM64in_VCmpD:
addHRegUse(u, HRmRead, i->ARM64in.VCmpD.argL);
addHRegUse(u, HRmRead, i->ARM64in.VCmpD.argR);
@@ -2454,6 +2516,18 @@ void mapRegs_ARM64Instr ( HRegRemap* m, ARM64Instr* i, Bool mode64 )
i->ARM64in.VBinS.argL = lookupHRegRemap(m, i->ARM64in.VBinS.argL);
i->ARM64in.VBinS.argR = lookupHRegRemap(m, i->ARM64in.VBinS.argR);
return;
+ case ARM64in_VTriD:
+ i->ARM64in.VTriD.dst = lookupHRegRemap(m, i->ARM64in.VTriD.dst);
+ i->ARM64in.VTriD.arg1 = lookupHRegRemap(m, i->ARM64in.VTriD.arg1);
+ i->ARM64in.VTriD.arg2 = lookupHRegRemap(m, i->ARM64in.VTriD.arg2);
+ i->ARM64in.VTriD.arg3 = lookupHRegRemap(m, i->ARM64in.VTriD.arg3);
+ return;
+ case ARM64in_VTriS:
+ i->ARM64in.VTriS.dst = lookupHRegRemap(m, i->ARM64in.VTriS.dst);
+ i->ARM64in.VTriS.arg1 = lookupHRegRemap(m, i->ARM64in.VTriS.arg1);
+ i->ARM64in.VTriS.arg2 = lookupHRegRemap(m, i->ARM64in.VTriS.arg2);
+ i->ARM64in.VTriS.arg3 = lookupHRegRemap(m, i->ARM64in.VTriS.arg3);
+ return;
case ARM64in_VCmpD:
i->ARM64in.VCmpD.argL = lookupHRegRemap(m, i->ARM64in.VCmpD.argL);
i->ARM64in.VCmpD.argR = lookupHRegRemap(m, i->ARM64in.VCmpD.argR);
@@ -2812,7 +2886,8 @@ static inline UInt qregEnc ( HReg r )
#define X11110011 BITS8(1,1,1,1,0,0,1,1)
#define X11110101 BITS8(1,1,1,1,0,1,0,1)
#define X11110111 BITS8(1,1,1,1,0,1,1,1)
-
+#define X11111000 BITS8(1,1,1,1,1,0,0,0)
+#define X11111010 BITS8(1,1,1,1,1,0,1,0)
/* --- 4 fields --- */
@@ -2972,6 +3047,27 @@ static inline UInt X_3_6_1_6_6_5_5 ( UInt f1, UInt f2, UInt f3,
}
+static inline UInt X_3_8_5_1_5_5_5 ( UInt f1, UInt f2, UInt f3, UInt f4,
+ UInt f5, UInt f6, UInt f7 ) {
+ vassert(3+8+5+1+5+5+5 == 32);
+ vassert(f1 < (1<<3));
+ vassert(f2 < (1<<8));
+ vassert(f3 < (1<<5));
+ vassert(f4 < (1<<1));
+ vassert(f5 < (1<<5));
+ vassert(f6 < (1<<5));
+ vassert(f7 < (1<<5));
+ UInt w = 0;
+ w = (w << 3) | f1;
+ w = (w << 8) | f2;
+ w = (w << 5) | f3;
+ w = (w << 1) | f4;
+ w = (w << 5) | f5;
+ w = (w << 5) | f6;
+ w = (w << 5) | f7;
+ return w;
+}
+
//ZZ #define X0000 BITS4(0,0,0,0)
//ZZ #define X0001 BITS4(0,0,0,1)
//ZZ #define X0010 BITS4(0,0,1,0)
@@ -4339,6 +4435,44 @@ Int emit_ARM64Instr ( /*MB_MOD*/Bool* is_profInc,
= X_3_8_5_6_5_5(X000, X11110001, sM, (b1512 << 2) | X10, sN, sD);
goto done;
}
+ case ARM64in_VTriD: {
+ /* 31 20 15 14 9 4
+ 000 11111 010 m 0 a n d FMADD Dd,Dn,Dm,Da
+ ---------------- 1 ------ FMSUB -----------
+ */
+ UInt dD = dregEnc(i->ARM64in.VTriD.dst);
+ UInt dN = dregEnc(i->ARM64in.VTriD.arg1);
+ UInt dM = dregEnc(i->ARM64in.VTriD.arg2);
+ UInt dA = dregEnc(i->ARM64in.VTriD.arg3);
+ UInt b15 = 2; /* impossible */
+ switch (i->ARM64in.VTriD.op) {
+ case ARM64fpt_FMADD: b15 = 0; break;
+ case ARM64fpt_FMSUB: b15 = 1; break;
+ default: goto bad;
+ }
+ vassert(b15 < 2);
+ *p++ = X_3_8_5_1_5_5_5(X000, X11111010, dM, b15, dA, dN, dD);
+ goto done;
+ }
+ case ARM64in_VTriS: {
+ /* 31 20 15 14 9 4
+ 000 11111 000 m 0 a n d FMADD Dd,Dn,Dm,Da
+ ---------------- 1 ------ FMSUB -----------
+ */
+ UInt dD = dregEnc(i->ARM64in.VTriD.dst);
+ UInt dN = dregEnc(i->ARM64in.VTriD.arg1);
+ UInt dM = dregEnc(i->ARM64in.VTriD.arg2);
+ UInt dA = dregEnc(i->ARM64in.VTriD.arg3);
+ UInt b15 = 2; /* impossible */
+ switch (i->ARM64in.VTriD.op) {
+ case ARM64fpt_FMADD: b15 = 0; break;
+ case ARM64fpt_FMSUB: b15 = 1; break;
+ default: goto bad;
+ }
+ vassert(b15 < 2);
+ *p++ = X_3_8_5_1_5_5_5(X000, X11111000, dM, b15, dA, dN, dD);
+ goto done;
+ }
case ARM64in_VCmpD: {
/* 000 11110 01 1 m 00 1000 n 00 000 FCMP Dn, Dm */
UInt dN = dregEnc(i->ARM64in.VCmpD.argL);
diff --git a/VEX/priv/host_arm64_defs.h b/VEX/priv/host_arm64_defs.h
index 05dba7ab8..5a82564ce 100644
--- a/VEX/priv/host_arm64_defs.h
+++ b/VEX/priv/host_arm64_defs.h
@@ -289,6 +289,14 @@ typedef
}
ARM64FpBinOp;
+typedef
+ enum {
+ ARM64fpt_FMADD=105,
+ ARM64fpt_FMSUB,
+ ARM64fpt_INVALID
+ }
+ ARM64FpTriOp;
+
typedef
enum {
ARM64fpu_NEG=110,
@@ -498,6 +506,8 @@ typedef
ARM64in_VUnaryS,
ARM64in_VBinD,
ARM64in_VBinS,
+ ARM64in_VTriD,
+ ARM64in_VTriS,
ARM64in_VCmpD,
ARM64in_VCmpS,
ARM64in_VFCSel,
@@ -799,6 +809,22 @@ typedef
HReg argL;
HReg argR;
} VBinS;
+ /* 64-bit FP ternary arithmetic */
+ struct {
+ ARM64FpTriOp op;
+ HReg dst;
+ HReg arg1;
+ HReg arg2;
+ HReg arg3;
+ } VTriD;
+ /* 32-bit FP ternary arithmetic */
+ struct {
+ ARM64FpTriOp op;
+ HReg dst;
+ HReg arg1;
+ HReg arg2;
+ HReg arg3;
+ } VTriS;
/* 64-bit FP compare */
struct {
HReg argL;
@@ -970,6 +996,10 @@ extern ARM64Instr* ARM64Instr_VUnaryD ( ARM64FpUnaryOp op, HReg dst, HReg src );
extern ARM64Instr* ARM64Instr_VUnaryS ( ARM64FpUnaryOp op, HReg dst, HReg src );
extern ARM64Instr* ARM64Instr_VBinD ( ARM64FpBinOp op, HReg, HReg, HReg );
extern ARM64Instr* ARM64Instr_VBinS ( ARM64FpBinOp op, HReg, HReg, HReg );
+extern ARM64Instr* ARM64Instr_VTriD ( ARM64FpTriOp op, HReg dst,
+ HReg, HReg, HReg );
+extern ARM64Instr* ARM64Instr_VTriS ( ARM64FpTriOp op, HReg dst,
+ HReg, HReg, HReg );
extern ARM64Instr* ARM64Instr_VCmpD ( HReg argL, HReg argR );
extern ARM64Instr* ARM64Instr_VCmpS ( HReg argL, HReg argR );
extern ARM64Instr* ARM64Instr_VFCSel ( HReg dst, HReg argL, HReg argR,
diff --git a/VEX/priv/host_arm64_isel.c b/VEX/priv/host_arm64_isel.c
index 2f19eab81..da1218715 100644
--- a/VEX/priv/host_arm64_isel.c
+++ b/VEX/priv/host_arm64_isel.c
@@ -3255,6 +3255,25 @@ static HReg iselDblExpr_wrk ( ISelEnv* env, IRExpr* e )
}
}
+ if (e->tag == Iex_Qop) {
+ IRQop* qop = e->Iex.Qop.details;
+ ARM64FpTriOp triop = ARM64fpt_INVALID;
+ switch (qop->op) {
+ case Iop_MAddF64: triop = ARM64fpt_FMADD; break;
+ case Iop_MSubF64: triop = ARM64fpt_FMSUB; break;
+ default: break;
+ }
+ if (triop != ARM64fpt_INVALID) {
+ HReg N = iselDblExpr(env, qop->arg2);
+ HReg M = iselDblExpr(env, qop->arg3);
+ HReg A = iselDblExpr(env, qop->arg4);
+ HReg dst = newVRegD(env);
+ set_FPCR_rounding_mode(env, qop->arg1);
+ addInstr(env, ARM64Instr_VTriD(triop, dst, N, M, A));
+ return dst;
+ }
+ }
+
if (e->tag == Iex_ITE) {
/* ITE(ccexpr, iftrue, iffalse) */
ARM64CondCode cc;
@@ -3450,6 +3469,26 @@ static HReg iselFltExpr_wrk ( ISelEnv* env, IRExpr* e )
return dst;
}
+ if (e->tag == Iex_Qop) {
+ IRQop* qop = e->Iex.Qop.details;
+ ARM64FpTriOp triop = ARM64fpt_INVALID;
+ switch (qop->op) {
+ case Iop_MAddF32: triop = ARM64fpt_FMADD; break;
+ case Iop_MSubF32: triop = ARM64fpt_FMSUB; break;
+ default: break;
+ }
+
+ if (triop != ARM64fpt_INVALID) {
+ HReg N = iselFltExpr(env, qop->arg2);
+ HReg M = iselFltExpr(env, qop->arg3);
+ HReg A = iselFltExpr(env, qop->arg4);
+ HReg dst = newVRegD(env);
+ set_FPCR_rounding_mode(env, qop->arg1);
+ addInstr(env, ARM64Instr_VTriS(triop, dst, N, M, A));
+ return dst;
+ }
+ }
+
ppIRExpr(e);
vpanic("iselFltExpr_wrk");
}
diff --git a/none/tests/arm64/Makefile.am b/none/tests/arm64/Makefile.am
index 7b3ebbdca..4ecab36ad 100644
--- a/none/tests/arm64/Makefile.am
+++ b/none/tests/arm64/Makefile.am
@@ -10,14 +10,16 @@ EXTRA_DIST = \
integer.stdout.exp integer.stderr.exp integer.vgtest \
memory.stdout.exp memory.stderr.exp memory.vgtest \
atomics_v81.stdout.exp atomics_v81.stderr.exp atomics_v81.vgtest \
- simd_v81.stdout.exp simd_v81.stderr.exp simd_v81.vgtest
+ simd_v81.stdout.exp simd_v81.stderr.exp simd_v81.vgtest \
+ fmadd_sub.stdout.exp fmadd_sub.stderr.exp fmadd_sub.vgtest
check_PROGRAMS = \
allexec \
cvtf_imm \
fp_and_simd \
integer \
- memory
+ memory \
+ fmadd_sub
if BUILD_ARMV8_CRC_TESTS
check_PROGRAMS += crc32
diff --git a/none/tests/arm64/fmadd_sub.c b/none/tests/arm64/fmadd_sub.c
new file mode 100644
index 000000000..dcab22d1b
--- /dev/null
+++ b/none/tests/arm64/fmadd_sub.c
@@ -0,0 +1,98 @@
+#include <math.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#define COUNT 5
+
+static void
+print_float(const char *ident, float x)
+{
+ union
+ {
+ float f;
+ uint32_t i;
+ } u;
+
+ u.f = x;
+ printf("%s = %08x = %.17g\n", ident, u.i, x);
+}
+
+static void
+print_double(const char *ident, double x)
+{
+ union
+ {
+ double f;
+ uint64_t i;
+ } u;
+
+ u.f = x;
+ printf("%s = %016lx = %.17g\n", ident, u.i, x);
+}
+
+int
+main(int argc, char **argv)
+{
+ float x[] = { 55, 0.98076171874999996, 0, 1, 0xFFFFFFFF } ;
+ float y[] = { 0.69314718055994529, 1.015625, 0, 1, 0xFFFFFFFF };
+ float z[] = { 38.123094930796988, 1, 0, 1, 0xFFFFFFFF };
+ float dst = -5;
+
+ double dx[] = { 55, 0.98076171874999996, 0, 1, 0xFFFFFFFF } ;
+ double dy[] = { 0.69314718055994529, 1.015625, 0, 1, 0xFFFFFFFF };
+ double dz[] = { 38.123094930796988, 1, 0, 1, 0xFFFFFFFF };
+ double ddst= -5;
+
+ int i;
+
+ for (i = 0; i < COUNT; i++) {
+ //32bit variant
+ asm("fmadd %s0, %s1, %s2, %s3\n;" : "=w"(dst) : "w"(x[i]), "w"(y[i]), "w"(z[i]));
+ printf("FMADD 32bit: dst = z + x * y\n");
+ printf("%f = %f + %f * %f\n", dst, z[i], x[i], y[i]);
+ print_float("dst", dst);
+
+ // Floating-point negated fused multiply-add
+ asm("fnmadd %s0, %s1, %s2, %s3\n;" : "=w"(dst) : "w"(x[i]), "w"(y[i]), "w"(z[i]));
+ printf("FNMADD 32bit: dst = -z + (-x) * y\n");
+ printf("%f = -%f + (-%f) * %f\n", dst, z[i], x[i], y[i]);
+ print_float("dst", dst);
+
+ asm("fmsub %s0, %s1, %s2, %s3\n;" : "=w"(dst) : "w"(x[i]), "w"(y[i]), "w"(z[i]));
+ printf("FMSUB 32bit: dst = z + (-x) * y\n");
+ printf("%f = %f + (-%f) * %f\n", dst, z[i], x[i], y[i]);
+ print_float("dst", dst);
+
+ asm("fnmsub %s0, %s1, %s2, %s3\n;" : "=w"(dst) : "w"(x[i]), "w"(y[i]), "w"(z[i]));
+ printf("FNMSUB 32bit: dst = -z + x * y\n");
+ printf("%f = -%f + %f * %f\n", dst, z[i], x[i], y[i]);
+ print_float("dst", dst);
+
+ //64bit variant
+ asm("fmadd %d0, %d1, %d2, %d3\n;" : "=w"(ddst) : "w"(dx[i]), "w"(dy[i]), "w"(dz[i]));
+ printf("FMADD 64bit: dst = z + x * y\n");
+ printf("%f = %f + %f * %f\n", ddst, dz[i], dx[i], dy[i]);
+ print_double("dst", ddst);
+
+ asm("fnmadd %d0, %d1, %d2, %d3\n;" : "=w"(ddst) : "w"(dx[i]), "w"(dy[i]), "w"(dz[i]));
+ printf("FNMADD 64bit: dst = -z + (-x) * y\n");
+ printf("%f = -%f - %f * %f\n", ddst, dz[i], dx[i], dy[i]);
+ print_double("dst", ddst);
+
+ asm("fmsub %d0, %d1, %d2, %d3\n;" : "=w"(ddst) : "w"(dx[i]), "w"(dy[i]), "w"(dz[i]));
+ printf("FMSUB 64bit: dst = z + (-x) * y\n");
+ printf("%f = %f + (-%f) * %f\n", ddst, dz[i], dx[i], dy[i]);
+ print_double("dst", ddst);
+
+ asm("fnmsub %d0, %d1, %d2, %d3\n;" : "=w"(ddst) : "w"(dx[i]), "w"(dy[i]), "w"(dz[i]));
+ printf("FNMSUB 64bit: dst = -z + x * y\n");
+ printf("%f = -%f + %f * %f\n", ddst, dz[i], dx[i], dy[i]);
+ print_double("dst", ddst);
+
+ printf("\n");
+ }
+
+ return 0;
+}
+
diff --git a/none/tests/arm64/fmadd_sub.stderr.exp b/none/tests/arm64/fmadd_sub.stderr.exp
new file mode 100644
index 000000000..e69de29bb
diff --git a/none/tests/arm64/fmadd_sub.stdout.exp b/none/tests/arm64/fmadd_sub.stdout.exp
new file mode 100644
index 000000000..f1824b12b
--- /dev/null
+++ b/none/tests/arm64/fmadd_sub.stdout.exp
@@ -0,0 +1,125 @@
+FMADD 32bit: dst = z + x * y
+76.246193 = 38.123096 + 55.000000 * 0.693147
+dst = 42987e0d = 76.246192932128906
+FNMADD 32bit: dst = -z + (-x) * y
+-76.246193 = -38.123096 + (-55.000000) * 0.693147
+dst = c2987e0d = -76.246192932128906
+FMSUB 32bit: dst = z + (-x) * y
+0.000001 = 38.123096 + (-55.000000) * 0.693147
+dst = 35c00000 = 1.430511474609375e-06
+FNMSUB 32bit: dst = -z + x * y
+-0.000001 = -38.123096 + 55.000000 * 0.693147
+dst = b5c00000 = -1.430511474609375e-06
+FMADD 64bit: dst = z + x * y
+76.246190 = 38.123095 + 55.000000 * 0.693147
+dst = 40530fc1931f09c9 = 76.246189861593976
+FNMADD 64bit: dst = -z + (-x) * y
+-76.246190 = -38.123095 - 55.000000 * 0.693147
+dst = c0530fc1931f09c9 = -76.246189861593976
+FMSUB 64bit: dst = z + (-x) * y
+-0.000000 = 38.123095 + (-55.000000) * 0.693147
+dst = bce9000000000000 = -2.7755575615628914e-15
+FNMSUB 64bit: dst = -z + x * y
+0.000000 = -38.123095 + 55.000000 * 0.693147
+dst = 3ce9000000000000 = 2.7755575615628914e-15
+
+FMADD 32bit: dst = z + x * y
+1.996086 = 1.000000 + 0.980762 * 1.015625
+dst = 3fff7fc0 = 1.9960861206054688
+FNMADD 32bit: dst = -z + (-x) * y
+-1.996086 = -1.000000 + (-0.980762) * 1.015625
+dst = bfff7fc0 = -1.9960861206054688
+FMSUB 32bit: dst = z + (-x) * y
+0.003914 = 1.000000 + (-0.980762) * 1.015625
+dst = 3b80401a = 0.00391389150172472
+FNMSUB 32bit: dst = -z + x * y
+-0.003914 = -1.000000 + 0.980762 * 1.015625
+dst = bb80401a = -0.00391389150172472
+FMADD 64bit: dst = z + x * y
+1.996086 = 1.000000 + 0.980762 * 1.015625
+dst = 3fffeff800000000 = 1.9960861206054688
+FNMADD 64bit: dst = -z + (-x) * y
+-1.996086 = -1.000000 - 0.980762 * 1.015625
+dst = bfffeff800000000 = -1.9960861206054688
+FMSUB 64bit: dst = z + (-x) * y
+0.003914 = 1.000000 + (-0.980762) * 1.015625
+dst = 3f70080000000034 = 0.0039138793945312951
+FNMSUB 64bit: dst = -z + x * y
+-0.003914 = -1.000000 + 0.980762 * 1.015625
+dst = bf70080000000034 = -0.0039138793945312951
+
+FMADD 32bit: dst = z + x * y
+0.000000 = 0.000000 + 0.000000 * 0.000000
+dst = 00000000 = 0
+FNMADD 32bit: dst = -z + (-x) * y
+-0.000000 = -0.000000 + (-0.000000) * 0.000000
+dst = 80000000 = -0
+FMSUB 32bit: dst = z + (-x) * y
+0.000000 = 0.000000 + (-0.000000) * 0.000000
+dst = 00000000 = 0
+FNMSUB 32bit: dst = -z + x * y
+0.000000 = -0.000000 + 0.000000 * 0.000000
+dst = 00000000 = 0
+FMADD 64bit: dst = z + x * y
+0.000000 = 0.000000 + 0.000000 * 0.000000
+dst = 0000000000000000 = 0
+FNMADD 64bit: dst = -z + (-x) * y
+-0.000000 = -0.000000 - 0.000000 * 0.000000
+dst = 8000000000000000 = -0
+FMSUB 64bit: dst = z + (-x) * y
+0.000000 = 0.000000 + (-0.000000) * 0.000000
+dst = 0000000000000000 = 0
+FNMSUB 64bit: dst = -z + x * y
+0.000000 = -0.000000 + 0.000000 * 0.000000
+dst = 0000000000000000 = 0
+
+FMADD 32bit: dst = z + x * y
+2.000000 = 1.000000 + 1.000000 * 1.000000
+dst = 40000000 = 2
+FNMADD 32bit: dst = -z + (-x) * y
+-2.000000 = -1.000000 + (-1.000000) * 1.000000
+dst = c0000000 = -2
+FMSUB 32bit: dst = z + (-x) * y
+0.000000 = 1.000000 + (-1.000000) * 1.000000
+dst = 00000000 = 0
+FNMSUB 32bit: dst = -z + x * y
+0.000000 = -1.000000 + 1.000000 * 1.000000
+dst = 00000000 = 0
+FMADD 64bit: dst = z + x * y
+2.000000 = 1.000000 + 1.000000 * 1.000000
+dst = 4000000000000000 = 2
+FNMADD 64bit: dst = -z + (-x) * y
+-2.000000 = -1.000000 - 1.000000 * 1.000000
+dst = c000000000000000 = -2
+FMSUB 64bit: dst = z + (-x) * y
+0.000000 = 1.000000 + (-1.000000) * 1.000000
+dst = 0000000000000000 = 0
+FNMSUB 64bit: dst = -z + x * y
+0.000000 = -1.000000 + 1.000000 * 1.000000
+dst = 0000000000000000 = 0
+
+FMADD 32bit: dst = z + x * y
+18446744073709551616.000000 = 4294967296.000000 + 4294967296.000000 * 4294967296.000000
+dst = 5f800000 = 1.8446744073709552e+19
+FNMADD 32bit: dst = -z + (-x) * y
+-18446744073709551616.000000 = -4294967296.000000 + (-4294967296.000000) * 4294967296.000000
+dst = df800000 = -1.8446744073709552e+19
+FMSUB 32bit: dst = z + (-x) * y
+-18446744073709551616.000000 = 4294967296.000000 + (-4294967296.000000) * 4294967296.000000
+dst = df800000 = -1.8446744073709552e+19
+FNMSUB 32bit: dst = -z + x * y
+18446744073709551616.000000 = -4294967296.000000 + 4294967296.000000 * 4294967296.000000
+dst = 5f800000 = 1.8446744073709552e+19
+FMADD 64bit: dst = z + x * y
+18446744069414584320.000000 = 4294967295.000000 + 4294967295.000000 * 4294967295.000000
+dst = 43efffffffe00000 = 1.8446744069414584e+19
+FNMADD 64bit: dst = -z + (-x) * y
+-18446744069414584320.000000 = -4294967295.000000 - 4294967295.000000 * 4294967295.000000
+dst = c3efffffffe00000 = -1.8446744069414584e+19
+FMSUB 64bit: dst = z + (-x) * y
+-18446744060824649728.000000 = 4294967295.000000 + (-4294967295.000000) * 4294967295.000000
+dst = c3efffffffa00000 = -1.844674406082465e+19
+FNMSUB 64bit: dst = -z + x * y
+18446744060824649728.000000 = -4294967295.000000 + 4294967295.000000 * 4294967295.000000
+dst = 43efffffffa00000 = 1.844674406082465e+19
+
diff --git a/none/tests/arm64/fmadd_sub.vgtest b/none/tests/arm64/fmadd_sub.vgtest
new file mode 100644
index 000000000..b4c53eea4
--- /dev/null
+++ b/none/tests/arm64/fmadd_sub.vgtest
@@ -0,0 +1,3 @@
+prog: fmadd_sub
+prereq: test -x fmadd_sub
+vgopts: -q
--
2.18.4
diff --git a/VEX/priv/guest_generic_bb_to_IR.c b/VEX/priv/guest_generic_bb_to_IR.c
index 0cee970e4..1e72ddacd 100644
--- a/VEX/priv/guest_generic_bb_to_IR.c
+++ b/VEX/priv/guest_generic_bb_to_IR.c
@@ -422,6 +422,8 @@ static Bool expr_is_guardable ( const IRExpr* e )
return !primopMightTrap(e->Iex.Binop.op);
case Iex_Triop:
return !primopMightTrap(e->Iex.Triop.details->op);
+ case Iex_Qop:
+ return !primopMightTrap(e->Iex.Qop.details->op);
case Iex_ITE:
case Iex_CCall:
case Iex_Get:

View file

@ -0,0 +1,206 @@
commit f4abcc05fdba3f25890a9b30b71d511ccc906d46
Author: Mark Wielaard <mark@klomp.org>
Date: Mon Jul 27 22:43:28 2020 +0200
Incorrect call-graph tracking due to new _dl_runtime_resolve_xsave*
Newer glibc have alternate ld.so _ld_runtime_resolve functions.
Namely _dl_runtime_resolve_xsave and _dl_runtime_resolve_xsave'2
This patch recognizes the xsave, xsvec and fxsave variants and
changes callgrind so that any variant counts as _dl_runtime_resolve.
Original patch by paulo.cesar.pereira.de.andrade@gmail.com
https://bugs.kde.org/show_bug.cgi?id=415293
diff --git a/callgrind/fn.c b/callgrind/fn.c
index e9d8dd214..7cce1a0c7 100644
--- a/callgrind/fn.c
+++ b/callgrind/fn.c
@@ -30,8 +30,11 @@
static fn_array current_fn_active;
-static Addr runtime_resolve_addr = 0;
-static int runtime_resolve_length = 0;
+/* x86_64 defines 4 variants. */
+#define MAX_RESOLVE_ADDRS 4
+static int runtime_resolve_addrs = 0;
+static Addr runtime_resolve_addr[MAX_RESOLVE_ADDRS];
+static int runtime_resolve_length[MAX_RESOLVE_ADDRS];
// a code pattern is a list of tuples (start offset, length)
struct chunk_t { int start, len; };
@@ -56,6 +59,9 @@ static Bool check_code(obj_node* obj,
/* first chunk of pattern should always start at offset 0 and
* have at least 3 bytes */
CLG_ASSERT((pat->chunk[0].start == 0) && (pat->chunk[0].len >2));
+
+ /* and we cannot be called more than MAX_RESOLVE_ADDRS times */
+ CLG_ASSERT(runtime_resolve_addrs < MAX_RESOLVE_ADDRS);
CLG_DEBUG(1, "check_code: %s, pattern %s, check %d bytes of [%x %x %x...]\n",
obj->name, pat->name, pat->chunk[0].len, code[0], code[1], code[2]);
@@ -93,8 +99,9 @@ static Bool check_code(obj_node* obj,
pat->name, obj->name + obj->last_slash_pos,
addr - obj->start, addr, pat->len);
- runtime_resolve_addr = addr;
- runtime_resolve_length = pat->len;
+ runtime_resolve_addr[runtime_resolve_addrs] = addr;
+ runtime_resolve_length[runtime_resolve_addrs] = pat->len;
+ runtime_resolve_addrs++;
return True;
}
}
@@ -138,8 +145,9 @@ static Bool search_runtime_resolve(obj_node* obj)
"x86-glibc2.8", 30, {{ 0,12 }, { 16,14 }, { 30,0}} };
if (VG_(strncmp)(obj->name, "/lib/ld", 7) != 0) return False;
- if (check_code(obj, code, &pat)) return True;
- if (check_code(obj, code_28, &pat_28)) return True;
+ Bool pat_p = check_code(obj, code, &pat);
+ Bool pat_28_p = check_code(obj, code_28, &pat_28);
+ if (pat_p || pat_28_p) return True;
return False;
#endif
@@ -186,9 +194,98 @@ static Bool search_runtime_resolve(obj_node* obj)
static struct pattern pat = {
"amd64-def", 110, {{ 0,62 }, { 66,44 }, { 110,0 }} };
+ static UChar code_xsavec[] = {
+ /* 0*/ 0x53, 0x48, 0x89, 0xe3, 0x48, 0x83, 0xe4, 0xc0,
+ /* 8*/ 0x48, 0x2b, 0x25, 0x00, 0x00, 0x00, 0x00, /* sub <i32>(%rip),%rsp */
+ /*15*/ 0x48,
+ /*16*/ 0x89, 0x04, 0x24, 0x48, 0x89, 0x4c, 0x24, 0x08,
+ /*24*/ 0x48, 0x89, 0x54, 0x24, 0x10, 0x48, 0x89, 0x74,
+ /*32*/ 0x24, 0x18, 0x48, 0x89, 0x7c, 0x24, 0x20, 0x4c,
+ /*40*/ 0x89, 0x44, 0x24, 0x28, 0x4c, 0x89, 0x4c, 0x24,
+ /*48*/ 0x30, 0xb8, 0xee, 0x00, 0x00, 0x00, 0x31, 0xd2,
+ /*56*/ 0x48, 0x89, 0x94, 0x24, 0x50, 0x02, 0x00, 0x00,
+ /*64*/ 0x48, 0x89, 0x94, 0x24, 0x58, 0x02, 0x00, 0x00,
+ /*72*/ 0x48, 0x89, 0x94, 0x24, 0x60, 0x02, 0x00, 0x00,
+ /*80*/ 0x48, 0x89, 0x94, 0x24, 0x68, 0x02, 0x00, 0x00,
+ /*88*/ 0x48, 0x89, 0x94, 0x24, 0x70, 0x02, 0x00, 0x00,
+ /*96*/ 0x48, 0x89, 0x94, 0x24, 0x78, 0x02, 0x00, 0x00,
+ /*04*/ 0x0f, 0xc7, 0x64, 0x24, 0x40, 0x48, 0x8b, 0x73,
+ /*112*/0x10, 0x48, 0x8b, 0x7b, 0x08,
+ /*117*/0xe8, 0x00, 0x00, 0x00, 0x00, /* callq <_dl_fixup> */
+ /*122*/0x49, 0x89, 0xc3, 0xb8, 0xee, 0x00,
+ /*128*/0x00, 0x00, 0x31, 0xd2, 0x0f, 0xae, 0x6c, 0x24,
+ /*136*/0x40, 0x4c, 0x8b, 0x4c, 0x24, 0x30, 0x4c, 0x8b,
+ /*144*/0x44, 0x24, 0x28, 0x48, 0x8b, 0x7c, 0x24, 0x20,
+ /*152*/0x48, 0x8b, 0x74, 0x24, 0x18, 0x48, 0x8b, 0x54,
+ /*160*/0x24, 0x10, 0x48, 0x8b, 0x4c, 0x24, 0x08, 0x48,
+ /*168*/0x8b, 0x04, 0x24, 0x48, 0x89, 0xdc, 0x48, 0x8b,
+ /*176*/0x1c, 0x24, 0x48, 0x83, 0xc4, 0x18, 0xf2, 0x41,
+ /*184*/0xff, 0xe3 };
+ static struct pattern pat_xsavec = {
+ "amd64-xsavec", 186, {{ 0,11 }, { 15,103 }, {122,64}, { 186,0 }} };
+
+ static UChar code_xsave[] = {
+ /* 0*/ 0x53, 0x48, 0x89, 0xe3, 0x48, 0x83, 0xe4, 0xc0,
+ /* 8*/ 0x48, 0x2b, 0x25, 0x00, 0x00, 0x00, 0x00, /* sub <i32>(%rip),%rsp */
+ /*15*/ 0x48,
+ /*16*/ 0x89, 0x04, 0x24, 0x48, 0x89, 0x4c, 0x24, 0x08,
+ /*24*/ 0x48, 0x89, 0x54, 0x24, 0x10, 0x48, 0x89, 0x74,
+ /*32*/ 0x24, 0x18, 0x48, 0x89, 0x7c, 0x24, 0x20, 0x4c,
+ /*40*/ 0x89, 0x44, 0x24, 0x28, 0x4c, 0x89, 0x4c, 0x24,
+ /*48*/ 0x30, 0xb8, 0xee, 0x00, 0x00, 0x00, 0x31, 0xd2,
+ /*56*/ 0x48, 0x89, 0x94, 0x24, 0x40, 0x02, 0x00, 0x00,
+ /*64*/ 0x48, 0x89, 0x94, 0x24, 0x48, 0x02, 0x00, 0x00,
+ /*72*/ 0x48, 0x89, 0x94, 0x24, 0x50, 0x02, 0x00, 0x00,
+ /*80*/ 0x48, 0x89, 0x94, 0x24, 0x58, 0x02, 0x00, 0x00,
+ /*88*/ 0x48, 0x89, 0x94, 0x24, 0x60, 0x02, 0x00, 0x00,
+ /*96*/ 0x48, 0x89, 0x94, 0x24, 0x68, 0x02, 0x00, 0x00,
+ /*104*/0x48, 0x89, 0x94, 0x24, 0x70, 0x02, 0x00, 0x00,
+ /*112*/0x48, 0x89, 0x94, 0x24, 0x78, 0x02, 0x00, 0x00,
+ /*120*/0x0f, 0xae, 0x64, 0x24, 0x40, 0x48, 0x8b, 0x73,
+ /*128*/0x10, 0x48, 0x8b, 0x7b, 0x08,
+ /*133*/0xe8, 0x00, 0x00, 0x00, 0x00, /* callq <_dl_fixup> */
+ /*138*/0x49, 0x89, 0xc3, 0xb8, 0xee, 0x00,
+ /*144*/0x00, 0x00, 0x31, 0xd2, 0x0f, 0xae, 0x6c, 0x24,
+ /*152*/0x40, 0x4c, 0x8b, 0x4c, 0x24, 0x30, 0x4c, 0x8b,
+ /*160*/0x44, 0x24, 0x28, 0x48, 0x8b, 0x7c, 0x24, 0x20,
+ /*168*/0x48, 0x8b, 0x74, 0x24, 0x18, 0x48, 0x8b, 0x54,
+ /*176*/0x24, 0x10, 0x48, 0x8b, 0x4c, 0x24, 0x08, 0x48,
+ /*184*/0x8b, 0x04, 0x24, 0x48, 0x89, 0xdc, 0x48, 0x8b,
+ /*192*/0x1c, 0x24, 0x48, 0x83, 0xc4, 0x18, 0xf2, 0x41,
+ /*200*/0xff, 0xe3 };
+ static struct pattern pat_xsave = {
+ "amd64-xsave", 202, {{ 0,11 }, { 15,119 }, {138,64}, { 202,0 }} };
+
+ static UChar code_fxsave[] = {
+ /* 0*/ 0x53, 0x48, 0x89, 0xe3, 0x48, 0x83, 0xe4, 0xf0,
+ /* 8*/ 0x48, 0x81, 0xec, 0x40, 0x02, 0x00, 0x00, 0x48,
+ /*16*/ 0x89, 0x04, 0x24, 0x48, 0x89, 0x4c, 0x24, 0x08,
+ /*24*/ 0x48, 0x89, 0x54, 0x24, 0x10, 0x48, 0x89, 0x74,
+ /*32*/ 0x24, 0x18, 0x48, 0x89, 0x7c, 0x24, 0x20, 0x4c,
+ /*40*/ 0x89, 0x44, 0x24, 0x28, 0x4c, 0x89, 0x4c, 0x24,
+ /*48*/ 0x30, 0x0f, 0xae, 0x44, 0x24, 0x40, 0x48, 0x8b,
+ /*56*/ 0x73, 0x10, 0x48, 0x8b, 0x7b, 0x08,
+ /*62*/ 0xe8, 0x00, 0x00, 0x00, 0x00, /* callq <_dl_fixup> */
+ /*67*/ 0x49, 0x89, 0xc3, 0x0f, 0xae,
+ /*72*/ 0x4c, 0x24, 0x40, 0x4c, 0x8b, 0x4c, 0x24, 0x30,
+ /*80*/ 0x4c, 0x8b, 0x44, 0x24, 0x28, 0x48, 0x8b, 0x7c,
+ /*88*/ 0x24, 0x20, 0x48, 0x8b, 0x74, 0x24, 0x18, 0x48,
+ /*96*/ 0x8b, 0x54, 0x24, 0x10, 0x48, 0x8b, 0x4c, 0x24,
+ /*104*/0x08, 0x48, 0x8b, 0x04, 0x24, 0x48, 0x89, 0xdc,
+ /*112*/0x48, 0x8b, 0x1c, 0x24, 0x48, 0x83, 0xc4, 0x18,
+ /*120*/0xf2, 0x41, 0xff, 0xe3 };
+ static struct pattern pat_fxsave = {
+ "amd64-fxsave", 124, {{ 0,63 }, { 67,57 }, { 124,0 }} };
+
if ((VG_(strncmp)(obj->name, "/lib/ld", 7) != 0) &&
- (VG_(strncmp)(obj->name, "/lib64/ld", 9) != 0)) return False;
- return check_code(obj, code, &pat);
+ (VG_(strncmp)(obj->name, "/lib64/ld", 9) != 0) &&
+ (VG_(strncmp)(obj->name, "/usr/lib/ld", 11) != 0) &&
+ (VG_(strncmp)(obj->name, "/usr/lib64/ld", 13) != 0)) return False;
+ Bool pat_p = check_code(obj, code, &pat);
+ Bool pat_xsavec_p = check_code(obj, code_xsavec, &pat_xsavec);
+ Bool pat_xsave_p = check_code(obj, code_xsave, &pat_xsave);
+ Bool pat_fxsave_p = check_code(obj, code_fxsave, &pat_fxsave);
+ if (pat_p || pat_xsavec_p || pat_xsave_p || pat_fxsave_p) return True;
#endif
/* For other platforms, no patterns known */
@@ -254,7 +351,7 @@ obj_node* new_obj_node(DebugInfo* di, obj_node* next)
i++;
}
- if (runtime_resolve_addr == 0) search_runtime_resolve(obj);
+ if (runtime_resolve_addrs == 0) search_runtime_resolve(obj);
return obj;
}
@@ -490,6 +587,7 @@ fn_node* CLG_(get_fn_node)(BB* bb)
DebugInfo* di;
UInt line_num;
fn_node* fn;
+ Int i;
/* fn from debug info is idempotent for a BB */
if (bb->fn) return bb->fn;
@@ -538,12 +636,14 @@ fn_node* CLG_(get_fn_node)(BB* bb)
}
if (0 == VG_(strcmp)(fnname, "_exit") && !exit_bb)
exit_bb = bb;
-
- if (runtime_resolve_addr &&
- (bb_addr(bb) >= runtime_resolve_addr) &&
- (bb_addr(bb) < runtime_resolve_addr + runtime_resolve_length)) {
- /* BB in runtime_resolve found by code check; use this name */
- fnname = "_dl_runtime_resolve";
+
+ for (i = 0; i < runtime_resolve_addrs; i++) {
+ if ((bb_addr(bb) >= runtime_resolve_addr[i]) &&
+ (bb_addr(bb) < runtime_resolve_addr[i] + runtime_resolve_length[i])) {
+ /* BB in runtime_resolve found by code check; use this name */
+ fnname = "_dl_runtime_resolve";
+ break;
+ }
}
/* get fn_node struct for this function */

2410
valgrind-3.16.1-dwarf5.patch Normal file

File diff suppressed because it is too large Load diff

117
valgrind-3.16.1-epoll.patch Normal file
View file

@ -0,0 +1,117 @@
commit f326d68d762edf4b0e9604daa446b6f8ca25725a
Author: Mark Wielaard <mark@klomp.org>
Date: Sun Jul 26 22:40:22 2020 +0200
epoll_ctl warns for uninitialized padding on non-amd64 64bit arches
struct vki_epoll_event is packed on x86_64, but not on other 64bit
arches. This means that on 64bit arches there can be padding in the
epoll_event struct. Seperately the data field is only used by user
space (which might not set the data field if it doesn't need to).
Only check the events field on epoll_ctl. But assume both events
and data are both written to by epoll_[p]wait (exclude padding).
https://bugs.kde.org/show_bug.cgi?id=422623
diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c
index 5b5b7eee6..929a4d9af 100644
--- a/coregrind/m_syswrap/syswrap-linux.c
+++ b/coregrind/m_syswrap/syswrap-linux.c
@@ -2099,8 +2099,29 @@ PRE(sys_epoll_ctl)
SARG1, ( ARG2<3 ? epoll_ctl_s[ARG2] : "?" ), SARG3, ARG4);
PRE_REG_READ4(long, "epoll_ctl",
int, epfd, int, op, int, fd, struct vki_epoll_event *, event);
- if (ARG2 != VKI_EPOLL_CTL_DEL)
- PRE_MEM_READ( "epoll_ctl(event)", ARG4, sizeof(struct vki_epoll_event) );
+ if (ARG2 != VKI_EPOLL_CTL_DEL) {
+ /* Just check the events field, the data field is for user space and
+ unused by the kernel. */
+ struct vki_epoll_event *event = (struct vki_epoll_event *) ARG4;
+ PRE_MEM_READ( "epoll_ctl(event)", (Addr) &event->events,
+ sizeof(__vki_u32) );
+ }
+}
+
+/* RES event records have been written (exclude padding). */
+static void epoll_post_helper ( ThreadId tid, SyscallArgs* arrghs,
+ SyscallStatus* status )
+{
+ vg_assert(SUCCESS);
+ if (RES > 0) {
+ Int i;
+ struct vki_epoll_event **events = (struct vki_epoll_event**)(Addr)ARG2;
+ for (i = 0; i < RES; i++) {
+ /* Assume both events and data are set (data is user space only). */
+ POST_FIELD_WRITE(events[i]->events);
+ POST_FIELD_WRITE(events[i]->data);
+ }
+ }
}
PRE(sys_epoll_wait)
@@ -2111,13 +2132,12 @@ PRE(sys_epoll_wait)
PRE_REG_READ4(long, "epoll_wait",
int, epfd, struct vki_epoll_event *, events,
int, maxevents, int, timeout);
+ /* Assume all (maxevents) events records should be (fully) writable. */
PRE_MEM_WRITE( "epoll_wait(events)", ARG2, sizeof(struct vki_epoll_event)*ARG3);
}
POST(sys_epoll_wait)
{
- vg_assert(SUCCESS);
- if (RES > 0)
- POST_MEM_WRITE( ARG2, sizeof(struct vki_epoll_event)*RES ) ;
+ epoll_post_helper (tid, arrghs, status);
}
PRE(sys_epoll_pwait)
@@ -2130,15 +2150,14 @@ PRE(sys_epoll_pwait)
int, epfd, struct vki_epoll_event *, events,
int, maxevents, int, timeout, vki_sigset_t *, sigmask,
vki_size_t, sigsetsize);
+ /* Assume all (maxevents) events records should be (fully) writable. */
PRE_MEM_WRITE( "epoll_pwait(events)", ARG2, sizeof(struct vki_epoll_event)*ARG3);
if (ARG5)
PRE_MEM_READ( "epoll_pwait(sigmask)", ARG5, sizeof(vki_sigset_t) );
}
POST(sys_epoll_pwait)
{
- vg_assert(SUCCESS);
- if (RES > 0)
- POST_MEM_WRITE( ARG2, sizeof(struct vki_epoll_event)*RES ) ;
+ epoll_post_helper (tid, arrghs, status);
}
PRE(sys_eventfd)
commit b74f9f23c8758c77367f18368ea95baa858544cb
Author: Mark Wielaard <mark@klomp.org>
Date: Tue Aug 18 23:58:55 2020 +0200
Fix epoll_ctl setting of array event and data fields.
Fix for https://bugs.kde.org/show_bug.cgi?id=422623 in commit ecf5ba119
epoll_ctl warns for uninitialized padding on non-amd64 64bit arches
contained a bug. A pointer to an array is not a pointer to a pointer to
an array. Found by a Fedora user:
https://bugzilla.redhat.com/show_bug.cgi?id=1844778#c10
diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c
index 0850487e9..3f488795a 100644
--- a/coregrind/m_syswrap/syswrap-linux.c
+++ b/coregrind/m_syswrap/syswrap-linux.c
@@ -2115,11 +2115,11 @@ static void epoll_post_helper ( ThreadId tid, SyscallArgs* arrghs,
vg_assert(SUCCESS);
if (RES > 0) {
Int i;
- struct vki_epoll_event **events = (struct vki_epoll_event**)(Addr)ARG2;
+ struct vki_epoll_event *events = (struct vki_epoll_event*)(Addr)ARG2;
for (i = 0; i < RES; i++) {
/* Assume both events and data are set (data is user space only). */
- POST_FIELD_WRITE(events[i]->events);
- POST_FIELD_WRITE(events[i]->data);
+ POST_FIELD_WRITE(events[i].events);
+ POST_FIELD_WRITE(events[i].data);
}
}
}

View file

@ -0,0 +1,201 @@
From fe4b349df3d5edc1c849e9890cbc6b191386a03c Mon Sep 17 00:00:00 2001
From: Mark Wielaard <mark@klomp.org>
Date: Fri, 16 Oct 2020 02:55:06 +0200
Subject: [PATCH] Support new faccessat2 linux syscall (439)
faccessat2 is a new syscall in linux 5.8 and will be used by glibc 2.33.
faccessat2 is simply faccessat with a new flag argument. It has
a common number across all linux arches.
https://bugs.kde.org/427787
---
NEWS | 1 +
coregrind/m_syswrap/priv_syswrap-linux.h | 1 +
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 | 9 +++++++++
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, 31 insertions(+)
diff --git a/coregrind/m_syswrap/priv_syswrap-linux.h b/coregrind/m_syswrap/priv_syswrap-linux.h
index eb0b320ca..110f7c832 100644
--- a/coregrind/m_syswrap/priv_syswrap-linux.h
+++ b/coregrind/m_syswrap/priv_syswrap-linux.h
@@ -180,6 +180,7 @@ DECL_TEMPLATE(linux, sys_symlinkat);
DECL_TEMPLATE(linux, sys_readlinkat);
DECL_TEMPLATE(linux, sys_fchmodat);
DECL_TEMPLATE(linux, sys_faccessat);
+DECL_TEMPLATE(linux, sys_faccessat2);
DECL_TEMPLATE(linux, sys_utimensat);
DECL_TEMPLATE(linux, sys_name_to_handle_at);
DECL_TEMPLATE(linux, sys_open_by_handle_at);
diff --git a/coregrind/m_syswrap/syswrap-amd64-linux.c b/coregrind/m_syswrap/syswrap-amd64-linux.c
index d6f3eb910..45e1f3d1b 100644
--- a/coregrind/m_syswrap/syswrap-amd64-linux.c
+++ b/coregrind/m_syswrap/syswrap-amd64-linux.c
@@ -873,6 +873,8 @@ static SyscallTableEntry syscall_table[] = {
LINXY(__NR_io_uring_setup, sys_io_uring_setup), // 425
LINXY(__NR_io_uring_enter, sys_io_uring_enter), // 426
LINXY(__NR_io_uring_register, sys_io_uring_register), // 427
+
+ LINX_(__NR_faccessat2, sys_faccessat2), // 439
};
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 70700e53f..978aedbe6 100644
--- a/coregrind/m_syswrap/syswrap-arm-linux.c
+++ b/coregrind/m_syswrap/syswrap-arm-linux.c
@@ -1046,6 +1046,8 @@ static SyscallTableEntry syscall_main_table[] = {
LINXY(__NR_futex_time64, sys_futex_time64), // 422
LINXY(__NR_sched_rr_get_interval_time64,
sys_sched_rr_get_interval_time64), // 423
+
+ LINX_(__NR_faccessat2, sys_faccessat2), // 439
};
diff --git a/coregrind/m_syswrap/syswrap-arm64-linux.c b/coregrind/m_syswrap/syswrap-arm64-linux.c
index acca02442..051d84989 100644
--- a/coregrind/m_syswrap/syswrap-arm64-linux.c
+++ b/coregrind/m_syswrap/syswrap-arm64-linux.c
@@ -825,6 +825,8 @@ static SyscallTableEntry syscall_main_table[] = {
// (__NR_pkey_free, sys_ni_syscall), // 290
LINXY(__NR_statx, sys_statx), // 397
+
+ LINX_(__NR_faccessat2, sys_faccessat2), // 439
};
diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c
index 3f488795a..41849873e 100644
--- a/coregrind/m_syswrap/syswrap-linux.c
+++ b/coregrind/m_syswrap/syswrap-linux.c
@@ -5988,6 +5988,15 @@ PRE(sys_faccessat)
PRE_MEM_RASCIIZ( "faccessat(pathname)", ARG2 );
}
+PRE(sys_faccessat2)
+{
+ PRINT("sys_faccessat2 ( %ld, %#" FMT_REGWORD "x(%s), %ld, %ld )",
+ SARG1, ARG2, (HChar*)(Addr)ARG2, SARG3, SARG4);
+ PRE_REG_READ4(long, "faccessat2",
+ int, dfd, const char *, pathname, int, mode, int, flags);
+ PRE_MEM_RASCIIZ( "faccessat2(pathname)", ARG2 );
+}
+
PRE(sys_name_to_handle_at)
{
PRINT("sys_name_to_handle_at ( %ld, %#" FMT_REGWORD "x(%s), %#"
diff --git a/coregrind/m_syswrap/syswrap-mips32-linux.c b/coregrind/m_syswrap/syswrap-mips32-linux.c
index 5face576b..f35fb8bbb 100644
--- a/coregrind/m_syswrap/syswrap-mips32-linux.c
+++ b/coregrind/m_syswrap/syswrap-mips32-linux.c
@@ -1131,6 +1131,8 @@ static SyscallTableEntry syscall_main_table[] = {
LINXY(__NR_futex_time64, sys_futex_time64), // 422
LINXY(__NR_sched_rr_get_interval_time64,
sys_sched_rr_get_interval_time64), // 423
+
+ LINX_ (__NR_faccessat2, sys_faccessat2), // 439
};
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 c64911a50..bd260679c 100644
--- a/coregrind/m_syswrap/syswrap-mips64-linux.c
+++ b/coregrind/m_syswrap/syswrap-mips64-linux.c
@@ -812,6 +812,7 @@ static SyscallTableEntry syscall_main_table[] = {
LINX_ (__NR_syncfs, sys_syncfs),
LINXY (__NR_statx, sys_statx),
LINX_ (__NR_setns, sys_setns),
+ LINX_ (__NR_faccessat2, sys_faccessat2),
};
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 7ceecb6da..a904745ab 100644
--- a/coregrind/m_syswrap/syswrap-nanomips-linux.c
+++ b/coregrind/m_syswrap/syswrap-nanomips-linux.c
@@ -821,6 +821,7 @@ static SyscallTableEntry syscall_main_table[] = {
// (__NR_pkey_mprotect, sys_ni_syscall),
// (__NR_pkey_alloc, sys_ni_syscall),
// (__NR_pkey_free, sys_ni_syscall),
+ LINX_ (__NR_faccessat2, sys_faccessat2),
};
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 c19cb9e0e..6ddd482d9 100644
--- a/coregrind/m_syswrap/syswrap-ppc32-linux.c
+++ b/coregrind/m_syswrap/syswrap-ppc32-linux.c
@@ -1049,6 +1049,8 @@ static SyscallTableEntry syscall_table[] = {
LINXY(__NR_futex_time64, sys_futex_time64), // 422
LINXY(__NR_sched_rr_get_interval_time64,
sys_sched_rr_get_interval_time64), // 423
+
+ LINX_(__NR_faccessat2, sys_faccessat2), // 439
};
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 b6422a765..7026e4ac6 100644
--- a/coregrind/m_syswrap/syswrap-ppc64-linux.c
+++ b/coregrind/m_syswrap/syswrap-ppc64-linux.c
@@ -1014,6 +1014,8 @@ static SyscallTableEntry syscall_table[] = {
LINX_(__NR_pwritev2, sys_pwritev2), // 381
LINXY(__NR_statx, sys_statx), // 383
+
+ LINX_(__NR_faccessat2, sys_faccessat2), // 439
};
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 3427fee16..c5e4bb957 100644
--- a/coregrind/m_syswrap/syswrap-s390x-linux.c
+++ b/coregrind/m_syswrap/syswrap-s390x-linux.c
@@ -859,6 +859,8 @@ static SyscallTableEntry syscall_table[] = {
LINX_(__NR_pwritev2, sys_pwritev2), // 377
LINXY(__NR_statx, sys_statx), // 379
+
+ LINX_(__NR_faccessat2, sys_faccessat2), // 439
};
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 b59d96f37..67d866497 100644
--- a/coregrind/m_syswrap/syswrap-x86-linux.c
+++ b/coregrind/m_syswrap/syswrap-x86-linux.c
@@ -1644,6 +1644,8 @@ static SyscallTableEntry syscall_table[] = {
LINXY(__NR_io_uring_setup, sys_io_uring_setup), // 425
LINXY(__NR_io_uring_enter, sys_io_uring_enter), // 426
LINXY(__NR_io_uring_register, sys_io_uring_register),// 427
+
+ LINX_(__NR_faccessat2, sys_faccessat2), // 439
};
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 6221d5a81..c8bc31b4b 100644
--- a/include/vki/vki-scnums-shared-linux.h
+++ b/include/vki/vki-scnums-shared-linux.h
@@ -39,4 +39,6 @@
#define __NR_fsmount 432
#define __NR_fspick 433
+#define __NR_faccessat2 439
+
#endif
--
2.20.1

View file

@ -0,0 +1,43 @@
commit 1c49351424f04ee29a5efc054cb08ab3ad22b978
Author: Laurent Bonnans <laurent.bonnans@here.com>
Date: Fri Nov 16 15:22:18 2018 +0100
Fix 397605 - Add support for Linux FICLONE ioctl
diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c
index 41849873e..328e02a98 100644
--- a/coregrind/m_syswrap/syswrap-linux.c
+++ b/coregrind/m_syswrap/syswrap-linux.c
@@ -7961,6 +7961,11 @@ PRE(sys_ioctl)
case VKI_FIBMAP:
PRE_MEM_READ( "ioctl(FIBMAP)", ARG3, sizeof(int));
break;
+ case VKI_FICLONE:
+ /* The direction of FICLONE (W) is incorrectly specified
+ * as it expects a file descriptor and not a pointer to
+ * user data */
+ break;
case VKI_FBIOGET_VSCREENINFO: /* 0x4600 */
PRE_MEM_WRITE( "ioctl(FBIOGET_VSCREENINFO)", ARG3,
@@ -10898,6 +10903,8 @@ POST(sys_ioctl)
case VKI_FIBMAP:
POST_MEM_WRITE(ARG3, sizeof(int));
break;
+ case VKI_FICLONE:
+ break;
case VKI_FBIOGET_VSCREENINFO: //0x4600
POST_MEM_WRITE(ARG3, sizeof(struct vki_fb_var_screeninfo));
diff --git a/include/vki/vki-linux.h b/include/vki/vki-linux.h
index ef93b9258..3b9dc3779 100644
--- a/include/vki/vki-linux.h
+++ b/include/vki/vki-linux.h
@@ -1888,6 +1888,7 @@ struct vki_ppdev_frob_struct {
#define VKI_FIBMAP _VKI_IO(0x00,1) /* bmap access */
#define VKI_FIGETBSZ _VKI_IO(0x00,2) /* get the block size used for bmap */
+#define VKI_FICLONE _VKI_IOW(0x94, 9, int)
//----------------------------------------------------------------------
// From linux-2.6.8.1/include/scsi/sg.h

View file

@ -0,0 +1,13 @@
diff --git a/gdbserver_tests/nlcontrolc.vgtest b/gdbserver_tests/nlcontrolc.vgtest
index bb5308403..4eb479595 100644
--- a/gdbserver_tests/nlcontrolc.vgtest
+++ b/gdbserver_tests/nlcontrolc.vgtest
@@ -13,7 +13,7 @@ args: 1000000000 1000000000 1000000000 BSBSBSBS 1
vgopts: --tool=none --vgdb=yes --vgdb-error=0 --vgdb-prefix=./vgdb-prefix-nlcontrolc
stderr_filter: filter_stderr
# Bug 338633 nlcontrol hangs on arm64 currently.
-prereq: test -e gdb -a -f vgdb.invoker && ! ../tests/arch_test arm64 && ! ../tests/os_test solaris
+prereq: false && test -e gdb -a -f vgdb.invoker && ! ../tests/arch_test arm64 && ! ../tests/os_test solaris
progB: gdb
argsB: --quiet -l 60 --nx ./sleepers
stdinB: nlcontrolc.stdinB.gdb

View file

@ -0,0 +1,98 @@
diff --git a/coregrind/m_syswrap/priv_syswrap-generic.h b/coregrind/m_syswrap/priv_syswrap-generic.h
index 4717abac6..c50b31399 100644
--- a/coregrind/m_syswrap/priv_syswrap-generic.h
+++ b/coregrind/m_syswrap/priv_syswrap-generic.h
@@ -106,6 +106,10 @@ extern Bool
ML_(handle_auxv_open)(SyscallStatus *status, const HChar *filename,
int flags);
+extern Bool
+ML_(handle_self_exe_open)(SyscallStatus *status, const HChar *filename,
+ int flags);
+
/* Helper function for generic mprotect and linux pkey_mprotect. */
extern void handle_sys_mprotect (ThreadId tid, SyscallStatus *status,
Addr *addr, SizeT *len, Int *prot);
diff --git a/coregrind/m_syswrap/syswrap-generic.c b/coregrind/m_syswrap/syswrap-generic.c
index 7d4b385a3..3810f7474 100644
--- a/coregrind/m_syswrap/syswrap-generic.c
+++ b/coregrind/m_syswrap/syswrap-generic.c
@@ -4078,6 +4078,38 @@ Bool ML_(handle_auxv_open)(SyscallStatus *status, const HChar *filename,
}
#endif // defined(VGO_linux) || defined(VGO_solaris)
+#if defined(VGO_linux)
+Bool ML_(handle_self_exe_open)(SyscallStatus *status, const HChar *filename,
+ int flags)
+{
+ HChar name[30]; // large enough for /proc/<int>/exe
+
+ if (!ML_(safe_to_deref)((const void *) filename, 1))
+ return False;
+
+ /* Opening /proc/<pid>/exe or /proc/self/exe? */
+ VG_(sprintf)(name, "/proc/%d/exe", VG_(getpid)());
+ if (!VG_STREQ(filename, name) && !VG_STREQ(filename, "/proc/self/exe"))
+ return False;
+
+ /* Allow to open the file only for reading. */
+ if (flags & (VKI_O_WRONLY | VKI_O_RDWR)) {
+ SET_STATUS_Failure(VKI_EACCES);
+ return True;
+ }
+
+ SysRes sres = VG_(dup)(VG_(cl_exec_fd));
+ SET_STATUS_from_SysRes(sres);
+ if (!sr_isError(sres)) {
+ OffT off = VG_(lseek)(sr_Res(sres), 0, VKI_SEEK_SET);
+ if (off < 0)
+ SET_STATUS_Failure(VKI_EMFILE);
+ }
+
+ return True;
+}
+#endif // defined(VGO_linux)
+
PRE(sys_open)
{
if (ARG2 & VKI_O_CREAT) {
@@ -4119,8 +4151,10 @@ PRE(sys_open)
}
}
- /* Handle also the case of /proc/self/auxv or /proc/<pid>/auxv. */
- if (ML_(handle_auxv_open)(status, (const HChar *)(Addr)ARG1, ARG2))
+ /* Handle also the case of /proc/self/auxv or /proc/<pid>/auxv
+ or /proc/self/exe or /proc/<pid>/exe. */
+ if (ML_(handle_auxv_open)(status, (const HChar *)(Addr)ARG1, ARG2)
+ || ML_(handle_self_exe_open)(status, (const HChar *)(Addr)ARG1, ARG2))
return;
#endif // defined(VGO_linux)
diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c
index 52074149d..fcc534454 100644
--- a/coregrind/m_syswrap/syswrap-linux.c
+++ b/coregrind/m_syswrap/syswrap-linux.c
@@ -5745,6 +5745,22 @@ PRE(sys_openat)
return;
}
+ /* And for /proc/self/exe or /proc/<pid>/exe case. */
+
+ VG_(sprintf)(name, "/proc/%d/exe", VG_(getpid)());
+ if (ML_(safe_to_deref)( (void*)(Addr)ARG2, 1 )
+ && (VG_(strcmp)((HChar *)(Addr)ARG2, name) == 0
+ || VG_(strcmp)((HChar *)(Addr)ARG2, "/proc/self/exe") == 0)) {
+ sres = VG_(dup)( VG_(cl_exec_fd) );
+ SET_STATUS_from_SysRes( sres );
+ if (!sr_isError(sres)) {
+ OffT off = VG_(lseek)( sr_Res(sres), 0, VKI_SEEK_SET );
+ if (off < 0)
+ SET_STATUS_Failure( VKI_EMFILE );
+ }
+ return;
+ }
+
/* Otherwise handle normally */
*flags |= SfMayBlock;
}

View file

@ -0,0 +1,57 @@
From a88c168b4dd607bca47d3a1ec08573d3e5fa889b Mon Sep 17 00:00:00 2001
From: Florian Weimer <fweimer@redhat.com>
Date: Fri, 8 Jan 2021 15:08:50 +0100
Subject: [PATCH] ppc64: Mask unrecognized AT_HWCAP2 values
Also suppress printing a log message for scv instructions in the
instruction stream.
These changes are required for running glibc 2.33 on kernels with scv
support under valgrind.
---
VEX/priv/guest_ppc_toIR.c | 5 +++--
coregrind/m_initimg/initimg-linux.c | 6 ++++++
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/VEX/priv/guest_ppc_toIR.c b/VEX/priv/guest_ppc_toIR.c
index e7b576fa2..99e96a577 100644
--- a/VEX/priv/guest_ppc_toIR.c
+++ b/VEX/priv/guest_ppc_toIR.c
@@ -8739,8 +8739,9 @@
{
IRType ty = mode64 ? Ity_I64 : Ity_I32;
- if (theInstr != 0x44000002) {
- vex_printf("dis_syslink(ppc)(theInstr)\n");
+ if (theInstr != 0x44000002) { // sc
+ if (theInstr != 0x44000001) // scv
+ vex_printf("dis_syslink(ppc)(theInstr)\n");
return False;
}
diff --git a/coregrind/m_initimg/initimg-linux.c b/coregrind/m_initimg/initimg-linux.c
index ba84fa6e9..fb68ae00b 100644
--- a/coregrind/m_initimg/initimg-linux.c
+++ b/coregrind/m_initimg/initimg-linux.c
@@ -750,6 +750,7 @@ Addr setup_client_stack( void* init_sp,
PPC_FEATURE2_HAS_ISEL 0x08000000
PPC_FEATURE2_HAS_TAR 0x04000000
PPC_FEATURE2_HAS_VCRYPTO 0x02000000
+ PPC_FEATURE2_HAS_IEEE128 0x00400000
*/
auxv_2_07 = (auxv->u.a_val & 0x80000000ULL) == 0x80000000ULL;
hw_caps_2_07 = (vex_archinfo->hwcaps & VEX_HWCAPS_PPC64_ISA2_07)
@@ -757,6 +757,11 @@
* matches the setting in VEX HWCAPS.
*/
vg_assert(auxv_2_07 == hw_caps_2_07);
+
+ /* Mask unrecognized HWCAP bits. Only keep the bits that have
+ * been mentioned above.
+ */
+ auxv->u.a_val &= 0xfec00000ULL;
}
break;
--- valgrind-3.16.1/VEX/priv/guest_ppc_toIR.c 2021-01-08 16:43:45.947122866 +0100
+++ guest_ppc_toIR.c.new 2021-01-08 16:43:40.238166866 +0100

View file

@ -0,0 +1,222 @@
commit 15330adf7c2471fbaa6a0818db07078d81dbff97
Author: Bart Van Assche <bvanassche@acm.org>
Date: Sat Sep 19 08:08:59 2020 -0700
drd: Port to Fedora 33
Apparently on Fedora 33 the POSIX thread functions exist in both libc and
libpthread. Hence this patch that intercepts the pthread functions in
libc. See also https://bugs.kde.org/show_bug.cgi?id=426144 .
diff --git a/drd/drd_pthread_intercepts.c b/drd/drd_pthread_intercepts.c
index 58c45aaec..c2882e5ab 100644
--- a/drd/drd_pthread_intercepts.c
+++ b/drd/drd_pthread_intercepts.c
@@ -174,7 +174,16 @@ static int never_true;
ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBC_SONAME,zf) argl_decl \
{ return implf argl; }
#else
+/*
+ * On Linux, intercept both the libc and the libpthread functions. At
+ * least glibc 2.32.9000 (Fedora 34) has an implementation of all pthread
+ * functions in both libc and libpthread. Older glibc versions only have an
+ * implementation of the pthread functions in libpthread.
+ */
#define PTH_FUNC(ret_ty, zf, implf, argl_decl, argl) \
+ ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBC_SONAME,zf) argl_decl; \
+ ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBC_SONAME,zf) argl_decl \
+ { return implf argl; } \
ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBPTHREAD_SONAME,zf) argl_decl; \
ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBPTHREAD_SONAME,zf) argl_decl \
{ return implf argl; }
commit 3073d03e4b6e76797828b3f466863dbdda76cc7a
Author: Bart Van Assche <bvanassche@acm.org>
Date: Tue Oct 20 19:40:19 2020 -0700
drd: Unbreak the musl build
See also https://bugs.kde.org/show_bug.cgi?id=428035.
Reported-by: Stacy <stacy.gaikovaia@windriver.com>
Fixes: 15330adf7c24 ("drd: Port to Fedora 33")
diff --git a/drd/drd_pthread_intercepts.c b/drd/drd_pthread_intercepts.c
index 62c466f50..585aafe22 100644
--- a/drd/drd_pthread_intercepts.c
+++ b/drd/drd_pthread_intercepts.c
@@ -174,6 +174,13 @@ static int never_true;
ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBC_SONAME,zf) argl_decl \
{ return implf argl; }
#else
+#ifdef MUSL_LIBC
+/* musl provides a single library that includes pthreads functions. */
+#define PTH_FUNC(ret_ty, zf, implf, argl_decl, argl) \
+ ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBPTHREAD_SONAME,zf) argl_decl; \
+ ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBPTHREAD_SONAME,zf) argl_decl \
+ { return implf argl; }
+#else
/*
* On Linux, intercept both the libc and the libpthread functions. At
* least glibc 2.32.9000 (Fedora 34) has an implementation of all pthread
@@ -188,6 +195,7 @@ static int never_true;
ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBPTHREAD_SONAME,zf) argl_decl \
{ return implf argl; }
#endif
+#endif
/**
* Macro for generating three Valgrind interception functions: one with the
diff --git a/drd/drd_pthread_intercepts.c b/drd/drd_pthread_intercepts.c
index 585aafe22..3d1f90d3b 100644
--- a/drd/drd_pthread_intercepts.c
+++ b/drd/drd_pthread_intercepts.c
@@ -151,7 +151,7 @@ static drd_rtld_guard_fn DRD_(rtld_bind_clear) = NULL;
* @param[in] arg_decl Argument declaration list enclosed in parentheses.
* @param[in] argl Argument list enclosed in parentheses.
*/
-#ifdef VGO_darwin
+#if defined(VGO_darwin)
static int never_true;
#define PTH_FUNC(ret_ty, zf, implf, argl_decl, argl) \
ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBPTHREAD_SONAME,zf) argl_decl; \
@@ -164,29 +164,12 @@ static int never_true;
fflush(stdout); \
return pth_func_result; \
}
-#elif defined(VGO_solaris)
-/* On Solaris, libpthread is just a filter library on top of libc.
- * Threading and synchronization functions in runtime linker are not
- * intercepted.
- */
+#elif defined(VG_WRAP_THREAD_FUNCTION_LIBC_ONLY)
#define PTH_FUNC(ret_ty, zf, implf, argl_decl, argl) \
ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBC_SONAME,zf) argl_decl; \
ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBC_SONAME,zf) argl_decl \
{ return implf argl; }
-#else
-#ifdef MUSL_LIBC
-/* musl provides a single library that includes pthreads functions. */
-#define PTH_FUNC(ret_ty, zf, implf, argl_decl, argl) \
- ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBPTHREAD_SONAME,zf) argl_decl; \
- ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBPTHREAD_SONAME,zf) argl_decl \
- { return implf argl; }
-#else
-/*
- * On Linux, intercept both the libc and the libpthread functions. At
- * least glibc 2.32.9000 (Fedora 34) has an implementation of all pthread
- * functions in both libc and libpthread. Older glibc versions only have an
- * implementation of the pthread functions in libpthread.
- */
+#elif defined(VG_WRAP_THREAD_FUNCTION_LIBC_AND_LIBPTHREAD)
#define PTH_FUNC(ret_ty, zf, implf, argl_decl, argl) \
ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBC_SONAME,zf) argl_decl; \
ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBC_SONAME,zf) argl_decl \
@@ -194,7 +177,8 @@ static int never_true;
ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBPTHREAD_SONAME,zf) argl_decl; \
ret_ty VG_WRAP_FUNCTION_ZZ(VG_Z_LIBPTHREAD_SONAME,zf) argl_decl \
{ return implf argl; }
-#endif
+#else
+# error "Unknown platform/thread wrapping"
#endif
/**
diff --git a/helgrind/hg_intercepts.c b/helgrind/hg_intercepts.c
index a10c3a4a3..2bc89f8a0 100644
--- a/helgrind/hg_intercepts.c
+++ b/helgrind/hg_intercepts.c
@@ -78,26 +78,37 @@
/*----------------------------------------------------------------*/
#if defined(VGO_solaris)
-/* On Solaris, libpthread is just a filter library on top of libc.
- * Threading and synchronization functions in runtime linker are not
- * intercepted.
- */
-#define PTH_FUNC(ret_ty, f, args...) \
- ret_ty I_WRAP_SONAME_FNNAME_ZZ(VG_Z_LIBC_SONAME,f)(args); \
- ret_ty I_WRAP_SONAME_FNNAME_ZZ(VG_Z_LIBC_SONAME,f)(args)
-
/* pthread_t is typedef'd to 'unsigned int' but in DO_CREQ_* macros
sizeof(Word) is expected. */
#define CREQ_PTHREAD_T Word
#define SEM_ERROR ret
#else
-#define PTH_FUNC(ret_ty, f, args...) \
- ret_ty I_WRAP_SONAME_FNNAME_ZZ(VG_Z_LIBPTHREAD_SONAME,f)(args); \
- ret_ty I_WRAP_SONAME_FNNAME_ZZ(VG_Z_LIBPTHREAD_SONAME,f)(args)
#define CREQ_PTHREAD_T pthread_t
#define SEM_ERROR errno
#endif /* VGO_solaris */
+#define HG_EXPAND(tok) #tok
+#define HG_STR(tok) HG_EXPAND(tok)
+#define HG_WEAK_ALIAS(name, aliasname) \
+ extern __typeof (name) aliasname __attribute__ ((weak, alias(HG_STR(name))))
+
+#if defined(VG_WRAP_THREAD_FUNCTION_LIBPTHREAD_ONLY)
+#define PTH_FUNC(ret_ty, f, args...) \
+ ret_ty I_WRAP_SONAME_FNNAME_ZZ(VG_Z_LIBPTHREAD_SONAME,f)(args); \
+ ret_ty I_WRAP_SONAME_FNNAME_ZZ(VG_Z_LIBPTHREAD_SONAME,f)(args)
+#elif defined(VG_WRAP_THREAD_FUNCTION_LIBC_AND_LIBPTHREAD)
+#define PTH_FUNC(ret_ty, f, args...) \
+ ret_ty I_WRAP_SONAME_FNNAME_ZZ(VG_Z_LIBPTHREAD_SONAME,f)(args); \
+ HG_WEAK_ALIAS(I_WRAP_SONAME_FNNAME_ZZ(VG_Z_LIBPTHREAD_SONAME,f), I_WRAP_SONAME_FNNAME_ZZ(VG_Z_LIBC_SONAME,f)); \
+ ret_ty I_WRAP_SONAME_FNNAME_ZZ(VG_Z_LIBPTHREAD_SONAME,f)(args)
+#elif defined(VG_WRAP_THREAD_FUNCTION_LIBC_ONLY)
+#define PTH_FUNC(ret_ty, f, args...) \
+ ret_ty I_WRAP_SONAME_FNNAME_ZZ(VG_Z_LIBC_SONAME,f)(args); \
+ ret_ty I_WRAP_SONAME_FNNAME_ZZ(VG_Z_LIBC_SONAME,f)(args)
+#else
+# error "Unknown platform/thread wrapping"
+#endif
+
// Do a client request. These are macros rather than a functions so
// as to avoid having an extra frame in stack traces.
diff --git a/include/pub_tool_redir.h b/include/pub_tool_redir.h
index bd65a44b4..d665afd98 100644
--- a/include/pub_tool_redir.h
+++ b/include/pub_tool_redir.h
@@ -277,11 +277,7 @@
/* --- Soname of the pthreads library. --- */
#if defined(VGO_linux)
-# if defined(MUSL_LIBC)
-# define VG_Z_LIBPTHREAD_SONAME libcZdZa // libc.*
-#else
# define VG_Z_LIBPTHREAD_SONAME libpthreadZdsoZd0 // libpthread.so.0
-#endif
#elif defined(VGO_darwin)
# define VG_Z_LIBPTHREAD_SONAME libSystemZdZaZddylib // libSystem.*.dylib
#elif defined(VGO_solaris)
@@ -364,6 +360,27 @@
Bool VG_(is_soname_ld_so) (const HChar *soname);
+// Some macros to help decide which libraries (libc or libpthread
+// or some platform-specific variation of these) should be used
+// for wrapping pthread/semaphore functions with DRD and Helgrind
+// The possibilities are a) only in libpthread
+// b) mabye in both libpthread and libc or c) only in libc
+// Linux GNU libc is moving from a) to c) (starting with Fedora 33)
+// Linux MUSL libc is c)
+// Darwin is a)
+// Solaris is c)
+// FreeBSD is b)
+
+#if defined(VGO_darwin)
+#define VG_WRAP_THREAD_FUNCTION_LIBPTHREAD_ONLY
+#elif defined(VGO_solaris) || (defined(VGO_linux) && defined(MUSL_LIBC))
+#define VG_WRAP_THREAD_FUNCTION_LIBC_ONLY
+#elif defined(VGO_linux)
+#define VG_WRAP_THREAD_FUNCTION_LIBC_AND_LIBPTHREAD
+#else
+# error "Unknown platform"
+#endif
+
#endif // __PUB_TOOL_REDIR_H
/*--------------------------------------------------------------------*/

View file

@ -0,0 +1,27 @@
commit ba73f8d2ebe4b5fe8163ee5ab806f0e50961ebdf
Author: Andreas Arnez <arnez@linux.ibm.com>
Date: Tue Nov 3 18:17:30 2020 +0100
Bug 428648 - s390x: Force 12-bit amode for vector loads in isel
Similar to Bug 417452, where the instruction selector sometimes attempted
to generate vector stores with a 20-bit displacement, the same problem has
now been reported with vector loads.
The problem is caused in s390_isel_vec_expr_wrk(), where the addressing
mode is generated with s390_isel_amode() instead of
s390_isel_amode_short(). This is fixed.
diff --git a/VEX/priv/host_s390_isel.c b/VEX/priv/host_s390_isel.c
index 2f80dd850..134f3eb6f 100644
--- a/VEX/priv/host_s390_isel.c
+++ b/VEX/priv/host_s390_isel.c
@@ -3741,7 +3741,7 @@ s390_isel_vec_expr_wrk(ISelEnv *env, IRExpr *expr)
/* --------- LOAD --------- */
case Iex_Load: {
HReg dst = newVRegV(env);
- s390_amode *am = s390_isel_amode(env, expr->Iex.Load.addr);
+ s390_amode *am = s390_isel_amode_short(env, expr->Iex.Load.addr);
if (expr->Iex.Load.end != Iend_BE)
goto irreducible;

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,201 @@
commit a53adb79711ccfc76a4ee32b20253045cdab55c7
Author: Mark Wielaard <mark@klomp.org>
Date: Mon Jul 27 16:36:17 2020 +0200
Handle linux syscalls sched_getattr and sched_setattr
The only "special" thing about these syscalls is that the given
struct sched_attr determines its own size for future expansion.
Original fix by "ISHIKAWA,chiaki" <ishikawa@yk.rim.or.jp>
https://bugs.kde.org/show_bug.cgi?id=369029
diff --git a/coregrind/m_syswrap/priv_syswrap-linux.h b/coregrind/m_syswrap/priv_syswrap-linux.h
index cdc73c1e6..eb0b320ca 100644
--- a/coregrind/m_syswrap/priv_syswrap-linux.h
+++ b/coregrind/m_syswrap/priv_syswrap-linux.h
@@ -227,6 +227,8 @@ DECL_TEMPLATE(linux, sys_fremovexattr);
// syscalls.
DECL_TEMPLATE(linux, sys_sched_setparam);
DECL_TEMPLATE(linux, sys_sched_getparam);
+DECL_TEMPLATE(linux, sys_sched_setattr);
+DECL_TEMPLATE(linux, sys_sched_getattr);
DECL_TEMPLATE(linux, sys_sched_setscheduler);
DECL_TEMPLATE(linux, sys_sched_getscheduler);
DECL_TEMPLATE(linux, sys_sched_yield);
diff --git a/coregrind/m_syswrap/syswrap-amd64-linux.c b/coregrind/m_syswrap/syswrap-amd64-linux.c
index 28d90135a..d6f3eb910 100644
--- a/coregrind/m_syswrap/syswrap-amd64-linux.c
+++ b/coregrind/m_syswrap/syswrap-amd64-linux.c
@@ -846,9 +846,8 @@ static SyscallTableEntry syscall_table[] = {
LINX_(__NR_process_vm_writev, sys_process_vm_writev),// 311
LINX_(__NR_kcmp, sys_kcmp), // 312
LINX_(__NR_finit_module, sys_finit_module), // 313
-// LIN__(__NR_sched_setattr, sys_ni_syscall), // 314
-
-// LIN__(__NR_sched_getattr, sys_ni_syscall), // 315
+ LINX_(__NR_sched_setattr, sys_sched_setattr), // 314
+ LINXY(__NR_sched_getattr, sys_sched_getattr), // 315
LINX_(__NR_renameat2, sys_renameat2), // 316
// LIN__(__NR_seccomp, sys_ni_syscall), // 317
LINXY(__NR_getrandom, sys_getrandom), // 318
diff --git a/coregrind/m_syswrap/syswrap-arm-linux.c b/coregrind/m_syswrap/syswrap-arm-linux.c
index 579542785..70700e53f 100644
--- a/coregrind/m_syswrap/syswrap-arm-linux.c
+++ b/coregrind/m_syswrap/syswrap-arm-linux.c
@@ -1009,6 +1009,8 @@ static SyscallTableEntry syscall_main_table[] = {
LINXY(__NR_process_vm_readv, sys_process_vm_readv), // 376
LINX_(__NR_process_vm_writev, sys_process_vm_writev),// 377
+ LINX_(__NR_sched_setattr, sys_sched_setattr), // 380
+ LINXY(__NR_sched_getattr, sys_sched_getattr), // 381
LINX_(__NR_renameat2, sys_renameat2), // 382
LINXY(__NR_getrandom, sys_getrandom), // 384
diff --git a/coregrind/m_syswrap/syswrap-arm64-linux.c b/coregrind/m_syswrap/syswrap-arm64-linux.c
index 81e01456f..acca02442 100644
--- a/coregrind/m_syswrap/syswrap-arm64-linux.c
+++ b/coregrind/m_syswrap/syswrap-arm64-linux.c
@@ -806,8 +806,8 @@ static SyscallTableEntry syscall_main_table[] = {
LINX_(__NR_process_vm_writev, sys_process_vm_writev), // 271
LINX_(__NR_kcmp, sys_kcmp), // 272
LINX_(__NR_finit_module, sys_finit_module), // 273
- // (__NR_sched_setattr, sys_ni_syscall), // 274
- // (__NR_sched_getattr, sys_ni_syscall), // 275
+ LINX_(__NR_sched_setattr, sys_sched_setattr), // 274
+ LINXY(__NR_sched_getattr, sys_sched_getattr), // 275
LINX_(__NR_renameat2, sys_renameat2), // 276
// (__NR_seccomp, sys_ni_syscall), // 277
LINXY(__NR_getrandom, sys_getrandom), // 278
diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c
index 5b5b7eee6..56be3032d 100644
--- a/coregrind/m_syswrap/syswrap-linux.c
+++ b/coregrind/m_syswrap/syswrap-linux.c
@@ -3677,6 +3677,41 @@ POST(sys_sched_getparam)
POST_MEM_WRITE( ARG2, sizeof(struct vki_sched_param) );
}
+PRE(sys_sched_setattr)
+{
+ struct vki_sched_attr *attr;
+ PRINT("sched_setattr ( %ld, %#" FMT_REGWORD "x, %#"
+ FMT_REGWORD "x )", SARG1, ARG2, ARG3 );
+ PRE_REG_READ3(long, "sched_setattr",
+ vki_pid_t, pid, struct sched_attr *, p, unsigned int, flags);
+ /* We need to be able to read at least the size field. */
+ PRE_MEM_READ( "sched_setattr(attr->size)", ARG2, sizeof(vki_uint32_t) );
+ attr = (struct vki_sched_attr *)(Addr)ARG2;
+ if (ML_(safe_to_deref)(attr,sizeof(vki_uint32_t)))
+ PRE_MEM_READ( "sched_setattr(attr)", (Addr)attr, attr->size);
+}
+
+PRE(sys_sched_getattr)
+{
+ struct vki_sched_attr *attr;
+ PRINT("sched_getattr ( %ld, %#" FMT_REGWORD "x, %ld, %#"
+ FMT_REGWORD "x )", SARG1, ARG2, ARG3, ARG4 );
+ PRE_REG_READ4(long, "sched_getattr",
+ vki_pid_t, pid, struct sched_attr *, p,
+ unsigned int, size, unsigned int, flags);
+ /* We need to be able to read at least the size field. */
+ PRE_MEM_READ( "sched_setattr(attr->size)", ARG2, sizeof(vki_uint32_t) );
+ /* And the kernel needs to be able to write to the whole struct size. */
+ attr = (struct vki_sched_attr *)(Addr)ARG2;
+ if (ML_(safe_to_deref)(attr,sizeof(vki_uint32_t)))
+ PRE_MEM_WRITE( "sched_setattr(attr)", (Addr)attr, attr->size);
+}
+POST(sys_sched_getattr)
+{
+ struct vki_sched_attr *attr = (struct vki_sched_attr *)(Addr)ARG2;
+ POST_MEM_WRITE( (Addr)attr, attr->size );
+}
+
PRE(sys_sched_getscheduler)
{
PRINT("sys_sched_getscheduler ( %ld )", SARG1);
diff --git a/coregrind/m_syswrap/syswrap-ppc32-linux.c b/coregrind/m_syswrap/syswrap-ppc32-linux.c
index eed12a1bc..c19cb9e0e 100644
--- a/coregrind/m_syswrap/syswrap-ppc32-linux.c
+++ b/coregrind/m_syswrap/syswrap-ppc32-linux.c
@@ -1016,6 +1016,9 @@ static SyscallTableEntry syscall_table[] = {
LINXY(__NR_process_vm_readv, sys_process_vm_readv), // 351
LINX_(__NR_process_vm_writev, sys_process_vm_writev),// 352
+ LINX_(__NR_sched_setattr, sys_sched_setattr), // 355
+ LINXY(__NR_sched_getattr, sys_sched_getattr), // 356
+
LINXY(__NR_getrandom, sys_getrandom), // 359
LINXY(__NR_memfd_create, sys_memfd_create), // 360
diff --git a/coregrind/m_syswrap/syswrap-ppc64-linux.c b/coregrind/m_syswrap/syswrap-ppc64-linux.c
index d58200b49..b6422a765 100644
--- a/coregrind/m_syswrap/syswrap-ppc64-linux.c
+++ b/coregrind/m_syswrap/syswrap-ppc64-linux.c
@@ -998,6 +998,8 @@ static SyscallTableEntry syscall_table[] = {
LINXY(__NR_process_vm_readv, sys_process_vm_readv), // 351
LINX_(__NR_process_vm_writev, sys_process_vm_writev),// 352
+ LINX_(__NR_sched_setattr, sys_sched_setattr), // 355
+ LINXY(__NR_sched_getattr, sys_sched_getattr), // 356
LINX_(__NR_renameat2, sys_renameat2), // 357
LINXY(__NR_getrandom, sys_getrandom), // 359
diff --git a/coregrind/m_syswrap/syswrap-s390x-linux.c b/coregrind/m_syswrap/syswrap-s390x-linux.c
index a0a330aa2..3427fee16 100644
--- a/coregrind/m_syswrap/syswrap-s390x-linux.c
+++ b/coregrind/m_syswrap/syswrap-s390x-linux.c
@@ -825,8 +825,8 @@ static SyscallTableEntry syscall_table[] = {
LINX_(__NR_kcmp, sys_kcmp), // 343
// ?????(__NR_finit_module, ), // 344
-// ?????(__NR_sched_setattr, ), // 345
-// ?????(__NR_sched_getattr, ), // 346
+ LINX_(__NR_sched_setattr, sys_sched_setattr), // 345
+ LINXY(__NR_sched_getattr, sys_sched_getattr), // 346
LINX_(__NR_renameat2, sys_renameat2), // 347
// ?????(__NR_seccomp, ), // 348
LINXY(__NR_getrandom, sys_getrandom), // 349
diff --git a/coregrind/m_syswrap/syswrap-x86-linux.c b/coregrind/m_syswrap/syswrap-x86-linux.c
index 332ed0bf2..b59d96f37 100644
--- a/coregrind/m_syswrap/syswrap-x86-linux.c
+++ b/coregrind/m_syswrap/syswrap-x86-linux.c
@@ -1580,8 +1580,8 @@ static SyscallTableEntry syscall_table[] = {
LINX_(__NR_kcmp, sys_kcmp), // 349
// LIN__(__NR_finit_module, sys_ni_syscall), // 350
-// LIN__(__NR_sched_setattr, sys_ni_syscall), // 351
-// LIN__(__NR_sched_getattr, sys_ni_syscall), // 352
+ LINX_(__NR_sched_setattr, sys_sched_setattr), // 351
+ LINXY(__NR_sched_getattr, sys_sched_getattr), // 352
LINX_(__NR_renameat2, sys_renameat2), // 353
// LIN__(__NR_seccomp, sys_ni_syscall), // 354
diff --git a/include/vki/vki-linux.h b/include/vki/vki-linux.h
index 75b583165..ef93b9258 100644
--- a/include/vki/vki-linux.h
+++ b/include/vki/vki-linux.h
@@ -410,6 +410,23 @@ struct vki_sched_param {
int sched_priority;
};
+struct vki_sched_attr {
+ vki_uint32_t size;
+ vki_uint32_t sched_policy;
+ vki_uint64_t sched_flags;
+
+ /* SCHED_NORMAL, SCHED_BATCH */
+ vki_int32_t sched_nice;
+
+ /* SCHED_FIFO, SCHED_RR */
+ vki_uint32_t sched_priority;
+
+ /* SCHED_DEADLINE */
+ vki_uint64_t sched_runtime;
+ vki_uint64_t sched_deadline;
+ vki_uint64_t sched_period;
+};
+
#define VKI_TASK_COMM_LEN 16
//----------------------------------------------------------------------

View file

@ -0,0 +1,63 @@
diff --git a/VEX/priv/guest_ppc_toIR.c b/VEX/priv/guest_ppc_toIR.c
index c9c058a7a..d726d63de 100644
--- a/VEX/priv/guest_ppc_toIR.c
+++ b/VEX/priv/guest_ppc_toIR.c
@@ -25671,49 +25671,29 @@ dis_vx_store ( UInt prefix, UInt theInstr )
case 0x38D: // stxsibx
{
- IRExpr *stored_word;
- IRTemp byte_to_store = newTemp( Ity_I64 );
+ IRTemp byte_to_store = newTemp( Ity_I8 );
DIP("stxsibx %u,r%u,r%u\n", (UInt)XS, rA_addr, rB_addr);
- /* Can't store just a byte, need to fetch the word at EA merge data
- * and store.
- */
- stored_word = load( Ity_I64, mkexpr( EA ) );
- assign( byte_to_store, binop( Iop_And64,
+ assign( byte_to_store, unop( Iop_64to8,
unop( Iop_V128HIto64,
- mkexpr( vS ) ),
- mkU64( 0xFF ) ) );
+ mkexpr( vS ) ) ) );
- store( mkexpr( EA ), binop( Iop_Or64,
- binop( Iop_And64,
- stored_word,
- mkU64( 0xFFFFFFFFFFFFFF00 ) ),
- mkexpr( byte_to_store ) ) );
+ store( mkexpr( EA ), mkexpr( byte_to_store ) );
break;
}
case 0x3AD: // stxsihx
{
- IRExpr *stored_word;
- IRTemp byte_to_store = newTemp( Ity_I64 );
+ IRTemp hword_to_store = newTemp( Ity_I16 );
DIP("stxsihx %u,r%u,r%u\n", (UInt)XS, rA_addr, rB_addr);
- /* Can't store just a halfword, need to fetch the word at EA merge data
- * and store.
- */
- stored_word = load( Ity_I64, mkexpr( EA ) );
- assign( byte_to_store, binop( Iop_And64,
- unop( Iop_V128HIto64,
- mkexpr( vS ) ),
- mkU64( 0xFFFF ) ) );
+ assign( hword_to_store, unop( Iop_64to16,
+ unop( Iop_V128HIto64,
+ mkexpr( vS ) ) ) );
- store( mkexpr( EA ), binop( Iop_Or64,
- binop( Iop_And64,
- stored_word,
- mkU64( 0xFFFFFFFFFFFF0000 ) ),
- mkexpr( byte_to_store ) ) );
+ store( mkexpr( EA ), mkexpr( hword_to_store ) );
break;
}

View file

@ -0,0 +1,15 @@
--- valgrind/glibc-2.34567-NPTL-helgrind.supp.jj 2009-08-19 15:37:48.000000000 +0200
+++ valgrind/glibc-2.34567-NPTL-helgrind.supp 2009-10-21 16:46:31.000000000 +0200
@@ -88,6 +88,12 @@
obj:*/lib*/libpthread-2.*so*
}
{
+ helgrind-glibc2X-102a
+ Helgrind:Race
+ fun:mythread_wrapper
+ obj:*vgpreload_helgrind*.so
+}
+{
helgrind-glibc2X-103
Helgrind:Race
fun:pthread_cond_*@@GLIBC_2.*

View file

@ -1,19 +1,14 @@
%{?scl:%scl_package valgrind}
Summary: Dynamic analysis tools to detect memory or thread bugs and profile
Summary: Tool for finding memory management bugs in programs
Name: %{?scl_prefix}valgrind
Version: 3.27.1
Release: 2%{?dist}
Version: 3.16.1
Release: 18%{?dist}
Epoch: 1
License: GPLv2+
URL: http://www.valgrind.org/
# This ignores licenses that are only found in the test or perf sources
# we only care about those license statements found in sources that end
# up in the binary packages. One piece of code for which we don't have
# a license specifier is in coregrind/m_main.c for some Hacker's Delight
# public domain code, which is only compiled into Darwin binaries, which
# we don't create. Also some subpackages have their own license tags.
License: GPL-3.0-or-later AND bzip2-1.0.6 AND (GPL-3.0-or-later AND LGPL-2.0-or-later) AND (GPL-3.0-or-later AND ISC) AND (GPL-3.0-or-later AND Unlicense) AND (GPL-3.0-or-later AND Zlib) AND (GPL-3.0-or-later WITH GCC-exception-2.0) AND (LGPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-3.0-or-later AND BSD-3-Clause) AND (GPL-3.0-or-later AND (MIT OR NCSA)) AND CMU-Mach AND (GPL-3.0-or-later AND X11 AND BSD-3-Clause) AND X11 AND (GPL-3.0-or-later AND LGPL-2.0-or-later) AND (GPL-2.0-or-later WITH Autoconf-exception-generic) AND (GPL-3.0-or-later WITH Autoconf-exception-generic-3.0) AND FSFULLR AND FSFAP AND FSFUL AND FSFULLRWD
URL: https://www.valgrind.org/
# Only necessary for RHEL, will be ignored on Fedora
# Are we building for a Software Collection?
%{?scl:%global is_scl 1}
@ -21,23 +16,22 @@ URL: https://www.valgrind.org/
# We never want the openmpi subpackage when building a software collecton.
# We always want it for fedora.
# We only want it for older rhel.
# And on fedora > 39 i386 dropped openmpi.
# We only want it for older rhel. But not s390x for too old rhel.
%if %{is_scl}
%global build_openmpi 0
%else
%if 0%{?fedora}
%ifarch %{ix86}
%global build_openmpi (%{?fedora} < 40)
%else
%global build_openmpi 1
%endif
%global build_openmpi 1
%endif
%if 0%{?rhel}
%if 0%{?rhel} > 7
%global build_openmpi 0
%else
%global build_openmpi 1
%ifarch s390x
%global build_openmpi (%{?rhel} > 6)
%else
%global build_openmpi 1
%endif
%endif
%endif
%endif
@ -57,11 +51,17 @@ URL: https://www.valgrind.org/
# Whether to run the full regtest or only a limited set
# The full regtest includes gdb_server integration tests
# and experimental tools.
# Don't run them when creating scl, the gdb_server tests might hang.
# Only run full regtests on fedora, but not on older rhel
# or when creating scl, the gdb_server tests might hang.
%if %{is_scl}
%global run_full_regtest 0
%else
%global run_full_regtest 1
%if 0%{?fedora}
%global run_full_regtest 1
%endif
%if 0%{?rhel}
%global run_full_regtest (%rhel >= 7)
%endif
%endif
# Generating minisymtabs doesn't really work for the staticly linked
@ -71,19 +71,85 @@ URL: https://www.valgrind.org/
# So those will already have their full symbol table.
%undefine _include_minidebuginfo
Source0: https://sourceware.org/pub/valgrind/valgrind-%{version}.tar.bz2
Source0: ftp://sourceware.org/pub/valgrind/valgrind-%{version}.tar.bz2
# Needs investigation and pushing upstream
Patch1: valgrind-3.9.0-cachegrind-improvements.patch
# KDE#211352 - helgrind races in helgrind's own mythread_wrapper
Patch2: valgrind-3.9.0-helgrind-race-supp.patch
# Make ld.so supressions slightly less specific.
Patch2: valgrind-3.9.0-ldso-supp.patch
Patch3: valgrind-3.9.0-ldso-supp.patch
# We want all executables and libraries in libexec instead of lib
# so they are only available for valgrind usage itself and so the
# same directory is used independent of arch.
Patch4: valgrind-3.16.0-pkglibexecdir.patch
# Add some stack-protector
Patch3: valgrind-3.26.0-some-stack-protector.patch
Patch5: valgrind-3.16.0-some-stack-protector.patch
# Add some -Wl,z,now.
Patch4: valgrind-3.26.0-some-Wl-z-now.patch
Patch6: valgrind-3.16.0-some-Wl-z-now.patch
# KDE#422174 unhandled instruction bytes: 0x48 0xE9 (REX prefix JMP instr)
Patch7: valgrind-3.16.1-REX-prefix-JMP.patch
# KDE#422623 epoll_ctl warns for uninit padding on non-amd64 64bit arches
Patch8: valgrind-3.16.1-epoll.patch
# KDE#369029 handle linux syscalls sched_getattr and sched_setattr
Patch9: valgrind-3.16.1-sched_getsetattr.patch
# KDE#415293 Incorrect call-graph tracking due to new _dl_runtime_resolve*
Patch10: valgrind-3.16.1-dl_runtime_resolve.patch
# KDE#427787 Support new faccessat2 linux syscall (439)
Patch11: valgrind-3.16.1-faccessat2.patch
# KDE#427931 gdbserver_tests/nlcontrolc.vgtest hangs on fedora rawhide
Patch12: valgrind-3.16.1-gdbserver_nlcontrolc.patch
# KDE#427870 lmw, lswi and related PowerPC insns aren't allowed on ppc64le
Patch13: valgrind-3.16.1-PPC64BE-lsw.patch
# KDE#428909 helgrind: need to intercept duplicate libc definitions
Patch14: valgrind-3.16.1-pthread-intercept.patch
# KDE#428648 s390_emit_load_mem panics due to 20-bit offset for vector load
Patch15: valgrind-3.16.1-s390_emit_load_mem.patch
# KDE#133812 s390x: z14 vector instructions not implemented
Patch16: valgrind-3.16.1-s390x-z14-vector.patch
# KDE#430354 ppc stxsibx and stxsihx instructions write too much data
Patch17: valgrind-3.16.1-stxsibx-stxsihx.patch
# KDE#426014 arm64: implement fmadd and fmsub as Iop_MAdd/Sub
# KDE#430485 expr_is_guardable doesn't handle Iex_Qop
Patch18: valgrind-3.16.1-arm64-fma.patch
# KDE#397605 Add support for Linux FICLONE ioctl
Patch19: valgrind-3.16.1-ficlone.patch
# rhbz#1909415 valgrind makes false complaint about strcmp() on aarch64
# upstream git commit 359b98828
Patch20: valgrind-3.16.1-arm64-expensive-cmp.patch
# KDE#431157 PPC_FEATURE2_SCV needs to be masked in AT_HWCAP2
Patch21: valgrind-3.16.1-ppc64-scv-hwcap.patch
# KDE#432102 Support DWARF5
Patch22: valgrind-3.16.1-dwarf5.patch
# KDE#410743 shmat() calls for 32-bit programs fail when running in 64-bit
# RHBZ#1909548 shmctl(IPC_STAT) doesn't set shm_nattch on aarch64
Patch23: valgrind-3.16.0-shmctl.patch
# KDE#140178 open("/proc/self/exe", ...); doesn't quite work
# RHBZ#1925786 valgrind appears to only interject readlink on /proc/self/exe
Patch24: valgrind-3.16.1-open-proc-self-exe.patch
BuildRequires: make
BuildRequires: glibc-devel
@ -115,29 +181,22 @@ BuildRequires: autoconf
# For make check validating the documentation
BuildRequires: docbook-dtds
# For testing debuginfod-find
%if 0%{?fedora} > 29 || 0%{?rhel} > 7
BuildRequires: elfutils-debuginfod
BuildRequires: elfutils-debuginfod-client
# For using debuginfod at runtime
Recommends: elfutils-debuginfod-client
%endif
# Optional subpackages
Recommends: %{?scl_prefix}valgrind-docs = %{epoch}:%{version}-%{release}
Recommends: %{?scl_prefix}valgrind-scripts = %{epoch}:%{version}-%{release}
Recommends: %{?scl_prefix}valgrind-gdb = %{epoch}:%{version}-%{release}
# For running the testsuite.
# Some of the python scripts require python 3.9+
BuildRequires: python3-devel
# configure might use which
BuildRequires: which
%{?scl:Requires:%scl_runtime}
# We need to fixup selinux file context when doing a scl build.
# In RHEL6 we might need to fix up the labels even though the
# meta package sets up a fs equivalence. See post.
%if 0%{?rhel} == 6
%{?scl:Requires(post): /sbin/restorecon}
%endif
# We could use %%valgrind_arches as defined in redhat-rpm-config
# But that is really for programs using valgrind, it defines the
# set of architectures that valgrind works correctly on.
ExclusiveArch: %{ix86} x86_64 ppc ppc64 ppc64le s390x armv7hl aarch64 riscv64
ExclusiveArch: %{ix86} x86_64 ppc ppc64 ppc64le s390x armv7hl aarch64
# Define valarch, the architecture name that valgrind uses
# And only_arch, the configure option to only build for that arch.
@ -173,10 +232,6 @@ ExclusiveArch: %{ix86} x86_64 ppc ppc64 ppc64le s390x armv7hl aarch64 riscv64
%define valarch arm64
%define only_arch --enable-only64bit
%endif
%ifarch riscv64
%define valarch riscv64
%define only_arch --enable-only64bit
%endif
%description
Valgrind is an instrumentation framework for building dynamic analysis
@ -191,48 +246,11 @@ profiler (callgrind), and a heap profiler (massif).
%package devel
Summary: Development files for valgrind aware programs
# This is really Hybrid-BSD
# https://fedoraproject.org/wiki/Licensing:BSD#Hybrid_BSD_(half_BSD,_half_zlib)
# But that doesnt have a SPDX identifier yet
# https://gitlab.com/fedora/legal/fedora-license-data/-/issues/422
License: bzip2-1.0.6
# These are just the header files, so strictly speaking you don't
# need valgrind itself unless you are testing your builds. This used
# to be a Requires, so people might depend on the package pulling in
# the core valgrind package, so make it at least a weak dependency.
Recommends: %{?scl_prefix}valgrind = %{epoch}:%{version}-%{release}
Requires: %{?scl_prefix}valgrind = %{epoch}:%{version}-%{release}
%description devel
Header files and libraries for development of valgrind aware programs.
%package docs
Summary: Documentation for valgrind tools, scripts and gdb integration
License: GFDL-1.2-or-later
%description docs
Documentation in html and pdf, plus man pages for valgrind tools and scripts.
%package scripts
Summary: Scripts for post-processing valgrind tool output
License: GPL-3.0-or-later AND (GPL-3.0-or-later OR MPL-2.0)
# Most scripts can be used as is for post-processing a valgrind tool run.
# But callgrind_control uses vgdb.
Recommends: %{?scl_prefix}valgrind-gdb = %{epoch}:%{version}-%{release}
%description scripts
Perl and Python scripts for post-processing valgrind tool output.
%package gdb
Summary: Tools for integrating valgrind and gdb
License: GPL-3.0-or-later
Requires: %{?scl_prefix}valgrind = %{epoch}:%{version}-%{release}
# vgdb can be used without gdb, just to control valgrind.
# But normally you use it together with both valgrind and gdb.
Recommends: gdb
%description gdb
Tools and support files for integrating valgrind and gdb.
%if %{build_tools_devel}
%package tools-devel
Summary: Development files for building valgrind tools.
@ -246,8 +264,6 @@ Header files and libraries for development of valgrind tools.
%if %{build_openmpi}
%package openmpi
Summary: OpenMPI support for valgrind
# See above, Hybrid-BSD like.
License: bzip2-1.0.6
Requires: %{?scl_prefix}valgrind = %{epoch}:%{version}-%{release}
%description openmpi
@ -259,23 +275,54 @@ Valgrind User Manual for details.
%prep
%setup -q -n %{?scl:%{pkg_name}}%{!?scl:%{name}}-%{version}
%patch -P1 -p1
%patch -P2 -p1
%patch -P3 -p1
%patch -P4 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
# Old rhel gcc doesn't have -fstack-protector-strong.
%if 0%{?fedora} || 0%{?rhel} >= 7
%patch5 -p1
%patch6 -p1
%endif
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1
%patch16 -p1
%patch17 -p1
%patch18 -p1
%patch19 -p1
%patch20 -p1
%patch21 -p1
%patch22 -p1
%patch23 -p1
%patch24 -p1
%build
# LTO triggers undefined symbols in valgrind. But valgrind has a
# --enable-lto configure time option that we will use instead.
# LTO triggers undefined symbols in valgrind. Valgrind has a --enable-lto
# configure time option, but that doesn't seem to help.
# Disable LTO for now.
%define _lto_cflags %{nil}
# Some patches (might) touch Makefile.am or configure.ac files.
# Just always autoreconf so we don't need patches to prebuild files.
./autogen.sh
# Old openmpi-devel has version depended paths for mpicc.
%if %{build_openmpi}
%if 0%{?fedora} >= 13 || 0%{?rhel} >= 6
%define mpiccpath %{!?scl:%{_libdir}}%{?scl:%{_root_libdir}}/openmpi/bin/mpicc
%else
%define mpiccpath %{!?scl:%{_libdir}}%{?scl:%{_root_libdir}}/openmpi/*/bin/mpicc
%endif
%else
# We explicitly don't want the libmpi wrapper. So make sure that configure
# doesn't pick some random mpi compiler that happens to be installed.
%define mpiccpath /bin/false
@ -326,9 +373,7 @@ export LDFLAGS
%configure \
--with-mpicc=%{mpiccpath} \
%{only_arch} \
GDB=%{_bindir}/gdb \
--with-gdbscripts-dir=%{_datadir}/gdb/auto-load \
--enable-lto
GDB=%{_bindir}/gdb
%make_build
@ -431,62 +476,30 @@ fi
cat diffs
echo ===============END TESTING===============
%{!?_licensedir:%global license %%doc}
%files
%license COPYING
%{_bindir}/valgrind
%doc COPYING NEWS README_*
%doc docs/installed/html docs/installed/*.pdf
%{_bindir}/*
%dir %{_libexecdir}/valgrind
# Install just the core tools, default suppression and vgpreload libraries.
%{_libexecdir}/valgrind/default.supp
%{_libexecdir}/valgrind/*-*-linux
# Install everything in the libdir except the .so.
# The vgpreload so files might need file mode adjustment.
%{_libexecdir}/valgrind/*[^o]
# Turn on executable bit again for vgpreload libraries.
# Was disabled in %%install to prevent debuginfo stripping.
%attr(0755,root,root) %{_libexecdir}/valgrind/vgpreload_*-%{valarch}-linux.so
%files docs
%license COPYING.DOCS
%doc NEWS README_*
%doc docs/installed/html docs/installed/*.pdf
%attr(0755,root,root) %{_libexecdir}/valgrind/vgpreload*-%{valarch}-*so
%{_mandir}/man1/*
%files scripts
%license COPYING
%{_bindir}/callgrind_annotate
%{_bindir}/callgrind_control
%{_bindir}/cg_annotate
%{_bindir}/cg_diff
%{_bindir}/cg_merge
%{_bindir}/ms_print
%{_libexecdir}/valgrind/dh_view.css
%{_libexecdir}/valgrind/dh_view.html
%{_libexecdir}/valgrind/dh_view.js
%files gdb
%license COPYING
%{_bindir}/valgrind-di-server
%{_bindir}/valgrind-listener
%{_bindir}/vgdb
%{_bindir}/vgstack
# gdb register descriptions
%{_libexecdir}/valgrind/*.xml
%{_datadir}/gdb/auto-load/valgrind-monitor.py
%{_datadir}/gdb/auto-load/valgrind-monitor-def.py
%files devel
%dir %{_includedir}/valgrind
%{_includedir}/valgrind/valgrind.h
%{_includedir}/valgrind/cachegrind.h
%{_includedir}/valgrind/callgrind.h
%{_includedir}/valgrind/drd.h
%{_includedir}/valgrind/helgrind.h
%{_includedir}/valgrind/memcheck.h
%{_includedir}/valgrind/dhat.h
%{_libdir}/pkgconfig/valgrind.pc
%if %{build_tools_devel}
%files tools-devel
%license COPYING
%{_includedir}/valgrind/config.h
%{_includedir}/valgrind/libvex*h
%{_includedir}/valgrind/pub_tool_*h
@ -502,398 +515,19 @@ echo ===============END TESTING===============
%{_libdir}/valgrind/libmpiwrap*.so
%endif
%if 0%{?rhel} == 6
%post
# There is a bug in rpm (rhbz#214737) that might cause post to be run
# even thought the binary isn't installed when installing two multilib
# versions at the same time.
if [ -x %{_bindir}/valgrind ]; then
# On RHEL6 the fs equivalency should be setup by the devtoolset meta
# package, but because of a rpm bug (rhbz#924044) it might not work.
%{?scl:/sbin/restorecon %{_bindir}/valgrind}%{!?scl:true}
fi
%endif
%changelog
* Fri Jul 17 2026 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.27.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild
* Wed May 20 2026 Mark Wielaard <mjw@fedoraproject.org> - 3.27.1-1
- Valgrind 3.27.1 final
* Mon Apr 20 2026 Mark Wielaard <mjw@fedoraproject.org> - 3.27.0-1
- Valgrind 3.27.0 final
* Fri Apr 17 2026 Mark Wielaard <mjw@fedoraproject.org> - 3.27.0-0.1.RC2
- Upstream 3.27.0-RC2
* Mon Apr 13 2026 Mark Wielaard <mjw@fedoraproject.org> - 3.27.0-0.1.RC1
- Upstream 3.27.0-RC1
- Remove all VALGRIND_3_26_BRANCH and proposed upstream patches
* Thu Jan 29 2026 Mark Wielaard <mjw@fedoraproject.org> - 3.26.0-5
- Add 0001-Refix-still_reachable-xml-closing-tag-and-add-testca.patch
* Mon Jan 26 2026 Mark Wielaard <mjw@fedoraproject.org> - 3.26.0-4
- Add more VALGRIND_3_26_BRANCH patches
- 0007-Bug-514613-Unclosed-leak_summary-still_reachable-tag.patch
- 0008-Bug-514206-Assertion-sr_isError-sr-failed-mmap-fd-po.patch
* Sat Jan 17 2026 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.26.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild
* Thu Jan 8 2026 Mark Wielaard <mjw@fedoraproject.org> - 3.26.0-2
- Add VALGRIND_3_26_BRANCH patches
- 0001-Prepare-NEWS-for-branch-3.26-fixes.patch
- 0002-Bug-511972-valgrind-3.26.0-tests-fail-to-build-on-up.patch
- 0003-readlink-proc-self-exe-overwrites-buffer-beyond-its-.patch
- 0004-Linux-DRD-suppression-add-an-entry-for-__is_decorate.patch
- 0005-Linux-Helgrind-add-a-suppression-for-_dl_allocate_tl.patch
- 0006-Disable-linux-madvise-MADV_GUARD_INSTALL.patch
* Fri Oct 24 2025 Mark Wielaard <mjw@fedoraproject.org> - 3.26.0-1
- Valgrind 3.26.0 final
- Clarify License of valgrind-scripts.
* Sat Oct 18 2025 Mark Wielaard <mjw@fedoraproject.org> - 3.26.0-0.1.RC1
- Upstream 3.26.0-RC1
- Remove all VALGRIND_3_25_BRANCH and proposed upstream patches
- Refresh some-stack-protector and some-Wl-z-now patches.
- Add vgstack to valgrind-gdb.
- Update License to GPL-3.0-or-later
* Mon Aug 11 2025 Mark Wielaard <mjw@fedoraproject.org> - 3.25.1-4
- Add ppc64-strcmp-ld.patch
- Add 0003-Add-several-missing-syscall-hooks-to-ppc64-linux.patch
* Tue Aug 5 2025 Mark Wielaard <mjw@fedoraproject.org> - 3.25.1-3
- Add VALGRIND_3_25_BRANCH patches
- 0001-Prepare-NEWS-for-branch-3.25.x-fixes.patch
- 0002-Bug-503241-s390x-Support-z17-changes-to-the-NNPA-ins.patch
* Fri Jul 25 2025 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.25.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild
* Tue May 20 2025 Mark Wielaard <mjw@fedoraproject.org> - 3.25.1-1
- Valgrind 3.25.1 final
* Fri May 16 2025 Mark Wielaard <mjw@fedoraproject.org> - 3.25.0-3
- Add 2 more VALGRIND_3_25_BRANCH patches
* Fri May 9 2025 Mark Wielaard <mjw@fedoraproject.org> - 3.25.0-2
- Add VALGRIND_3_25_BRANCH patches
* Fri Apr 25 2025 Mark Wielaard <mjw@fedoraproject.org> - 3.25.0-1
- Valgrind 3.25.0 final
* Wed Apr 23 2025 Mark Wielaard <mjw@fedoraproject.org> - 3.25.0-0.1.RC2
- Upstream 3.25.0-RC2
* Fri Apr 18 2025 Mark Wielaard <mjw@fedoraproject.org> - 3.25.0-0.1.RC1
- Upstream 3.25.0-RC1
- Remove all VALGRIND_3_24_BRANCH patches
- Enable riscv64 arch support
* Sun Mar 30 2025 Mark Wielaard <mjw@fedoraproject.org> - 3.24.0-8
- Add new VALGRIND_3_24_BRANCH patches
- 0019-filter_gdb.in-__syscall_cancel_arch-is-just-in-a-sys.patch
- 0020-Bug-501893-Missing-suppression-for-__wcscat_avx2-str.patch
- 0021-filter_gdb.in-filter-out-__libc_do_syscall.patch
- 0022-Handle-top-__syscall_cancel-frames-when-getting-stac.patch
- Remove valgrind-3.24.0-syscall-cancel.patch (replaced by 0022).
* Fri Mar 28 2025 Mark Wielaard <mjw@fedoraproject.org> - 3.24.0-7
- Add valgrind-3.24.0-syscall-cancel.patch
* Wed Mar 12 2025 Mark Wielaard <mjw@fedoraproject.org> - 3.24.0-6
- More VALGRIND_3_24_BRANCH patches
0016-syswrap-generic-Emit-pp_ExeContext-after-the-file-de.patch
0017-add_hardwired_spec-for-ld-linux-x86-64.so.2-memcmp.patch
0018-gdbserver_tests-filter-out-new-Missing-rpms-message.patch
* Fri Jan 17 2025 Mark Wielaard <mjw@fedoraproject.org> - 3.24.0-5
- valgrind-devel now Recommends, instead of Requires, valgrind.
- valgrind-gdb now Requires valgrind, instead of valgrind-devel.
- valgrind-scripts now Recommends valgrind-gdb
- valgrind-gdb now Recommends gdb
* Wed Jan 15 2025 Mark Wielaard <mjw@fedoraproject.org> - 3.24.0-4
- Add 0015-ppc-test_dfp2-build-fix-for-GCC-15.patch
* Tue Jan 14 2025 Mark Wielaard <mjw@fedoraproject.org> - 3.24.0-3
- Add more VALGRIND_3_24_BRANCH patches
0012-Recognize-new-DWARF5-DW_LANG-constants.patch
0013-Bug-498317-FdBadUse-is-not-a-valid-CoreError-type-in.patch
0014-linux-support-EVIOCGRAB-ioctl.patch
- Split main valgrind package into several subpackages:
- valgrind now contains just the core tools.
- valgrind-scripts contains the post-processing scripts for callgrind,
cachegrind, massif and dhat which depend on perl and python.
- valgrind-gdb contains the debuginfo client/server and (v)gdb support.
- valgrind-docs contains the man pages, html and pdf manual.
* Tue Nov 26 2024 Mark Wielaard <mjw@fedoraproject.org> - 3.24.0-2
- Add VALGRIND_3_24_BRANCH patches
0001-Prepare-NEWS-for-branch-3.24-fixes.patch
0002-vgdb.c-fork_and_exec_valgrind-Fix-off-by-one-error-w.patch
0003-vgdb.c-fork_and_exec_valgrind-Fix-another-off-by-one.patch
0004-regtest-add-a-fdleak-filter-for-write-on-write-on-li.patch
0005-Add-exp-and-supp-patterns-for-missing-main-frame-for.patch
0006-Add-additional-exp-ppc64le-files-to-EXTRA_DIST.patch
0007-Add-support-for-landlock_create_ruleset-444-landlock.patch
0008-helgrind-tests-tc17_sembar.c-Remove-bool-typedef.patch
0009-drd-tests-swapcontext.c-Rename-typedef-struct-thread.patch
0010-none-tests-bug234814.c-sa_handler-take-an-int-as-arg.patch
0011-Add-open_tree-move_mount-fsopen-fsconfig-fsmount-fsp.patch
* Mon Nov 4 2024 Mark Wielaard <mjw@fedoraproject.org> - 3.24.0-1
- Upstream 3.24.0 final
* Sat Jul 20 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.23.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
* Sat Jul 6 2024 Mark Wielaard <mjw@fedoraproject.org> - 3.23.0-4
- Add more upstream VALGRIND_3_23_BRANCH patches
0016-mips-skip-using-shared-syscall-numbers-for-mips64.patch
0017-gdbserver_tests-filters-remove-python-rpm-module-loa.patch
0018-Implement-VMOVQ-xmm1-xmm2-m64.patch
0019-arm64-Fix-fcvtas-instruction.patch
0020-gdbserver_tests-filters-remove-more-verbose-python-r.patch
0021-Avoid-dev-inode-check-on-btrfs-with-sanity-level-3.patch
* Sun Jun 23 2024 Mark Wielaard <mjw@fedoraproject.org> - 3.23.0-3
- Add more upstream VALGRIND_3_23_BRANCH patches
0012-Bug-487439-SIGILL-in-JDK11-JDK17.patch
0013-Don-t-leave-fds-created-with-log-file-xml-file-or-lo.patch
0014-Close-both-internal-pipe-fds-after-VG_-fork-in-paren.patch
0015-Don-t-allow-programs-calling-fnctl-on-valgrind-s-own.patch
* Mon Jun 10 2024 Mark Wielaard <mjw@fedoraproject.org> - 3.23.0-2
- Add upstream VALGRIND_3_23_BRANCH patches
* Fri Apr 26 2024 Mark Wielaard <mjw@fedoraproject.org> - 3.23.0-1
- Upstream 3.23.0 final
* Thu Apr 25 2024 Mark Wielaard <mjw@fedoraproject.org> - 3.23.0-0.2.RC2
- configure --enable-lto
* Wed Apr 24 2024 Mark Wielaard <mjw@fedoraproject.org> - 3.23.0-0.1.RC2
- Upstream 3.23.0-RC2
* Sat Apr 20 2024 Mark Wielaard <mjw@fedoraproject.org> - 3.23.0-0.1.RC1
+- Upstream 3.23.0-RC1
+- Remove all upstreamed patches
* Sat Apr 13 2024 Mark Wielaard <mjw@fedoraproject.org> - 3.22.0-8
- Add BuildRequires: python3-devel for running testsuite.
- Add valgrind-3.22.0-gdb-thread-exited.patch
- Add valgrind-3.22.0-set_vma_name-supp.patch
- Add valgrind-3.22.0-pth_mempcpy_false_races.patch
- Add valgrind-3.22.0-amd64-VFMADD213.patch
- Add valgrind-3.22.0-amd64-redir-strcmp.patch
* Mon Mar 11 2024 Mark Wielaard <mjw@fedoraproject.org> - 3.22.0-7
- Add valgrind-3.22.0-gcc-builtin_strcmp-128-256-bit-vector.patch
* Mon Mar 4 2024 Mark Wielaard <mjw@fedoraproject.org>
- Update Fedora license tags to spdx license tags
* Sat Jan 27 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.22.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Mon Jan 22 2024 Mark Wielaard <mjw@fedoraproject.org> - 3.22.0-5
- Add valgrind-3.22.0-x86-nop.patch
* Sat Dec 9 2023 Mark Wielaard <mjw@fedoraproject.org> - 3.22.0-4
- Add valgrind-3.22.0-fchmodat2.patch
- Prep for migration to SPDX identifiers
* Tue Dec 5 2023 Mark Wielaard <mjw@fedoraproject.org> - 3.22.0-3
- Add valgrind-3.22.0-rodata.patch
* Fri Nov 17 2023 Mark Wielaard <mjw@fedoraproject.org> - 3.22.0-2
- Add valgrind-3.22.0-valgrind-monitor-python-re.patch
- Drop support for rhel6
* Tue Oct 31 2023 Mark Wielaard <mjw@fedoraproject.org> - 3.22.0-1
- Upstream 3.22.0 final
- BuildRequires elfutils-debuginfod for testing
* Mon Oct 30 2023 Mark Wielaard <mjw@fedoraproject.org> - 3.22.0-0.2.RC2
- Update valgrind-3.21.0-no-memcpy-replace-check.patch
- Fedora 40 dropped openmpi support on i386
* Thu Oct 26 2023 Mark Wielaard <mjw@fedoraproject.org> - 3.22.0-0.1.RC2
- Upstream 3.22.0-RC2
* Tue Oct 17 2023 Mark Wielaard <mjw@fedoraproject.org> - 3.22.0-0.1.RC1
- Upstream 3.22.0-RC1
- Remove all upstreamed patches
- Adjust valgrind-3.16.0-some-stack-protector.patch
- Adjust valgrind-3.16.0-some-Wl-z-now.patch
- Add cachegrind.h to valgrind-devel package
* Mon Aug 21 2023 Mark Wielaard <mjw@fedoraproject.org> - 3.21.0-10
- Add valgrind-3.21.0-lazy-debuginfo.patch
- Add valgrind-3.21.0-cleanup-read_elf_object.patch
* Thu Aug 17 2023 Mark Wielaard <mjw@fedoraproject.org> - 3.21.0-9
- Add valgrind-3.21.0-gdb-multi-mode-stdout-redirecting-to-stderr.patch
- Use %%patch -Pn instead of deprecated %%patchn
* Sat Jul 22 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.21.0-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Thu Jun 22 2023 Mark Wielaard <mjw@fedoraproject.org> - 3.21.0-7
- Add valgrind-3.21.0-vgm.patch and valgrind-3.21.0-vgm-tests.patch
- Add valgrind-3.21.0-pgste.patch
* Thu Jun 1 2023 Mark Wielaard <mjw@fedoraproject.org> - 3.21.0-6
- Add valgrind-3.21.0-callgrind_control-no-strict.patch
- Add valgrind-3.21.0-realloc-again.patch
* Tue May 30 2023 Mark Wielaard <mjw@fedoraproject.org> - 3.21.0-5
- Update valgrind-3.21.0-no-memcpy-replace-check.patch (memcpy_chk)
* Wed May 17 2023 Mark Wielaard <mjw@fedoraproject.org> - 3.21.0-4
- Add valgrind-3.21.0-epoll_pwait2.patch
* Tue May 16 2023 Alexandra Hájková <ahajkova@redhat.com> - 3.21.0-3
- Add valgrind-3.21.0-Add-with-gdbscripts-dir.patch
* Fri May 5 2023 Mark Wielaard <mjw@fedoraproject.org> - 3.21.0-2
- Add valgrind-3.21.0-no-memcpy-replace-check.patch
* Fri Apr 28 2023 Mark Wielaard <mjw@fedoraproject.org> - 3.21.0-1
- Upstream 3.21.0 final
* Sat Apr 22 2023 Mark Wielaard <mjw@fedoraproject.org> - 3.21.0-0.1.RC2
- Upstream 3.21.0-RC2
* Fri Apr 21 2023 Mark Wielaard <mjw@fedoraproject.org> - 3.21.0-0.1.RC1
- Upstream 3.21.0-RC1
- Remove upstreamed valgrind-faultstatus-implicit-int.patch
- Adjust valgrind-3.16.0-some-{Wl-z-now,stack-protector}.patch
cg_merge is now a pything script.
* Fri Nov 18 2022 Florian Weimer <fweimer@redhat.com> - 1:3.20.0-2
- Avoid using implicit int C89 feature
* Mon Oct 24 2022 Mark Wielaard <mjw@fedoraproject.org> - 3.20.0-1
- Upgrade to valgrind 3.20.0. Drop old patches.
* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.19.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Wed May 25 2022 Mark Wielaard <mjw@fedoraproject.org> - 3.19.0-3
- Add valgrind-3.19.0-s390x-memmem.patch
* Fri May 13 2022 Mark Wielaard <mjw@fedoraproject.org> - 3.19.0-2
- Add valgrind-3.19.0-ld-so-strncmp.patch
* Tue Apr 12 2022 Mark Wielaard <mjw@fedoraproject.org> - 3.19.0-1
- Upgrade to valgrind 3.19.0. Drop old patches.
* Tue Feb 8 2022 Mark Wielaard <mjw@fedoraproject.org>
- Add valgrind-3.18.1-ppc64-cmov.patch
- Add valgrind-3.18.1-arm64-atomics-rdm.patch
- Add valgrind-3.18.1-rust-demangle-suffix.patch
* Sat Jan 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.18.1-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Wed Jan 12 2022 Mark Wielaard <mjw@fedoraproject.org> - 3.18.1-8
- Add valgrind-3.18.1-ppc-hwcaps.patch
- Add valgrind-3.18.1-s390x-wflrx.patch
* Sat Dec 11 2021 Mark Wielaard <mjw@fedoraproject.org> - 3.18.1-7
-Add valgrind-3.18.1-s390x-vdso.patch
* Fri Dec 10 2021 Mark Wielaard <mjw@fedoraproject.org> - 3.18.1-6
- Add valgrind-3.18.1-rseq-enosys.patch
* Mon Nov 22 2021 Mark Wielaard <mjw@fedoraproject.org> - 3.18.1-5
- Add valgrind-3.18.1-demangle-namespace.patch
* Fri Nov 19 2021 Mark Wielaard <mjw@fedoraproject.org> - 3.18.1-4
- Add valgrind-3.18.1-condvar.patch
* Wed Nov 17 2021 Mark Wielaard <mjw@fedoraproject.org> - 3.18.1-3
- Add valgrind-3.18.1-ppc-pstq.patch
- Add valgrind-3.18.1-ppc-pstq-tests.patch
- Add valgrind-3.18.1-gdbserver_tests-hwcap.patch
- Add valgrind-3.18.1-rust-v0-demangle.patch
- Add valgrind-3.18.1-arm64-doubleword-cas.patch
- Add valgrind-3.18.1-arm64-ldaxp-stlxp.patch
- Add valgrind-3.18.1-arm64-atomic-align.patch
- Add valgrind-3.18.1-amd64-more-spec-rules.patch
* Mon Nov 1 2021 Mark Wielaard <mjw@fedoraproject.org> - 3.18.1-2
- Add valgrind-3.18.1-dhat-tests-copy.patch
- Add valgrind-3.18.1-s390x-EXRL.patch
- Add valgrind-3.18.1-ppc64-lxsibzx-lxsihzx.patch
* Fri Oct 15 2021 Mark Wielaard <mjw@fedoraproject.org> - 3.18.0-1
- Update to upstream 3.18.1 final
* Wed Oct 13 2021 Mark Wielaard <mjw@fedoraproject.org> - 3.18.0-0.1.RC1
- Update to upstream 3.18.0-RC1
- Drop all upstreamed patches
* Mon Sep 20 2021 Mark Wielaard <mjw@fedoraproject.org> - 3.17.0-13
- Add valgrind-3.17.0-dwarf-atomic_type.patch
- Add valgrind-3.17.0-faster-readdwarf3.patch
* Wed Sep 8 2021 Mark Wielaard <mjw@fedoraproject.org>
- Add valgrind-3.17.0-ppc64-test_isa_3_1_VRT.patch
* Wed Aug 25 2021 Mark Wielaard <mjw@fedoraproject.org> - 3.17.0-12
- Add valgrind-3.17.0-vgdb-queued-signals.patch
- Add valgrind-3.17.0-ppc64-test-isa-3-1.patch
- Add valgrind-3.17.0-ppc64-pstxvp.patch
* Fri Aug 6 2021 Mark Wielaard <mjw@fedoraproject.org> - 3.17.0-11
- Add valgrind-3.17.0-ppc64-statfs64.patch
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.17.0-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Wed Jul 21 2021 Mark Wielaard <mjw@fedoraproject.org>
- Add valgrind-3.17.0_start.patch
* Wed Jul 21 2021 Mark Wielaard <mjw@fedoraproject.org> - 3.17.0-9
- Add valgrind-3.17.0-clone3.patch
* Sat Jul 17 2021 Mark Wielaard <mjw@fedoraproject.org> - 3.17.0-8
- Update drd suppression for native ld.so names.
* Sat Jul 17 2021 Mark Wielaard <mjw@fedoraproject.org> - 3.17.0-7
- Add gdbserver_tests-update-filters-for-newer-glibc-gdb.patch
- Add helgrind-and-drd-suppression-libc-and-libpthread.patch
- Remove valgrind-3.9.0-helgrind-race-supp.patch
* Fri Jul 9 2021 Mark Wielaard <mjw@fedoraproject.org> - 3.17.0-6
- Update to include fixed CI gating tests.
* Fri Jun 18 2021 Mark Wielaard <mjw@fedoraproject.org> - 3.17.0-5
- Add valgrind-3.17.0-s390-prep.patch
- Add valgrind-3.17.0-s390-z15.patch
- Add valgrind-3.17.0-s390-z13-vec-fix.patch
* Thu Jun 3 2021 Mark Wielaard <mjw@fedoraproject.org> - 3.17.0-4
- Add valgrind-3.17.0-s390_insn_as_string.patch
- Add valgrind-3.17.0-debuginfod.patch
- Add valgrind-3.17.0-clone-parent-res.patch
* Tue May 4 2021 Mark Wielaard <mjw@fedoraproject.org> - 3.17.0-3
- Add valgrind-3.17.0-ppc64-isa-3.1{,tests}.patch
* Fri Apr 16 2021 Mark Wielaard <mjw@fedoraproject.org> - 3.17.0-2
- Add CI gating
* Mon Mar 22 2021 Mark Wielaard <mjw@fedoraproject.org> - 3.17.0-1
- Update to upstream 3.17.0 final.
* Wed Mar 17 2021 Mark Wielaard <mjw@fedoraproject.org> - 3.17.0-0.1.RC2
- Update to upstream 3.17.0-RC2
* Mon Mar 15 2021 Mark Wielaard <mjw@fedoraproject.org> - 3.17.0-0.1.RC1
- Update to upstream 3.17.0-RC1
- Drop all upstreamed patches
* Wed Mar 3 2021 Mark Wielaard <mjw@fedoraproject.org> - 3.16.1-20
- Add valgrind-3.16.1-arm64_sp_lr_fp_DwReg.patch
* Sun Feb 21 2021 Mark Wielaard <mjw@fedoraproject.org> - 3.16.1-19
- Add valgrind-3.16.1-readdwarf-line.patch
* Sat Feb 6 2021 Mark Wielaard <mjw@fedoraproject.org> - 3.16.1-18
- Update valgrind-3.16.1-open-proc-self-exe.patch to handle openat