1 ################################################################################
5 ################################################################################
7 VALGRIND_VERSION
= 3.11.0
8 VALGRIND_SITE
= http
://valgrind.org
/downloads
9 VALGRIND_SOURCE
= valgrind-
$(VALGRIND_VERSION
).
tar.bz2
10 VALGRIND_LICENSE
= GPLv2 GFDLv1.2
11 VALGRIND_LICENSE_FILES
= COPYING COPYING.DOCS
12 VALGRIND_CONF_OPTS
= --disable-ubsan
13 VALGRIND_INSTALL_STAGING
= YES
15 # patch 0004-Fixes-for-musl-libc.patch touching configure.ac
16 VALGRIND_AUTORECONF
= YES
18 # When Valgrind detects a 32-bit MIPS architecture, it forcibly adds
19 # -march=mips32 to CFLAGS; when it detects a 64-bit MIPS architecture,
20 # it forcibly adds -march=mips64. This causes Valgrind to be built
21 # always for the first ISA revision level (R1), even when the user has
22 # configured Buildroot for the second ISA revision level (R2).
24 # Override the CFLAGS variable (which Valgrind appends to its CFLAGS)
25 # and pass the right -march option, so they take precedence over
26 # Valgrind's wrongfully detected value.
27 ifeq ($(BR2_mips
)$(BR2_mipsel
)$(BR2_mips64
)$(BR2_mips64el
),y
)
28 VALGRIND_CONF_ENV
+= CFLAGS
="$(TARGET_CFLAGS) -march=$(BR2_GCC_TARGET_ARCH)"
31 # On ARM, Valgrind only supports ARMv7, and uses the arch part of the
32 # host tuple to determine whether it's being built for ARMv7 or
33 # not. Therefore, we adjust the host tuple to specify we're on
34 # ARMv7. The valgrind package is guaranteed, through Config.in, to
35 # only be selected on ARMv7-A platforms.
36 ifeq ($(BR2_ARM_CPU_ARMV7A
),y
)
37 VALGRIND_CONF_OPTS
+= \
38 --host
=$(patsubst arm-
%,armv7-
%,$(GNU_TARGET_NAME
))
41 define VALGRIND_INSTALL_UCLIBC_SUPP
42 $(INSTALL
) -D
-m
0644 package
/valgrind
/uclibc.supp
$(TARGET_DIR
)/usr
/lib
/valgrind
/uclibc.supp
45 VALGRIND_POST_INSTALL_TARGET_HOOKS
+= VALGRIND_INSTALL_UCLIBC_SUPP
47 ifeq ($(BR2_PACKAGE_VALGRIND_MEMCHECK
),)
48 define VALGRIND_REMOVE_MEMCHECK
49 rm -f
$(TARGET_DIR
)/usr
/lib
/valgrind
/*memcheck
*
52 VALGRIND_POST_INSTALL_TARGET_HOOKS
+= VALGRIND_REMOVE_MEMCHECK
55 ifeq ($(BR2_PACKAGE_VALGRIND_CACHEGRIND
),)
56 define VALGRIND_REMOVE_CACHEGRIND
57 rm -f
$(TARGET_DIR
)/usr
/lib
/valgrind
/*cachegrind
*
58 for i in cg_annotate cg_diff cg_merge
; do \
59 rm -f
$(TARGET_DIR
)/usr
/bin
/$$i ; \
63 VALGRIND_POST_INSTALL_TARGET_HOOKS
+= VALGRIND_REMOVE_CACHEGRIND
66 ifeq ($(BR2_PACKAGE_VALGRIND_CALLGRIND
),)
67 define VALGRIND_REMOVE_CALLGRIND
68 rm -f
$(TARGET_DIR
)/usr
/lib
/valgrind
/*callgrind
*
69 for i in callgrind_annotate callgrind_control
; do \
70 rm -f
$(TARGET_DIR
)/usr
/bin
/$$i ; \
74 VALGRIND_POST_INSTALL_TARGET_HOOKS
+= VALGRIND_REMOVE_CALLGRIND
77 ifeq ($(BR2_PACKAGE_VALGRIND_HELGRIND
),)
78 define VALGRIND_REMOVE_HELGRIND
79 rm -f
$(TARGET_DIR
)/usr
/lib
/valgrind
/*helgrind
*
82 VALGRIND_POST_INSTALL_TARGET_HOOKS
+= VALGRIND_REMOVE_HELGRIND
85 ifeq ($(BR2_PACKAGE_VALGRIND_DRD
),)
86 define VALGRIND_REMOVE_DRD
87 rm -f
$(TARGET_DIR
)/usr
/lib
/valgrind
/*drd
*
90 VALGRIND_POST_INSTALL_TARGET_HOOKS
+= VALGRIND_REMOVE_DRD
93 ifeq ($(BR2_PACKAGE_VALGRIND_MASSIF
),)
94 define VALGRIND_REMOVE_MASSIF
95 rm -f
$(TARGET_DIR
)/usr
/lib
/valgrind
/*massif
*
96 rm -f
$(TARGET_DIR
)/usr
/bin
/ms_script
99 VALGRIND_POST_INSTALL_TARGET_HOOKS
+= VALGRIND_REMOVE_MASSIF
102 ifeq ($(BR2_PACKAGE_VALGRIND_DHAT
),)
103 define VALGRIND_REMOVE_DHAT
104 rm -f
$(TARGET_DIR
)/usr
/lib
/valgrind
/*dhat
*
107 VALGRIND_POST_INSTALL_TARGET_HOOKS
+= VALGRIND_REMOVE_DHAT
110 ifeq ($(BR2_PACKAGE_VALGRIND_SGCHECK
),)
111 define VALGRIND_REMOVE_SGCHECK
112 rm -f
$(TARGET_DIR
)/usr
/lib
/valgrind
/*sgcheck
*
115 VALGRIND_POST_INSTALL_TARGET_HOOKS
+= VALGRIND_REMOVE_SGCHECK
118 ifeq ($(BR2_PACKAGE_VALGRIND_BBV
),)
119 define VALGRIND_REMOVE_BBV
120 rm -f
$(TARGET_DIR
)/usr
/lib
/valgrind
/*bbv
*
123 VALGRIND_POST_INSTALL_TARGET_HOOKS
+= VALGRIND_REMOVE_BBV
126 ifeq ($(BR2_PACKAGE_VALGRIND_LACKEY
),)
127 define VALGRIND_REMOVE_LACKEY
128 rm -f
$(TARGET_DIR
)/usr
/lib
/valgrind
/*lackey
*
131 VALGRIND_POST_INSTALL_TARGET_HOOKS
+= VALGRIND_REMOVE_LACKEY
134 ifeq ($(BR2_PACKAGE_VALGRIND_NULGRIND
),)
135 define VALGRIND_REMOVE_NULGRIND
136 rm -f
$(TARGET_DIR
)/usr
/lib
/valgrind
/*none
*
139 VALGRIND_POST_INSTALL_TARGET_HOOKS
+= VALGRIND_REMOVE_NULGRIND
142 $(eval
$(autotools-package
))