From: Leo Yan <leo.yan@linaro.org>
To: openembedded-devel@lists.openembedded.org,
Sumit Garg <sumit.garg@linaro.org>,
Daniel Thompson <daniel.thompson@linaro.org>,
Loic Poulain <loic.poulain@linaro.org>
Subject: [meta-oe][PATCH v1 3/4] BCC: Add build recipe
Date: Tue, 18 Feb 2020 13:25:43 +0800 [thread overview]
Message-ID: <20200218052544.9467-4-leo.yan@linaro.org> (raw)
In-Reply-To: <20200218052544.9467-1-leo.yan@linaro.org>
From: Sumit Garg <sumit.garg@linaro.org>
BPF Compiler Collection (BCC) is a toolkit for creating efficient kernel
tracing and manipulation programs, and includes versatile tools and
examples which based on eBPF. This tool is very widely used on server
section, but we also can use it for embedded system, e.g. use its
function trace utilities (trace.py and argdist.py) to trace kernel
function parameters and return values.
This patch adds recipe for BCC version 0.12.0. This patch also contains
a patch to change cmake file so can look for libraries and headers which
are installed in target sysroot-recipe path for cross compilation.
Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Co-developed-by: Leo Yan <leo.yan@linaro.org>
---
...-with-OE-LLVM-cross-compiled-package.patch | 32 ++++++++++++++++
meta-oe/recipes-devtools/bcc/bcc_0.12.0.bb | 37 +++++++++++++++++++
2 files changed, 69 insertions(+)
create mode 100644 meta-oe/recipes-devtools/bcc/bcc/0001-Allow-to-build-with-OE-LLVM-cross-compiled-package.patch
create mode 100644 meta-oe/recipes-devtools/bcc/bcc_0.12.0.bb
diff --git a/meta-oe/recipes-devtools/bcc/bcc/0001-Allow-to-build-with-OE-LLVM-cross-compiled-package.patch b/meta-oe/recipes-devtools/bcc/bcc/0001-Allow-to-build-with-OE-LLVM-cross-compiled-package.patch
new file mode 100644
index 000000000..b5acadc1b
--- /dev/null
+++ b/meta-oe/recipes-devtools/bcc/bcc/0001-Allow-to-build-with-OE-LLVM-cross-compiled-package.patch
@@ -0,0 +1,32 @@
+From 93cf25ba663e68a6a6f4237fbe0ef8349b3f37ef Mon Sep 17 00:00:00 2001
+From: Sumit Garg <sumit.garg@linaro.org>
+Date: Fri, 14 Feb 2020 07:40:11 +0000
+Subject: [PATCH] Allow to build with OE LLVM cross compiled package
+
+The default LLVM cmake package requires all libraries, headers and tools
+to be present but in case of cross compilation, OE only provides
+target specific libraries and headers and requires native llvm tools.
+
+So instead of looking for a complete llvm package, look for libraries and
+headers which are installed in target sysroot-recipe path.
+
+Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
+---
+ CMakeLists.txt | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 7bd0f3b2..6f1f12c0 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -39,8 +39,6 @@ endif()
+ if(NOT PYTHON_ONLY AND ENABLE_CLANG_JIT)
+ find_package(BISON)
+ find_package(FLEX)
+-find_package(LLVM REQUIRED CONFIG)
+-message(STATUS "Found LLVM: ${LLVM_INCLUDE_DIRS} ${LLVM_PACKAGE_VERSION}")
+ find_package(LibElf REQUIRED)
+
+ # clang is linked as a library, but the library path searching is
+--
+2.17.1
diff --git a/meta-oe/recipes-devtools/bcc/bcc_0.12.0.bb b/meta-oe/recipes-devtools/bcc/bcc_0.12.0.bb
new file mode 100644
index 000000000..687fb64c7
--- /dev/null
+++ b/meta-oe/recipes-devtools/bcc/bcc_0.12.0.bb
@@ -0,0 +1,37 @@
+SUMMARY = "BPF Compiler Collection (BCC)"
+HOMEPAGE = "https://github.com/iovisor/bcc"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=e3fc50a88d0a364313df4b21ef20c29e"
+
+DEPENDS += "bison-native \
+ ninja-native \
+ elfutils-native \
+ flex-native \
+ ${MLPREFIX}elfutils \
+ ${MLPREFIX}binutils \
+ ${MLPREFIX}flex \
+ luajit \
+ clang \
+ "
+
+RDEPENDS_${PN} += "bash python"
+
+SRC_URI = "git://github.com/iovisor/bcc \
+ file://0001-Allow-to-build-with-OE-LLVM-cross-compiled-package.patch \
+ "
+SRCREV = "368a5b0714961953f3e3f61607fa16cb71449c1b"
+
+S = "${WORKDIR}/git"
+
+inherit cmake
+
+EXTRA_OECMAKE = " \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DENABLE_LLVM_SHARED=ON \
+ -DENABLE_CLANG_JIT=ON \
+ -DENABLE_MAN=OFF \
+ -DLLVM_PACKAGE_VERSION=${LLVMVERSION} \
+ -DPYTHON_CMD=python3 \
+"
+
+FILES_${PN} += "${libdir}/python*/dist-packages"
--
2.17.1
next prev parent reply other threads:[~2020-02-18 5:26 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-18 5:25 [meta-oe][PATCH v1 0/4] eBPF tools: Add recipes Leo Yan
2020-02-18 5:25 ` [meta-oe][PATCH v1 1/4] Ply: Add recipe for git version Leo Yan
2020-02-20 15:41 ` Khem Raj
2020-02-21 9:03 ` Leo Yan
2020-02-18 5:25 ` [meta-oe][PATCH v1 2/4] luajit: Add luajit 2.1.0-beta3 recipe Leo Yan
2020-02-19 23:07 ` Khem Raj
2020-02-18 5:25 ` Leo Yan [this message]
2020-02-18 6:30 ` [meta-oe][PATCH v1 3/4] BCC: Add build recipe Khem Raj
2020-02-18 7:27 ` Leo Yan
2020-02-19 9:44 ` Leo Yan
2020-02-19 17:16 ` Khem Raj
2020-02-18 5:25 ` [meta-oe][PATCH v1 4/4] bpftrace: " Leo Yan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200218052544.9467-4-leo.yan@linaro.org \
--to=leo.yan@linaro.org \
--cc=daniel.thompson@linaro.org \
--cc=loic.poulain@linaro.org \
--cc=openembedded-devel@lists.openembedded.org \
--cc=sumit.garg@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.