blob: d82541b846dbe065a25e272f4dd4eca7190b68d4 [file] [log] [blame]
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05001SUMMARY = "Valgrind memory debugger and instrumentation framework"
2HOMEPAGE = "http://valgrind.org/"
3BUGTRACKER = "http://valgrind.org/support/bug_reports.html"
4LICENSE = "GPLv2 & GPLv2+ & BSD"
5LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
6 file://include/pub_tool_basics.h;beginline=1;endline=29;md5=ebb8e640ef633f940c425686c873f9fa \
7 file://include/valgrind.h;beginline=1;endline=56;md5=4b5e24908e53016ea561c45f4234a327 \
8 file://COPYING.DOCS;md5=24ea4c7092233849b4394699333b5c56"
9
10X11DEPENDS = "virtual/libx11"
11DEPENDS = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', '${X11DEPENDS}', '', d)} \
12 ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'boost', '', d)} \
13 "
14
15SRC_URI = "http://www.valgrind.org/downloads/valgrind-${PV}.tar.bz2 \
16 file://fixed-perl-path.patch \
17 file://Added-support-for-PPC-instructions-mfatbu-mfatbl.patch \
18 file://run-ptest \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050019 file://0002-remove-rpath.patch \
20 file://0004-Fix-out-of-tree-builds.patch \
21 file://0005-Modify-vg_test-wrapper-to-support-PTEST-formats.patch \
22 file://0001-Remove-tests-that-fail-to-build-on-some-PPC32-config.patch \
23 file://use-appropriate-march-mcpu-mfpu-for-ARM-test-apps.patch \
24 file://avoid-neon-for-targets-which-don-t-support-it.patch \
Brad Bishop37a0e4d2017-12-04 01:01:44 -050025 file://valgrind-make-ld-XXX.so-strlen-intercept-optional.patch \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050026"
27SRC_URI_append_libc-musl = "\
28 file://0001-fix-build-for-musl-targets.patch \
29"
Brad Bishop37a0e4d2017-12-04 01:01:44 -050030SRC_URI[md5sum] = "6eb03c0c10ea917013a7622e483d61bb"
31SRC_URI[sha256sum] = "67ca4395b2527247780f36148b084f5743a68ab0c850cb43e4a5b4b012cf76a1"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050032
33COMPATIBLE_HOST = '(i.86|x86_64|arm|aarch64|mips|powerpc|powerpc64).*-linux'
34
35# valgrind supports armv7 and above
36COMPATIBLE_HOST_armv4 = 'null'
37COMPATIBLE_HOST_armv5 = 'null'
38COMPATIBLE_HOST_armv6 = 'null'
39
Patrick Williamsc0f7c042017-02-23 20:41:17 -060040# valgrind doesn't like mips soft float
41COMPATIBLE_HOST_mips = "${@bb.utils.contains("TARGET_FPU", "soft", "null", ".*-linux", d)}"
42COMPATIBLE_HOST_mipsel = "${@bb.utils.contains("TARGET_FPU", "soft", "null", ".*-linux", d)}"
43
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050044inherit autotools ptest
45
46EXTRA_OECONF = "--enable-tls --without-mpicc"
47EXTRA_OECONF += "${@['--enable-only32bit','--enable-only64bit'][d.getVar('SITEINFO_BITS', True) != '32']}"
48
49# valgrind checks host_cpu "armv7*)", so we need to over-ride the autotools.bbclass default --host option
50EXTRA_OECONF_append_arm = " --host=armv7${HOST_VENDOR}-${HOST_OS}"
51
52EXTRA_OEMAKE = "-w"
53
54# valgrind likes to control its own optimisation flags. It generally defaults
55# to -O2 but uses -O0 for some specific test apps etc. Passing our own flags
56# (via CFLAGS) means we interfere with that. Only pass DEBUG_FLAGS to it
57# which fixes build path issue in DWARF.
58SELECTED_OPTIMIZATION = "${DEBUG_FLAGS}"
59
60CFLAGS_append_libc-uclibc = " -D__UCLIBC__ "
61
62do_install_append () {
63 install -m 644 ${B}/default.supp ${D}/${libdir}/valgrind/
64}
65
66RDEPENDS_${PN} += "perl"
67
68# valgrind needs debug information for ld.so at runtime in order to
69# redirect functions like strlen.
70RRECOMMENDS_${PN} += "${TCLIBC}-dbg"
71
72RDEPENDS_${PN}-ptest += " sed perl perl-module-file-glob"
73RDEPENDS_${PN}-ptest_append_libc-glibc = " glibc-utils"
74
Patrick Williamsc0f7c042017-02-23 20:41:17 -060075# One of the tests contains a bogus interpreter path on purpose.
76# Skip file dependency check
77SKIP_FILEDEPS_${PN}-ptest = '1'
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050078
79do_compile_ptest() {
80 oe_runmake check
81}
82
83do_install_ptest() {
84 chmod +x ${B}/tests/vg_regtest
85
86 # The test application binaries are not automatically installed.
87 # Grab them from the build directory.
88 #
89 # The regression tests require scripts and data files that are not
90 # copied to the build directory. They must be copied from the
91 # source directory.
92 saved_dir=$PWD
93 for parent_dir in ${S} ${B} ; do
94 cd $parent_dir
95
96 # exclude shell or the package won't install
97 rm -rf none/tests/shell* 2>/dev/null
98
99 subdirs="tests cachegrind/tests callgrind/tests drd/tests helgrind/tests massif/tests memcheck/tests none/tests"
100
101 # Get the vg test scripts, filters, and expected files
102 for dir in $subdirs ; do
103 find $dir | cpio -pvdu ${D}${PTEST_PATH}
104 done
105 cd $saved_dir
106 done
107
108 # clean out build artifacts before building the rpm
109 find ${D}${PTEST_PATH} \
110 \( -name "Makefile*" \
111 -o -name "*.o" \
112 -o -name "*.c" \
113 -o -name "*.S" \
114 -o -name "*.h" \) \
115 -exec rm {} \;
116
117 # needed by massif tests
118 cp ${B}/massif/ms_print ${D}${PTEST_PATH}/massif/ms_print
119
120 # handle multilib
121 sed -i s:@libdir@:${libdir}:g ${D}${PTEST_PATH}/run-ptest
122}