valgrind_3.25.1.bb 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. SUMMARY = "Valgrind memory debugger and instrumentation framework"
  2. HOMEPAGE = "http://valgrind.org/"
  3. DESCRIPTION = "Valgrind is an instrumentation framework for building dynamic analysis tools. There are Valgrind tools that can automatically detect many memory management and threading bugs, and profile your programs in detail."
  4. BUGTRACKER = "http://valgrind.org/support/bug_reports.html"
  5. LICENSE = "GPL-2.0-only & GPL-2.0-or-later & BSD-3-Clause"
  6. LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
  7. file://include/pub_tool_basics.h;beginline=6;endline=29;md5=41c410e8d3f305aee7aaa666b2e4f366 \
  8. file://include/valgrind.h;beginline=1;endline=56;md5=ad3b317f3286b6b704575d9efe6ca5df \
  9. file://COPYING.DOCS;md5=24ea4c7092233849b4394699333b5c56"
  10. SRC_URI = "https://sourceware.org/pub/valgrind/valgrind-${PV}.tar.bz2 \
  11. file://fixed-perl-path.patch \
  12. file://Added-support-for-PPC-instructions-mfatbu-mfatbl.patch \
  13. file://use-appropriate-march-mcpu-mfpu-for-ARM-test-apps.patch \
  14. file://avoid-neon-for-targets-which-don-t-support-it.patch \
  15. file://0001-configure-Drop-setting-mcpu-cortex-a8-on-arm.patch \
  16. file://valgrind-make-ld-XXX.so-strlen-intercept-optional.patch \
  17. file://0001-makefiles-Drop-setting-mcpu-to-cortex-a8-on-arm-arch.patch \
  18. file://0001-sigqueue-Rename-_sifields-to-__si_fields-on-musl.patch \
  19. file://0003-correct-include-directive-path-for-config.h.patch \
  20. file://0001-valgrind-filter_xml_frames-do-not-filter-usr.patch \
  21. file://0001-memcheck-vgtests-remove-fullpath-after-flags.patch \
  22. file://s390x_vec_op_t.patch \
  23. file://0001-none-tests-fdleak_cmsg.stderr.exp-adjust-tmp-paths.patch \
  24. file://0001-memcheck-tests-Fix-timerfd-syscall-test.patch \
  25. file://0001-docs-Disable-manual-validation.patch \
  26. file://0001-tests-arm-Use-O-instead-of-O0.patch \
  27. file://0001-Use-portable-syntax-for-pushsection-directive-in-inl.patch \
  28. "
  29. SRC_URI[sha256sum] = "61deb8d0727b45c268efdc1b3b6c9e679cd97cbf5ee4b28d1dead7c8b7a271af"
  30. UPSTREAM_CHECK_REGEX = "valgrind-(?P<pver>\d+(\.\d+)+)\.tar"
  31. COMPATIBLE_HOST = '(i.86|x86_64|arm|aarch64|mips|powerpc|powerpc64|riscv64).*-linux'
  32. # valgrind supports armv7 and above
  33. COMPATIBLE_HOST:armv4 = 'null'
  34. COMPATIBLE_HOST:armv5 = 'null'
  35. COMPATIBLE_HOST:armv6 = 'null'
  36. # valgrind fails with powerpc soft-float
  37. COMPATIBLE_HOST:powerpc = "${@bb.utils.contains('TARGET_FPU', 'soft', 'null', '.*-linux', d)}"
  38. # X32 isn't supported by valgrind at this time
  39. COMPATIBLE_HOST:linux-gnux32 = 'null'
  40. COMPATIBLE_HOST:linux-muslx32 = 'null'
  41. # Disable for some MIPS variants
  42. COMPATIBLE_HOST:mipsarchr6 = 'null'
  43. COMPATIBLE_HOST:linux-gnun32 = 'null'
  44. # Disable for powerpc64 with musl
  45. COMPATIBLE_HOST:libc-musl:powerpc64 = 'null'
  46. inherit autotools-brokensep multilib_header
  47. EXTRA_OECONF = "--enable-tls --without-mpicc"
  48. EXTRA_OECONF += "${@['--enable-only32bit','--enable-only64bit'][d.getVar('SITEINFO_BITS') != '32']}"
  49. # valgrind checks host_cpu "armv7*)", so we need to over-ride the autotools.bbclass default --host option
  50. EXTRA_OECONF:append:arm = " --host=armv7${HOST_VENDOR}-${HOST_OS}"
  51. EXTRA_OEMAKE = "-w"
  52. CACHED_CONFIGUREVARS += "ac_cv_path_PERL='/usr/bin/env perl'"
  53. # valgrind likes to control its own optimisation flags. It generally defaults
  54. # to -O2 but uses -O0 for some specific test apps etc. Passing our own flags
  55. # (via CFLAGS) means we interfere with that. Only pass DEBUG_FLAGS to it
  56. # which fixes build path issue in DWARF.
  57. SELECTED_OPTIMIZATION = "${DEBUG_LEVELFLAG}"
  58. # Split out various helper scripts to separate packages to avoid the
  59. # main package depending on perl and python.
  60. PACKAGES =+ "${PN}-cachegrind ${PN}-massif ${PN}-callgrind"
  61. FILES:${PN}-cachegrind = "${bindir}/cg_*"
  62. FILES:${PN}-massif = "${bindir}/ms_*"
  63. FILES:${PN}-callgrind = "${bindir}/callgrind_*"
  64. RDEPENDS:${PN}-cachegrind = "${PN} python3-core"
  65. RDEPENDS:${PN}-massif = "${PN} perl"
  66. RDEPENDS:${PN}-callgrind = "${PN} perl"
  67. do_configure:prepend () {
  68. rm -rf ${S}/config.h
  69. }
  70. do_install:append () {
  71. install -m 644 ${B}/default.supp ${D}/${libexecdir}/valgrind/
  72. oe_multilib_header valgrind/config.h
  73. }
  74. VALGRINDARCH ?= "${TARGET_ARCH}"
  75. VALGRINDARCH:aarch64 = "arm64"
  76. VALGRINDARCH:x86-64 = "amd64"
  77. VALGRINDARCH:x86 = "x86"
  78. VALGRINDARCH:mips = "mips32"
  79. VALGRINDARCH:mipsel = "mips32"
  80. VALGRINDARCH:mips64el = "mips64"
  81. VALGRINDARCH:powerpc = "ppc"
  82. VALGRINDARCH:powerpc64 = "ppc64"
  83. VALGRINDARCH:powerpc64le = "ppc64le"
  84. INHIBIT_PACKAGE_STRIP_FILES = "${PKGD}${libexecdir}/valgrind/vgpreload_memcheck-${VALGRINDARCH}-linux.so"
  85. # valgrind needs debug information for ld.so at runtime in order to
  86. # redirect functions like strlen.
  87. RRECOMMENDS:${PN} += "${TCLIBC}-dbg"
  88. # Valgrind needs intrinsics which are not provided by clang
  89. # m_signals.c:2213:7: error: __builtin_longjmp is not supported for the current target
  90. # 2213 | VG_MINIMAL_LONGJMP(tst->sched_jmpbuf);
  91. # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  92. #
  93. # It needs something like - https://bugs.kde.org/show_bug.cgi?id=369723
  94. TOOLCHAIN:riscv64 = "gcc"