diff options
| author | Khem Raj <raj.khem@gmail.com> | 2025-07-15 12:39:58 -0700 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2025-07-16 08:47:50 -0700 |
| commit | 1db713b038cfeeb37b8c571950d7354c88eeac8c (patch) | |
| tree | 2c76b33ac1466916a1ad3ecaa0c5117c8c03f1e7 /meta-oe/dynamic-layers/meta-python/recipes-devtools/bcc/bcc_0.35.0.bb | |
| parent | 2b9e429a242d8899c77281b6c2387b63534b8d82 (diff) | |
| download | meta-openembedded-1db713b038cfeeb37b8c571950d7354c88eeac8c.tar.gz | |
bpftrace,bcc: Migrate recipe from meta-clang to meta-oe
These recipes depend on clang, and clang being on core
it is better place for these tools to be in a common
layer for now that is meta-oe
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/dynamic-layers/meta-python/recipes-devtools/bcc/bcc_0.35.0.bb')
| -rw-r--r-- | meta-oe/dynamic-layers/meta-python/recipes-devtools/bcc/bcc_0.35.0.bb | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/meta-oe/dynamic-layers/meta-python/recipes-devtools/bcc/bcc_0.35.0.bb b/meta-oe/dynamic-layers/meta-python/recipes-devtools/bcc/bcc_0.35.0.bb new file mode 100644 index 0000000000..b810f6ec77 --- /dev/null +++ b/meta-oe/dynamic-layers/meta-python/recipes-devtools/bcc/bcc_0.35.0.bb | |||
| @@ -0,0 +1,92 @@ | |||
| 1 | SUMMARY = "BPF Compiler Collection (BCC)" | ||
| 2 | HOMEPAGE = "https://github.com/iovisor/bcc" | ||
| 3 | LICENSE = "Apache-2.0" | ||
| 4 | LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=e3fc50a88d0a364313df4b21ef20c29e" | ||
| 5 | |||
| 6 | inherit cmake python3native manpages ptest | ||
| 7 | |||
| 8 | DEPENDS += "bison-native \ | ||
| 9 | flex-native \ | ||
| 10 | zip-native \ | ||
| 11 | flex \ | ||
| 12 | elfutils \ | ||
| 13 | clang \ | ||
| 14 | libbpf \ | ||
| 15 | python3-setuptools-native \ | ||
| 16 | " | ||
| 17 | |||
| 18 | RDEPENDS:${PN} += "bash python3 python3-core python3-setuptools xz" | ||
| 19 | RDEPENDS:${PN}-ptest = "kernel-devsrc packagegroup-core-buildessential cmake bash python3 python3-netaddr python3-pyroute2" | ||
| 20 | |||
| 21 | SRC_URI = "gitsm://github.com/iovisor/bcc;branch=master;protocol=https;tag=v${PV} \ | ||
| 22 | file://0001-CMakeLists.txt-override-the-PY_CMD_ESCAPED.patch \ | ||
| 23 | file://0001-Vendor-just-enough-extra-headers-to-allow-libbpf-to-.patch \ | ||
| 24 | file://run-ptest \ | ||
| 25 | file://ptest_wrapper.sh \ | ||
| 26 | file://fix_for_memleak.patch \ | ||
| 27 | " | ||
| 28 | |||
| 29 | SRCREV = "c31a1ca305f787ba53e001ead45ebf65233a32cf" | ||
| 30 | |||
| 31 | PACKAGECONFIG ??= "examples" | ||
| 32 | PACKAGECONFIG:remove:libc-musl = "examples" | ||
| 33 | |||
| 34 | PACKAGECONFIG[manpages] = "-DENABLE_MAN=ON,-DENABLE_MAN=OFF," | ||
| 35 | PACKAGECONFIG[examples] = "-DENABLE_EXAMPLES=ON,-DENABLE_EXAMPLES=OFF," | ||
| 36 | |||
| 37 | EXTRA_OECMAKE = " \ | ||
| 38 | -DREVISION='${PV}' \ | ||
| 39 | -DCMAKE_USE_LIBBPF_PACKAGE=ON \ | ||
| 40 | -DENABLE_LLVM_SHARED=ON \ | ||
| 41 | -DENABLE_CLANG_JIT=ON \ | ||
| 42 | -DPY_SKIP_DEB_LAYOUT=ON \ | ||
| 43 | -DPYTHON_CMD=${PYTHON} \ | ||
| 44 | -DPYTHON_FLAGS=--install-lib=${PYTHON_SITEPACKAGES_DIR} \ | ||
| 45 | " | ||
| 46 | |||
| 47 | # Avoid stripping debuginfo.so to fix some tests. | ||
| 48 | INHIBIT_PACKAGE_STRIP = "1" | ||
| 49 | INHIBIT_PACKAGE_DEBUG_SPLIT = "1" | ||
| 50 | |||
| 51 | do_install:append() { | ||
| 52 | sed -e 's@#!/usr/bin/env python@#!/usr/bin/env python3@g' \ | ||
| 53 | -i $(find ${D}${datadir}/${PN} -type f) | ||
| 54 | sed -e 's@#!/usr/bin/python.*@#!/usr/bin/env python3@g' \ | ||
| 55 | -i $(find ${D}${datadir}/${PN} -type f) | ||
| 56 | rm -rf ${D}${datadir}/bcc/examples/lua | ||
| 57 | } | ||
| 58 | |||
| 59 | do_install_ptest() { | ||
| 60 | install -d ${D}${PTEST_PATH}/tests/cc | ||
| 61 | # ptest searches for shared libs and archive files in the build folder. | ||
| 62 | # Hence, these files are copied to the image to fix these tests. | ||
| 63 | install -d ${D}${B}/tests/cc | ||
| 64 | install ${B}/tests/cc/archive.zip ${B}/tests/cc/libdebuginfo_test_lib.so ${B}/tests/cc/with_gnu_debuglink.so ${B}/tests/cc/with_gnu_debugdata.so ${B}/tests/cc/debuginfo.so ${D}${B}/tests/cc | ||
| 65 | install -d ${D}/opt | ||
| 66 | install ${B}/tests/cc/test_libbcc_no_libbpf ${B}/tests/cc/libusdt_test_lib.so ${D}${PTEST_PATH}/tests/cc | ||
| 67 | cp -rf ${S}/tests/python ${D}${PTEST_PATH}/tests/python | ||
| 68 | install ${UNPACKDIR}/ptest_wrapper.sh ${D}${PTEST_PATH}/tests | ||
| 69 | install ${S}/examples/networking/simulation.py ${D}${PTEST_PATH}/tests/python | ||
| 70 | find ${S}/tools/ -type f -name "*.py" -exec \ | ||
| 71 | sed -i \ | ||
| 72 | -e 's@^#! */usr/bin/env python$@#!/usr/bin/env python3@' \ | ||
| 73 | -e 's@^#! */usr/bin/python.*@#!/usr/bin/env python3@' {} + | ||
| 74 | cp -rf ${S}/tools/ ${D}${PTEST_PATH}/../../tools/ | ||
| 75 | } | ||
| 76 | |||
| 77 | FILES:${PN} += "${PYTHON_SITEPACKAGES_DIR}" | ||
| 78 | FILES:${PN} += "${B}/tests/cc" | ||
| 79 | FILES:${PN}-ptest += "${libdir}/libbcc.so" | ||
| 80 | FILES:${PN}-ptest += "${libdir}/tools/" | ||
| 81 | FILES:${PN}-ptest += "/opt/" | ||
| 82 | FILES:${PN}-doc += "${datadir}/${PN}/man" | ||
| 83 | |||
| 84 | COMPATIBLE_HOST = "(x86_64.*|aarch64.*|powerpc64.*|riscv64.*)-linux" | ||
| 85 | |||
| 86 | # WARNING: bcc-0.30.0+git-r0 do_package_qa: QA Issue: File /usr/lib/bcc/ptest/tests/cc/test_libbcc_no_libbpf in package bcc-ptest contains reference to TMPDIR [buildpaths] | ||
| 87 | # this one is difficult to resolve, because the tests use CMAKE_CURRENT_BINARY_DIR directly in .cc e.g.: | ||
| 88 | # https://github.com/iovisor/bcc/commit/7271bfc946a19413761be2e3c60c48bf72c5eea1#diff-233a0bfa490f3d7466c49935b64c86dd93956bbc0461f5af703b344cf6601461 | ||
| 89 | # we would probably need to use separate variable for "runtime" path for test assets from the standard CMAKE_CURRENT_BINARY_DIR variable or use relative | ||
| 90 | # path from the test binary | ||
| 91 | WARN_QA:append = "${@bb.utils.contains('PTEST_ENABLED', '1', ' buildpaths', '', d)}" | ||
| 92 | ERROR_QA:remove = "${@bb.utils.contains('PTEST_ENABLED', '1', 'buildpaths', '', d)}" | ||
