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