Skip to content

Commit cf463dd

Browse files
committed
chore: merge debian packaging 3.25.1-3
1 parent f3f3acf commit cf463dd

14 files changed

Lines changed: 354 additions & 77 deletions

debian/README.Debian

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,6 @@ valgrind for Debian
88

99
-- Alessandro Ghedini <ghedo@debian.org> Sun, 05 Nov 2014 00:00:00 +0100
1010

11-
Debian's valgrind package comes stripped of any debug symbols, which are
12-
provided by the valgrind-dbg package. Note that it's recommended to install
13-
such package because without those symbols valgrind may generate less
14-
helpful error messages in certain situations, or not work at all.
15-
16-
-- Alessandro Ghedini <ghedo@debian.org> Sun, 09 Mar 2014 00:00:00 +0100
17-
1811
Debian's valgrind package ships with a suppression file named "debian.supp"
1912
along with upstream's "default.supp", under /usr/lib/valgrind. Note though
2013
that by default, valgrind only loads "default.supp".

debian/changelog

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
valgrind (1:3.25.1-3-codspeed1) UNRELEASED; urgency=medium
2+
3+
* Merge 3.25.1 from valgrind upstream and debian patches
4+
5+
-- Arthur Pastel <arthur@codspeed.io> Tue, 18 Oct 2025 20:37:13 +0000
6+
17
valgrind (1:3.24.0-0codspeed1) UNRELEASED; urgency=medium
28

39
* Merge 3.24.0 from valgrind upstream and ubuntu patches
@@ -2822,4 +2828,3 @@ valgrind (0.0.20020224-1) unstable; urgency=low
28222828
* Initial Release (closes: #135718)
28232829

28242830
-- Cyrille Chepelov <cyrille@chepelov.org> Mon, 25 Feb 2002 20:16:46 +0100
2825-

debian/control

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
Source: valgrind
22
Section: devel
33
Priority: optional
4-
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
5-
XSBC-Original-Maintainer: Alessandro Ghedini <ghedo@debian.org>
6-
Build-Depends: debhelper-compat (= 12),
4+
Maintainer: Alessandro Ghedini <ghedo@debian.org>
5+
Uploaders: Adam Borowski <kilobyte@angband.pl>, Michael Stapelberg <stapelberg@debian.org>
6+
Build-Depends: debhelper-compat (= 13),
77
gdb,
88
gcc-multilib [amd64],
99
libc6-dev-i386 [amd64],
@@ -13,16 +13,16 @@ Build-Depends: debhelper-compat (= 12),
1313
docbook-xsl,
1414
docbook-xml,
1515
xsltproc
16-
Standards-Version: 4.6.1
16+
Standards-Version: 4.7.0
1717
Vcs-Git: https://salsa.debian.org/debian/valgrind.git
1818
Vcs-Browser: https://salsa.debian.org/debian/valgrind
1919
Homepage: https://www.valgrind.org/
2020

2121
Package: valgrind
22-
Architecture: amd64 arm64 armhf i386 mips mipsel mips64 mips64el powerpc ppc64 ppc64el s390x
22+
Architecture: amd64 arm64 armhf i386 mips mipsel mips64 mips64el powerpc ppc64 ppc64el riscv64 s390x
2323
Depends: ${misc:Depends}, ${shlibs:Depends}, libc6-dbg
24-
Suggests: valgrind-dbg, valgrind-mpi, kcachegrind, alleyoop, valkyrie (>> 1.3.0)
25-
Recommends: gdb
24+
Suggests: valgrind-mpi, kcachegrind
25+
Recommends: gdb, python3
2626
Breaks: valgrind-dev
2727
Replaces: valgrind-dev
2828
Description: instrumentation framework for building dynamic analysis tools
@@ -44,7 +44,7 @@ Description: instrumentation framework for building dynamic analysis tools
4444
* a SimPoint basic block vector generator (BBV)
4545

4646
Package: valgrind-mpi
47-
Architecture: amd64 arm64 armhf i386 mips mipsel mips64 mips64el powerpc ppc64 ppc64el s390x
47+
Architecture: amd64 arm64 armhf i386 mips mipsel mips64 mips64el powerpc ppc64 ppc64el riscv64 s390x
4848
Depends: ${misc:Depends}, ${shlibs:Depends}, valgrind (= ${binary:Version})
4949
Recommends: gdb
5050
Description: instrumentation framework for building dynamic analysis tools (MPI module)

debian/copyright

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ Files: cachegrind/*
8282
Copyright: 2002-2012, Nicholas Nethercote
8383
License: GPL-2.0+
8484

85+
Files: cachegrind/cg_merge.c
86+
Copyright: 2000 Daniel Nagy, Budapest University of Technology and Economics
87+
2002-2012 Nicholas Nethercote
88+
License: GPL-2.0+
89+
8590
Files: coregrind/*
8691
Copyright: 2000-2012, Julian Seward
8792
License: GPL-2.0+
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Description: Fix FTBFS on armhf
2+
Origin: vendor
3+
Author: Michael Stapelberg <stapelberg@debian.org>
4+
5+
diff --git i/configure.ac w/configure.ac
6+
index 095659ac..aab98ce3 100755
7+
--- i/configure.ac
8+
+++ w/configure.ac
9+
@@ -287,7 +287,7 @@ case "${host_cpu}" in
10+
11+
arm*)
12+
AC_MSG_RESULT([ok (${host_cpu})])
13+
- VGCONF_PLATFORM_ARM_ARCH="-march=armv6"
14+
+ VGCONF_PLATFORM_ARM_ARCH="-marm"
15+
ARCH_MAX="arm"
16+
;;
17+
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
From 37d454721a6e3c2c54303bbcb35f0124de9bb51e Mon Sep 17 00:00:00 2001
2+
From: Mark Wielaard <mark@klomp.org>
3+
Date: Mon, 18 Aug 2025 15:30:47 +0200
4+
Subject: [PATCH] Add ppc64le linux hardwire for ld64.so.2 strcmp
5+
6+
When dlopen is used we might end up in an assembly powerpc/strcmp.S
7+
variant that is optimized in a way memcheck cannot proof correct. We
8+
try to intercept strcmp in ld.so, but might fail when strcmp is called
9+
before our interception code is loaded. Having an hardwire for ld.so
10+
strcmp (earlier intercept) would solve this.
11+
12+
https://bugs.kde.org/show_bug.cgi?id=508145
13+
14+
(cherry picked from commit 78fe3625f6b8ed4de28527d71c4a98d70e5b3035)
15+
---
16+
NEWS | 1 +
17+
coregrind/m_redir.c | 6 +++++
18+
coregrind/m_trampoline.S | 45 +++++++++++++++++++++++++++++++++
19+
coregrind/pub_core_trampoline.h | 1 +
20+
4 files changed, 53 insertions(+)
21+
22+
diff --git a/coregrind/m_redir.c b/coregrind/m_redir.c
23+
index 63172b971..857f910cb 100644
24+
--- a/coregrind/m_redir.c
25+
+++ b/coregrind/m_redir.c
26+
@@ -1504,14 +1504,20 @@ void VG_(redir_initialise) ( void )
27+
28+
add_hardwired_spec(
29+
"ld64.so.2", "index",
30+
(Addr)&VG_(ppc64_linux_REDIR_FOR_strchr),
31+
NULL /* not mandatory - so why bother at all? */
32+
/* glibc-2.5 (FC6, ppc64) seems fine without it */
33+
);
34+
+
35+
+ add_hardwired_spec(
36+
+ "ld64.so.2", "strcmp",
37+
+ (Addr)&VG_(ppc64_linux_REDIR_FOR_strcmp),
38+
+ NULL
39+
+ );
40+
}
41+
42+
# elif defined(VGP_arm_linux)
43+
/* If we're using memcheck, use these intercepts right from the
44+
start, otherwise ld.so makes a lot of noise. In most ARM-linux
45+
distros, ld.so's soname is ld-linux.so.3, but Ubuntu 14.04 on
46+
Odroid uses ld-linux-armhf.so.3 for some reason. */
47+
diff --git a/coregrind/m_trampoline.S b/coregrind/m_trampoline.S
48+
index 2c2cc0dc2..af25c8f7a 100644
49+
--- a/coregrind/m_trampoline.S
50+
+++ b/coregrind/m_trampoline.S
51+
@@ -600,14 +600,59 @@ VG_(ppc64_linux_REDIR_FOR_strchr):
52+
li 3,0
53+
blr
54+
.long 0
55+
.byte 0,0,0,0,0,0,0,0
56+
.L1end:
57+
58+
59+
+ /* this function is written using the "dotless" ABI convention */
60+
+ .align 2
61+
+ .globl VG_(ppc64_linux_REDIR_FOR_strcmp)
62+
+#if !defined VGP_ppc64be_linux || _CALL_ELF == 2
63+
+ /* Little Endian uses ELF version 2 */
64+
+ .type VG_(ppc64_linux_REDIR_FOR_strcmp),@function
65+
+VG_(ppc64_linux_REDIR_FOR_strcmp):
66+
+#else
67+
+ /* Big Endian uses ELF version 1 */
68+
+ .section ".opd","aw"
69+
+ .align 3
70+
+VG_(ppc64_linux_REDIR_FOR_strcmp):
71+
+ .quad .L.VG_(ppc64_linux_REDIR_FOR_strcmp),.TOC.@tocbase,0
72+
+ .previous
73+
+ .size VG_(ppc64_linux_REDIR_FOR_strcmp), \
74+
+ .LFE0-.L.VG_(ppc64_linux_REDIR_FOR_strcmp)
75+
+ .type VG_(ppc64_linux_REDIR_FOR_strcmp), @function
76+
+
77+
+.L.VG_(ppc64_linux_REDIR_FOR_strcmp):
78+
+#endif
79+
+#if _CALL_ELF == 2
80+
+0: addis 2,12,.TOC.-0b@ha
81+
+ addi 2,2,.TOC.-0b@l
82+
+ .localentry VG_(ppc64_linux_REDIR_FOR_strcmp), .-VG_(ppc64_linux_REDIR_FOR_strcmp)
83+
+#endif
84+
+.LFB0:
85+
+ .cfi_startproc
86+
+ li 10,0
87+
+.L3:
88+
+ lbzx 8,3,10
89+
+ lbzx 9,4,10
90+
+ cmpwi 0,8,0
91+
+ beq 0,.L2
92+
+ cmpw 0,8,9
93+
+ addi 10,10,1
94+
+ beq 0,.L3
95+
+.L2:
96+
+ subf 3,9,8
97+
+ extsw 3,3
98+
+ blr
99+
+ .long 0
100+
+ .byte 0,0,0,0,0,0,0,0
101+
+ .cfi_endproc
102+
+.LFE0:
103+
+
104+
.global VG_(trampoline_stuff_end)
105+
VG_(trampoline_stuff_end):
106+
107+
/* and a trailing page of unexecutable code */
108+
UD2_PAGE
109+
110+
# undef UD2_16
111+
diff --git a/coregrind/pub_core_trampoline.h b/coregrind/pub_core_trampoline.h
112+
index 11d791df7..92b4fc67b 100644
113+
--- a/coregrind/pub_core_trampoline.h
114+
+++ b/coregrind/pub_core_trampoline.h
115+
@@ -93,14 +93,15 @@ extern UInt VG_(ppc32_linux_REDIR_FOR_strlen)( void* );
116+
extern UInt VG_(ppc32_linux_REDIR_FOR_strcmp)( void*, void* );
117+
extern void* VG_(ppc32_linux_REDIR_FOR_strchr)( void*, Int );
118+
#endif
119+
120+
#if defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)
121+
extern Addr VG_(ppc64_linux_SUBST_FOR_rt_sigreturn);
122+
extern UInt VG_(ppc64_linux_REDIR_FOR_strlen)( void* );
123+
+extern UInt VG_(ppc64_linux_REDIR_FOR_strcmp)( void*, void* );
124+
extern void* VG_(ppc64_linux_REDIR_FOR_strchr)( void*, Int );
125+
/* A label (sans dot) marking the ultra-magical return stub via which
126+
all redirected and wrapped functions are made to "return" on
127+
ppc64-linux. The one insn at this label is never really
128+
translated. Instead, m_translate generates IR to restore the
129+
thread's LR and R2 registers from a small stack in the ppc64 guest
130+
state structure, and then branch to LR. Convoluted? Confusing?
131+
--
132+
2.51.0
133+

debian/patches/adjust_armhf_cases.patch

Lines changed: 0 additions & 32 deletions
This file was deleted.

debian/patches/armhf_neon.patch

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Description: Do not require neon on armhf
2+
Author: Richard Earnshaw <Richard.Earnshaw@arm.com>
3+
Bug-Debian: https://bugs.debian.org/928224
4+
Reviewed-By: Mathieu Malaterre <malat@debian.org>
5+
Last-Update: 2025-01-21
6+
7+
--- valgrind-3.24.0.orig/configure.ac
8+
+++ valgrind-3.24.0/configure.ac
9+
@@ -275,13 +275,13 @@ case "${host_cpu}" in
10+
11+
armv8*)
12+
AC_MSG_RESULT([ok (${host_cpu})])
13+
- VGCONF_PLATFORM_ARM_ARCH="-marm -mcpu=cortex-a8"
14+
+ VGCONF_PLATFORM_ARM_ARCH="-marm -mcpu=generic-armv7-a"
15+
ARCH_MAX="arm"
16+
;;
17+
18+
armv7*)
19+
AC_MSG_RESULT([ok (${host_cpu})])
20+
- VGCONF_PLATFORM_ARM_ARCH="-marm -mcpu=cortex-a8"
21+
+ VGCONF_PLATFORM_ARM_ARCH="-marm -mcpu=generic-armv7-a"
22+
ARCH_MAX="arm"
23+
;;
24+

debian/patches/series

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
08_fix-spelling-in-manpage.patch
44
10_mpi-pkg-config.patch
55
13_fix-path-to-vgdb.patch
6-
armv7-illegal-opcode.patch
7-
adjust_armhf_cases.patch
6+
14_fix-armhf-ftbfs.patch
7+
armhf_neon.patch
8+
16_Add-ppc64le-linux-hardwire-for-ld64.so.2-strcmp.patch
89
use-mpich-if-mpic-not-found.patch

debian/rules

100644100755
Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
#!/usr/bin/make -f
22

3-
# LTO triggers undefined symbols in valgrind. Valgrind has a --enable-lto
4-
# configure time option, but that doesn't seem to help.
5-
# Disable LTO for now.
6-
73
# valgrind uses -fno-stack-protector
8-
export DEB_BUILD_MAINT_OPTIONS := hardening=-stackprotector,-stackprotectorstrong optimize=-lto
4+
export DEB_BUILD_MAINT_OPTIONS := hardening=-stackprotector,-stackprotectorstrong
95

106
include /usr/share/dpkg/architecture.mk
117

@@ -14,25 +10,11 @@ CFLAGS += $(shell dpkg-buildflags --get CPPFLAGS)
1410
CFLAGS += "-I/usr/include/$(DEB_HOST_MULTIARCH)" # fixes #676029
1511
LDFLAGS = $(shell dpkg-buildflags --get LDFLAGS)
1612

17-
ifeq ($(DEB_HOST_ARCH_CPU),arm)
18-
DH_STRIP_OPTS := -X vgpreload
19-
else
20-
DH_STRIP_OPTS :=
21-
endif
22-
23-
CONFARGS = \
24-
--enable-tls \
25-
--with-gdbscripts-dir=/usr/share/gdb/auto-load
26-
27-
ifeq ($(DEB_HOST_ARCH_CPU),arm64)
28-
CONFARGS += --enable-only64bit
29-
endif
30-
3113
%:
3214
dh $@
3315

3416
override_dh_auto_configure:
35-
dh_auto_configure -- $(CONFARGS) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
17+
dh_auto_configure -- --enable-tls CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
3618

3719
override_dh_auto_test:
3820
: # do nothing for now
@@ -47,7 +29,10 @@ override_dh_shlibdeps:
4729
dh_shlibdeps -Xdebian/valgrind/usr/libexec/valgrind/getoff-x86-linux # fixes #762386
4830

4931
override_dh_strip:
50-
dh_strip --dbgsym-migration='valgrind-dbg (<< 1:3.19.0-2~)' $(DH_STRIP_OPTS)
32+
# Do not strip vgpreload* files as per upstream instructions
33+
# (their symbols show up in the valgrind memory checker output):
34+
# https://valgrind.org/docs/manual/dist.readme-packagers.html
35+
dh_strip --dbgsym-migration='valgrind-dbg (<< 1:3.19.0-2~)' -Xvgpreload
5136

5237
override_dh_dwz:
5338
: # do nothing for now
@@ -59,12 +44,12 @@ override_dh_install:
5944
# valgrind script
6045
mv -f $(target)/usr/bin/valgrind $(target)/usr/bin/valgrind.bin
6146
mv -f ${target}/usr/bin/valgrind.sh $(target)/usr/bin/valgrind
47+
ifeq ($(DEB_HOST_ARCH),armhf)
48+
cat debian/supp/armhf-stackclash.supp >> $(target)/usr/libexec/valgrind/default.supp
49+
endif
6250

63-
#override_dh_fixperms:
64-
# dh_fixperms -X.css -X.html -X.js -X.so -X.supp -X.xml
51+
override_dh_fixperms:
52+
dh_fixperms -X.css -X.html -X.js -X.so -X.supp -X.xml
6553

6654
override_dh_installchangelogs:
6755
dh_installchangelogs NEWS
68-
69-
override_dh_missing:
70-
dh_missing --fail-missing

0 commit comments

Comments
 (0)