1 ################################################################################
5 ################################################################################
7 VALGRIND_VERSION
= 3.12.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
= \
15 VALGRIND_INSTALL_STAGING
= YES
17 # patch 0004-Fixes-for-musl-libc.patch touching configure.ac
18 VALGRIND_AUTORECONF
= YES
20 # Valgrind must be compiled with no stack protection, so forcefully
21 # pass -fno-stack-protector to override what Buildroot may have in
22 # TARGET_CFLAGS if BR2_SSP_* support is enabled.
27 # When Valgrind detects a 32-bit MIPS architecture, it forcibly adds
28 # -march=mips32 to CFLAGS; when it detects a 64-bit MIPS architecture,
29 # it forcibly adds -march=mips64. This causes Valgrind to be built
30 # always for the first ISA revision level (R1), even when the user has
31 # configured Buildroot for the second ISA revision level (R2).
33 # Override the CFLAGS variable (which Valgrind appends to its CFLAGS)
34 # and pass the right -march option, so they take precedence over
35 # Valgrind's wrongfully detected value.
36 ifeq ($(BR2_mips
)$(BR2_mipsel
)$(BR2_mips64
)$(BR2_mips64el
),y
)
37 VALGRIND_CFLAGS
+= -march
=$(BR2_GCC_TARGET_ARCH
)
40 VALGRIND_CONF_ENV
= CFLAGS
="$(VALGRIND_CFLAGS)"
42 # On ARM, Valgrind only supports ARMv7, and uses the arch part of the
43 # host tuple to determine whether it's being built for ARMv7 or
44 # not. Therefore, we adjust the host tuple to specify we're on
45 # ARMv7. The valgrind package is guaranteed, through Config.in, to
46 # only be selected on ARMv7-A platforms.
47 ifeq ($(BR2_ARM_CPU_ARMV7A
),y
)
48 VALGRIND_CONF_OPTS
+= \
49 --host
=$(patsubst arm-
%,armv7-
%,$(GNU_TARGET_NAME
))
52 define VALGRIND_INSTALL_UCLIBC_SUPP
53 $(INSTALL
) -D
-m
0644 package
/valgrind
/uclibc.supp
$(TARGET_DIR
)/usr
/lib
/valgrind
/uclibc.supp
56 VALGRIND_POST_INSTALL_TARGET_HOOKS
+= VALGRIND_INSTALL_UCLIBC_SUPP
58 ifeq ($(BR2_PACKAGE_VALGRIND_MEMCHECK
),)
59 define VALGRIND_REMOVE_MEMCHECK
60 rm -f
$(TARGET_DIR
)/usr
/lib
/valgrind
/*memcheck
*
63 VALGRIND_POST_INSTALL_TARGET_HOOKS
+= VALGRIND_REMOVE_MEMCHECK
66 ifeq ($(BR2_PACKAGE_VALGRIND_CACHEGRIND
),)
67 define VALGRIND_REMOVE_CACHEGRIND
68 rm -f
$(TARGET_DIR
)/usr
/lib
/valgrind
/*cachegrind
*
69 for i in cg_annotate cg_diff cg_merge
; do \
70 rm -f
$(TARGET_DIR
)/usr
/bin
/$$i ; \
74 VALGRIND_POST_INSTALL_TARGET_HOOKS
+= VALGRIND_REMOVE_CACHEGRIND
77 ifeq ($(BR2_PACKAGE_VALGRIND_CALLGRIND
),)
78 define VALGRIND_REMOVE_CALLGRIND
79 rm -f
$(TARGET_DIR
)/usr
/lib
/valgrind
/*callgrind
*
80 for i in callgrind_annotate callgrind_control
; do \
81 rm -f
$(TARGET_DIR
)/usr
/bin
/$$i ; \
85 VALGRIND_POST_INSTALL_TARGET_HOOKS
+= VALGRIND_REMOVE_CALLGRIND
88 ifeq ($(BR2_PACKAGE_VALGRIND_HELGRIND
),)
89 define VALGRIND_REMOVE_HELGRIND
90 rm -f
$(TARGET_DIR
)/usr
/lib
/valgrind
/*helgrind
*
93 VALGRIND_POST_INSTALL_TARGET_HOOKS
+= VALGRIND_REMOVE_HELGRIND
96 ifeq ($(BR2_PACKAGE_VALGRIND_DRD
),)
97 define VALGRIND_REMOVE_DRD
98 rm -f
$(TARGET_DIR
)/usr
/lib
/valgrind
/*drd
*
101 VALGRIND_POST_INSTALL_TARGET_HOOKS
+= VALGRIND_REMOVE_DRD
104 ifeq ($(BR2_PACKAGE_VALGRIND_MASSIF
),)
105 define VALGRIND_REMOVE_MASSIF
106 rm -f
$(TARGET_DIR
)/usr
/lib
/valgrind
/*massif
*
107 rm -f
$(TARGET_DIR
)/usr
/bin
/ms_script
110 VALGRIND_POST_INSTALL_TARGET_HOOKS
+= VALGRIND_REMOVE_MASSIF
113 ifeq ($(BR2_PACKAGE_VALGRIND_DHAT
),)
114 define VALGRIND_REMOVE_DHAT
115 rm -f
$(TARGET_DIR
)/usr
/lib
/valgrind
/*dhat
*
118 VALGRIND_POST_INSTALL_TARGET_HOOKS
+= VALGRIND_REMOVE_DHAT
121 ifeq ($(BR2_PACKAGE_VALGRIND_SGCHECK
),)
122 define VALGRIND_REMOVE_SGCHECK
123 rm -f
$(TARGET_DIR
)/usr
/lib
/valgrind
/*sgcheck
*
126 VALGRIND_POST_INSTALL_TARGET_HOOKS
+= VALGRIND_REMOVE_SGCHECK
129 ifeq ($(BR2_PACKAGE_VALGRIND_BBV
),)
130 define VALGRIND_REMOVE_BBV
131 rm -f
$(TARGET_DIR
)/usr
/lib
/valgrind
/*bbv
*
134 VALGRIND_POST_INSTALL_TARGET_HOOKS
+= VALGRIND_REMOVE_BBV
137 ifeq ($(BR2_PACKAGE_VALGRIND_LACKEY
),)
138 define VALGRIND_REMOVE_LACKEY
139 rm -f
$(TARGET_DIR
)/usr
/lib
/valgrind
/*lackey
*
142 VALGRIND_POST_INSTALL_TARGET_HOOKS
+= VALGRIND_REMOVE_LACKEY
145 ifeq ($(BR2_PACKAGE_VALGRIND_NULGRIND
),)
146 define VALGRIND_REMOVE_NULGRIND
147 rm -f
$(TARGET_DIR
)/usr
/lib
/valgrind
/*none
*
150 VALGRIND_POST_INSTALL_TARGET_HOOKS
+= VALGRIND_REMOVE_NULGRIND
153 $(eval
$(autotools-package
))