diff --git a/extra/valgrind/.SRCINFO b/extra/valgrind/.SRCINFO index 52ef52dba..65bb32308 100644 --- a/extra/valgrind/.SRCINFO +++ b/extra/valgrind/.SRCINFO @@ -1,10 +1,10 @@ pkgbase = valgrind pkgdesc = Tool to help find memory-management problems in programs pkgver = 3.22.0 - pkgrel = 2 + pkgrel = 3 url = https://valgrind.org/ arch = x86_64 - license = GPL + license = GPL-2.0-or-later checkdepends = procps-ng makedepends = gdb makedepends = lib32-glibc @@ -16,19 +16,26 @@ pkgbase = valgrind depends = perl depends = debuginfod optdepends = lib32-glibc: 32-bit ABI support + optdepends = python: cg_* scripts provides = valgrind-multilib replaces = valgrind-multilib options = !lto source = https://sourceware.org/pub/valgrind/valgrind-3.22.0.tar.bz2 source = https://sourceware.org/pub/valgrind/valgrind-3.22.0.tar.bz2.asc source = valgrind-3.7.0-respect-flags.patch + source = valgrind_3_22_0_s390x-linux_memfd_secret.patch + source = valgrind_3_22_0_fchmodat2_syscall.patch validpgpkeys = 0E9FFD0C16A1856CF9C7C690BA0166E698FA6035 validpgpkeys = EC3CFE88F6CA0788774F5C1D1AA44BE649DE760A sha512sums = 2904c13f68245bbafcea70998c6bd20725271300a7e94b6751ca00916943595fc3fac8557da7ea8db31b54a43f092823a0a947bc142829da811d074e1fe49777 sha512sums = SKIP sha512sums = e0cec39381cefeca09ae4794cca309dfac7c8693e6315e137e64f5c33684598726d41cfbb4edf764fe985503b13ff596184ca5fc32b159d500ec092e4cf8838c + sha512sums = 6393ddf84eec93cc9b3e20f9c43a8f3ef37436980c9d91350ebd27d5c41057fe982308ba5d194feddaea4a75a4a9ef14fb404388cc9f4628edbe9ef58787afba + sha512sums = 1e22b75b95252583774916dab9dcbc8663495107e15dd1ddf397744b288265fcffd1f456d306bc610989a1f650ae66a8ebeb84d253be312db2ab9fdc9fe1407f b2sums = 80024371b3e70521996077fba24e233097a6190477ced1b311cd41fead687dcc2511ac0ef723792488f4af08867dff3e1f474816fda09c1604b89059e31c2514 b2sums = SKIP b2sums = af556fdf3c02e37892bfe9afebc954cf2f1b2fa9b75c1caacfa9f3b456ebc02bf078475f9ee30079b3af5d150d41415a947c3d04235c1ea8412cf92b959c484a + b2sums = 5af1f467c8d22334e14e6c2878120550ce5f1e36b61f8180601b8673493a85cca8a0c3a804c281ab51fb04fe5e3706edeb897bbd5486f87d9143f472cd4c46b5 + b2sums = 305234e118eeb389c95ca8afa45239b0386199dee6f5058a3ddca06a91b2069e1b9831ac5e31badf6d8bd0d43eef3f260d95b976a509d73284149a64d9ea0563 pkgname = valgrind diff --git a/extra/valgrind/PKGBUILD b/extra/valgrind/PKGBUILD index 8c95fa021..1380caebc 100644 --- a/extra/valgrind/PKGBUILD +++ b/extra/valgrind/PKGBUILD @@ -9,9 +9,8 @@ # whenever the tests shall run # # For a fresh build: -# $repo-x86_64-build -- -I ../../glibc/trunk/glibc-debug*.pkg.tar.zst -# $repo-x86_64-build -# ${repo}pkg +# pkgctl build -I ../../glibc/trunk/glibc-debug*.pkg.tar.zst +# pkgctl build # ALARM: Kevin Mihelich # - hold for toolchain update @@ -22,20 +21,27 @@ noautobuild=1 pkgname=valgrind pkgver=3.22.0 -pkgrel=2 +pkgrel=3 pkgdesc='Tool to help find memory-management problems in programs' arch=('x86_64') -license=('GPL') +license=('GPL-2.0-or-later') url='https://valgrind.org/' depends=('glibc' 'perl' 'debuginfod') makedepends=('gdb' 'docbook-xml' 'docbook-xsl' 'docbook-sgml') checkdepends=('procps-ng') +optdepends=( + 'python: cg_* scripts' +) provides=('valgrind-multilib') replaces=('valgrind-multilib') options=('!emptydirs' '!strip') source=(https://sourceware.org/pub/valgrind/valgrind-${pkgver}.tar.bz2{,.asc} valgrind-3.7.0-respect-flags.patch + # https://sourceware.org/git/?p=valgrind.git;a=commit;h=372d09fd9a8d76847c81092ebff71c80fd6c145d + # dropped changes to NEWS as that did not apply + valgrind_3_22_0_s390x-linux_memfd_secret.patch + valgrind_3_22_0_fchmodat2_syscall.patch valgrind-3.13.0-arm64-hwcap.patch) validpgpkeys=( 0E9FFD0C16A1856CF9C7C690BA0166E698FA6035 # Julian Seward @@ -44,10 +50,14 @@ validpgpkeys=( sha512sums=('2904c13f68245bbafcea70998c6bd20725271300a7e94b6751ca00916943595fc3fac8557da7ea8db31b54a43f092823a0a947bc142829da811d074e1fe49777' 'SKIP' 'e0cec39381cefeca09ae4794cca309dfac7c8693e6315e137e64f5c33684598726d41cfbb4edf764fe985503b13ff596184ca5fc32b159d500ec092e4cf8838c' + '6393ddf84eec93cc9b3e20f9c43a8f3ef37436980c9d91350ebd27d5c41057fe982308ba5d194feddaea4a75a4a9ef14fb404388cc9f4628edbe9ef58787afba' + '1e22b75b95252583774916dab9dcbc8663495107e15dd1ddf397744b288265fcffd1f456d306bc610989a1f650ae66a8ebeb84d253be312db2ab9fdc9fe1407f' '5af853399c6abdf8016fd1c2be854b3952b7d7e9ca16c870f84eed72e606e639d5f64de32e60105899f5201b53156380ae460111e05209e843301492742c9bfd') b2sums=('80024371b3e70521996077fba24e233097a6190477ced1b311cd41fead687dcc2511ac0ef723792488f4af08867dff3e1f474816fda09c1604b89059e31c2514' 'SKIP' 'af556fdf3c02e37892bfe9afebc954cf2f1b2fa9b75c1caacfa9f3b456ebc02bf078475f9ee30079b3af5d150d41415a947c3d04235c1ea8412cf92b959c484a' + '5af1f467c8d22334e14e6c2878120550ce5f1e36b61f8180601b8673493a85cca8a0c3a804c281ab51fb04fe5e3706edeb897bbd5486f87d9143f472cd4c46b5' + '305234e118eeb389c95ca8afa45239b0386199dee6f5058a3ddca06a91b2069e1b9831ac5e31badf6d8bd0d43eef3f260d95b976a509d73284149a64d9ea0563' 'ff8cf51a6034c13ffbc412c387e83a32fa59f96e01be8faf6b52aa6d55bd5e5836c16d75f2291d87450709d0c75689b21870514006c603c6419940a9b977e609') options=(!lto) # https://bugs.kde.org/show_bug.cgi?id=338252 @@ -57,22 +67,23 @@ prepare() { patch -Np1 < ../valgrind-3.13.0-arm64-hwcap.patch sed -i 's|sgml/docbook/xsl-stylesheets|xml/docbook/xsl-stylesheets-1.79.2-nons|' docs/Makefile.am + # can be dropped with the next release, see + # https://gitlab.archlinux.org/archlinux/packaging/packages/valgrind/-/issues/2 + patch -Np1 < ../valgrind_3_22_0_s390x-linux_memfd_secret.patch + patch -Np1 < ../valgrind_3_22_0_fchmodat2_syscall.patch + autoreconf -ifv } build() { - # valgrind does not like some of our flags - CPPFLAGS=${CPPFLAGS/-D_FORTIFY_SOURCE=2/} - CFLAGS=${CFLAGS/-fstack-protector-strong -fno-plt/} - CXXFLAGS=${CXXFLAGS/-fstack-protector-strong -fno-plt/} - cd valgrind-${pkgver} ./configure \ --prefix=/usr \ --sysconfdir=/etc \ --localstatedir=/var \ --libexecdir=/usr/lib \ - --mandir=/usr/share/man + --mandir=/usr/share/man \ + --enable-lto=no make make -C docs man-pages } diff --git a/extra/valgrind/valgrind_3_22_0_fchmodat2_syscall.patch b/extra/valgrind/valgrind_3_22_0_fchmodat2_syscall.patch new file mode 100644 index 000000000..e2e99d64a --- /dev/null +++ b/extra/valgrind/valgrind_3_22_0_fchmodat2_syscall.patch @@ -0,0 +1,204 @@ +From 372d09fd9a8d76847c81092ebff71c80fd6c145d Mon Sep 17 00:00:00 2001 +From: Mark Wielaard +Date: Sat, 18 Nov 2023 21:17:02 +0100 +Subject: [PATCH 1/1] Add fchmodat2 syscall on linux + +fchmodat2 is a new syscall on linux 6.6. It is a variant of fchmodat +that takes an extra flags argument. + +https://bugs.kde.org/show_bug.cgi?id=477198 +--- + NEWS | 1 + + coregrind/m_syswrap/priv_syswrap-linux.h | 3 +++ + coregrind/m_syswrap/syswrap-amd64-linux.c | 2 ++ + coregrind/m_syswrap/syswrap-arm-linux.c | 2 ++ + coregrind/m_syswrap/syswrap-arm64-linux.c | 2 ++ + coregrind/m_syswrap/syswrap-linux.c | 11 +++++++++++ + coregrind/m_syswrap/syswrap-mips32-linux.c | 2 ++ + coregrind/m_syswrap/syswrap-mips64-linux.c | 1 + + coregrind/m_syswrap/syswrap-nanomips-linux.c | 1 + + coregrind/m_syswrap/syswrap-ppc32-linux.c | 2 ++ + coregrind/m_syswrap/syswrap-ppc64-linux.c | 2 ++ + coregrind/m_syswrap/syswrap-s390x-linux.c | 2 ++ + coregrind/m_syswrap/syswrap-x86-linux.c | 2 ++ + include/vki/vki-scnums-shared-linux.h | 2 ++ + 14 files changed, 35 insertions(+) + +diff --git a/coregrind/m_syswrap/priv_syswrap-linux.h b/coregrind/m_syswrap/priv_syswrap-linux.h +index f13726bc0d..d50cdcc981 100644 +--- a/coregrind/m_syswrap/priv_syswrap-linux.h ++++ b/coregrind/m_syswrap/priv_syswrap-linux.h +@@ -334,6 +334,9 @@ DECL_TEMPLATE(linux, sys_memfd_secret); + // Linux-specific (since Linux 5.6) + DECL_TEMPLATE(linux, sys_pidfd_getfd); + ++// Since Linux 6.6 ++DECL_TEMPLATE(linux, sys_fchmodat2); ++ + /* --------------------------------------------------------------------- + Wrappers for sockets and ipc-ery. These are split into standalone + procedures because x86-linux hides them inside multiplexors +diff --git a/coregrind/m_syswrap/syswrap-amd64-linux.c b/coregrind/m_syswrap/syswrap-amd64-linux.c +index 8de4371e20..d93d937211 100644 +--- a/coregrind/m_syswrap/syswrap-amd64-linux.c ++++ b/coregrind/m_syswrap/syswrap-amd64-linux.c +@@ -886,6 +886,8 @@ static SyscallTableEntry syscall_table[] = { + LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), // 441 + + LINXY(__NR_memfd_secret, sys_memfd_secret), // 447 ++ ++ LINX_(__NR_fchmodat2, sys_fchmodat2), // 452 + }; + + SyscallTableEntry* ML_(get_linux_syscall_entry) ( UInt sysno ) +diff --git a/coregrind/m_syswrap/syswrap-arm-linux.c b/coregrind/m_syswrap/syswrap-arm-linux.c +index 5a16ca124e..21fc066d6d 100644 +--- a/coregrind/m_syswrap/syswrap-arm-linux.c ++++ b/coregrind/m_syswrap/syswrap-arm-linux.c +@@ -1060,6 +1060,8 @@ static SyscallTableEntry syscall_main_table[] = { + LINX_(__NR_faccessat2, sys_faccessat2), // 439 + + LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), // 441 ++ ++ LINX_(__NR_fchmodat2, sys_fchmodat2), // 452 + }; + + +diff --git a/coregrind/m_syswrap/syswrap-arm64-linux.c b/coregrind/m_syswrap/syswrap-arm64-linux.c +index f80890bd0c..5a24dcaf39 100644 +--- a/coregrind/m_syswrap/syswrap-arm64-linux.c ++++ b/coregrind/m_syswrap/syswrap-arm64-linux.c +@@ -841,6 +841,8 @@ static SyscallTableEntry syscall_main_table[] = { + LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), // 441 + + LINXY(__NR_memfd_secret, sys_memfd_secret), // 447 ++ ++ LINX_(__NR_fchmodat2, sys_fchmodat2), // 452 + }; + + +diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c +index 0cc6221976..01bbba0a6d 100644 +--- a/coregrind/m_syswrap/syswrap-linux.c ++++ b/coregrind/m_syswrap/syswrap-linux.c +@@ -6077,6 +6077,17 @@ PRE(sys_fchmodat) + PRE_MEM_RASCIIZ( "fchmodat(path)", ARG2 ); + } + ++PRE(sys_fchmodat2) ++{ ++ PRINT("sys_fchmodat2 ( %ld, %#" FMT_REGWORD "x(%s), %" FMT_REGWORD "u, %" ++ FMT_REGWORD "u )", ++ SARG1, ARG2, (HChar*)(Addr)ARG2, ARG3, ARG4); ++ PRE_REG_READ4(long, "fchmodat2", ++ int, dfd, const char *, path, vki_mode_t, mode, ++ unsigned int, flags); ++ PRE_MEM_RASCIIZ( "fchmodat2(pathname)", ARG2 ); ++} ++ + PRE(sys_faccessat) + { + PRINT("sys_faccessat ( %ld, %#" FMT_REGWORD "x(%s), %ld )", +diff --git a/coregrind/m_syswrap/syswrap-mips32-linux.c b/coregrind/m_syswrap/syswrap-mips32-linux.c +index e90809602c..ba0a453879 100644 +--- a/coregrind/m_syswrap/syswrap-mips32-linux.c ++++ b/coregrind/m_syswrap/syswrap-mips32-linux.c +@@ -1145,6 +1145,8 @@ static SyscallTableEntry syscall_main_table[] = { + LINX_ (__NR_faccessat2, sys_faccessat2), // 439 + + LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), // 441 ++ ++ LINX_(__NR_fchmodat2, sys_fchmodat2), // 452 + }; + + SyscallTableEntry* ML_(get_linux_syscall_entry) (UInt sysno) +diff --git a/coregrind/m_syswrap/syswrap-mips64-linux.c b/coregrind/m_syswrap/syswrap-mips64-linux.c +index 1452e6b74f..ead350719d 100644 +--- a/coregrind/m_syswrap/syswrap-mips64-linux.c ++++ b/coregrind/m_syswrap/syswrap-mips64-linux.c +@@ -823,6 +823,7 @@ static SyscallTableEntry syscall_main_table[] = { + LINXY (__NR_pidfd_getfd, sys_pidfd_getfd), + LINX_ (__NR_faccessat2, sys_faccessat2), + LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), ++ LINX_ (__NR_fchmodat2, sys_fchmodat2), + }; + + SyscallTableEntry * ML_(get_linux_syscall_entry) ( UInt sysno ) +diff --git a/coregrind/m_syswrap/syswrap-nanomips-linux.c b/coregrind/m_syswrap/syswrap-nanomips-linux.c +index fad05702d2..b7eaa24ebc 100644 +--- a/coregrind/m_syswrap/syswrap-nanomips-linux.c ++++ b/coregrind/m_syswrap/syswrap-nanomips-linux.c +@@ -831,6 +831,7 @@ static SyscallTableEntry syscall_main_table[] = { + LINXY(__NR_pidfd_getfd, sys_pidfd_getfd), + LINX_ (__NR_faccessat2, sys_faccessat2), + LINXY (__NR_epoll_pwait2, sys_epoll_pwait2), ++ LINX_ (__NR_fchmodat2, sys_fchmodat2), + }; + + SyscallTableEntry* ML_(get_linux_syscall_entry) (UInt sysno) +diff --git a/coregrind/m_syswrap/syswrap-ppc32-linux.c b/coregrind/m_syswrap/syswrap-ppc32-linux.c +index 53722fbf7f..7cb0221314 100644 +--- a/coregrind/m_syswrap/syswrap-ppc32-linux.c ++++ b/coregrind/m_syswrap/syswrap-ppc32-linux.c +@@ -1067,6 +1067,8 @@ static SyscallTableEntry syscall_table[] = { + LINX_(__NR_faccessat2, sys_faccessat2), // 439 + + LINXY (__NR_epoll_pwait2, sys_epoll_pwait2), // 441 ++ ++ LINX_ (__NR_fchmodat2, sys_fchmodat2), // 452 + }; + + SyscallTableEntry* ML_(get_linux_syscall_entry) ( UInt sysno ) +diff --git a/coregrind/m_syswrap/syswrap-ppc64-linux.c b/coregrind/m_syswrap/syswrap-ppc64-linux.c +index 6a99673251..bd7fbb2c5a 100644 +--- a/coregrind/m_syswrap/syswrap-ppc64-linux.c ++++ b/coregrind/m_syswrap/syswrap-ppc64-linux.c +@@ -1033,6 +1033,8 @@ static SyscallTableEntry syscall_table[] = { + LINX_(__NR_faccessat2, sys_faccessat2), // 439 + + LINXY (__NR_epoll_pwait2, sys_epoll_pwait2), // 441 ++ ++ LINX_ (__NR_fchmodat2, sys_fchmodat2), // 452 + }; + + SyscallTableEntry* ML_(get_linux_syscall_entry) ( UInt sysno ) +diff --git a/coregrind/m_syswrap/syswrap-s390x-linux.c b/coregrind/m_syswrap/syswrap-s390x-linux.c +index 3238eef3ff..4f03f218eb 100644 +--- a/coregrind/m_syswrap/syswrap-s390x-linux.c ++++ b/coregrind/m_syswrap/syswrap-s390x-linux.c +@@ -876,6 +876,8 @@ static SyscallTableEntry syscall_table[] = { + LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), // 441 + + LINXY(__NR_memfd_secret, sys_memfd_secret), // 447 ++ ++ LINX_ (__NR_fchmodat2, sys_fchmodat2), // 452 + }; + + SyscallTableEntry* ML_(get_linux_syscall_entry) ( UInt sysno ) +diff --git a/coregrind/m_syswrap/syswrap-x86-linux.c b/coregrind/m_syswrap/syswrap-x86-linux.c +index c7eff0585c..f57b5395ca 100644 +--- a/coregrind/m_syswrap/syswrap-x86-linux.c ++++ b/coregrind/m_syswrap/syswrap-x86-linux.c +@@ -1657,6 +1657,8 @@ static SyscallTableEntry syscall_table[] = { + LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), // 441 + + LINXY(__NR_memfd_secret, sys_memfd_secret), // 447 ++ ++ LINX_(__NR_fchmodat2, sys_fchmodat2), // 452 + }; + + SyscallTableEntry* ML_(get_linux_syscall_entry) ( UInt sysno ) +diff --git a/include/vki/vki-scnums-shared-linux.h b/include/vki/vki-scnums-shared-linux.h +index 1bd4066703..068a2cd12b 100644 +--- a/include/vki/vki-scnums-shared-linux.h ++++ b/include/vki/vki-scnums-shared-linux.h +@@ -50,4 +50,6 @@ + + #define __NR_memfd_secret 447 + ++#define __NR_fchmodat2 452 ++ + #endif +-- +2.39.3 + diff --git a/extra/valgrind/valgrind_3_22_0_s390x-linux_memfd_secret.patch b/extra/valgrind/valgrind_3_22_0_s390x-linux_memfd_secret.patch new file mode 100644 index 000000000..b68fb00da --- /dev/null +++ b/extra/valgrind/valgrind_3_22_0_s390x-linux_memfd_secret.patch @@ -0,0 +1,25 @@ +From ca88e1c63178186a1f6a0d0b1a4ba4ee895af323 Mon Sep 17 00:00:00 2001 +From: Mark Wielaard +Date: Sat, 18 Nov 2023 02:23:10 +0100 +Subject: [PATCH] s390x-linux also has memfd_secret, syswrap it + +--- + coregrind/m_syswrap/syswrap-s390x-linux.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/coregrind/m_syswrap/syswrap-s390x-linux.c b/coregrind/m_syswrap/syswrap-s390x-linux.c +index 7740bd61f6..3238eef3ff 100644 +--- a/coregrind/m_syswrap/syswrap-s390x-linux.c ++++ b/coregrind/m_syswrap/syswrap-s390x-linux.c +@@ -874,6 +874,8 @@ static SyscallTableEntry syscall_table[] = { + LINX_(__NR_faccessat2, sys_faccessat2), // 439 + + LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), // 441 ++ ++ LINXY(__NR_memfd_secret, sys_memfd_secret), // 447 + }; + + SyscallTableEntry* ML_(get_linux_syscall_entry) ( UInt sysno ) +-- +2.39.3 +