From patchwork Sun Dec 20 15:11:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain Naour X-Patchwork-Id: 1418823 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=mazT6eF/; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CzR2T3qljz9sWF for ; Mon, 21 Dec 2020 02:13:53 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 9337D204B2; Sun, 20 Dec 2020 15:13:50 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tHNSC7Wn2PwV; Sun, 20 Dec 2020 15:12:10 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 5EBCF20396; Sun, 20 Dec 2020 15:12:10 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 5345A1BF5A0 for ; Sun, 20 Dec 2020 15:12:09 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 4C14486B05 for ; Sun, 20 Dec 2020 15:12:09 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DCh5N4zOZgt7 for ; Sun, 20 Dec 2020 15:12:07 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) by whitealder.osuosl.org (Postfix) with ESMTPS id 9259186B03 for ; Sun, 20 Dec 2020 15:12:07 +0000 (UTC) Received: by mail-wm1-f48.google.com with SMTP id 3so8203403wmg.4 for ; Sun, 20 Dec 2020 07:12:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=wZpUeDFk17ESYCrjY/SAUwerpjYQFz9yPZq5dw0Vosg=; b=mazT6eF/NQdlxamXURMOJcWdNINi69yNqXX1Ts/BFxKuyU3RqPvRi+y2HWD/KHN+ZQ 60obMKUPGI3qI2yYdtaAdNY/mNc3edf+PpTnGqbjalHLbB5BR0UAt/mGbqhsVYwCzllp qBhfqSXKOlXGKSB2iIyWGwKCC5CjaLHyD15VWMustt0lwM8yLJ+RrvmkMYpflcPMm/PL m5AclIc/eWg7G58Ug+6I9ikkRCnqv0pyo4VbO0/6JQTcHNTklAvN7wTzdGrahjgtzjIs QTE8YwYBlGLjmsztnAgohCMsxitM7x0c1D50R5rMmIQIyUJG4RlrRze7ZCfze0wZjRrv 66BQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=wZpUeDFk17ESYCrjY/SAUwerpjYQFz9yPZq5dw0Vosg=; b=TybxeTJQrza8cgbMW+mio1tSzbTiGx2CXMaAr+QATdTotZ7hK5J3pXjKANQG8RC4ep v/EGJThoNDitDJS5qKuzhiE0hIKn0luijD6t8Uk0xVObxquqxOp+zPJlK/2oLvis758A Ap/wGRFuqgIIlpnqfMFHtUdzwumWQIC+Up3tABT/axiNiaMs4tHHRRxI4t+5Ih28v60z QPw+icY+OOXo33P0/4jbO4LB+F4tgUignZ35AN2Xoo0GeT93G648G8sH9sn1kD87mqZj X7THnDGs5uL6xZ1el4+f/rCuRCAcbo9K8zPHbWSGCmYg1amxOo1mBJtzCTyezO3NbbSc jfpQ== X-Gm-Message-State: AOAM531J5Yr8cnXPNrlWrRvyur5sXDk+7H9QyG0vqHy6rs6FVw4ux+nY XLhmHPq/hL2M592jrkTGiCZH+amy0Jtd3g== X-Google-Smtp-Source: ABdhPJwNjeHnm5o+eJFxircL6vore+BoS3K0kgfBrT9YjB+I+FevzWpI27SSpOpWRbRsHf3iL2OEYg== X-Received: by 2002:a1c:6856:: with SMTP id d83mr12662215wmc.119.1608477126016; Sun, 20 Dec 2020 07:12:06 -0800 (PST) Received: from atlas.home (2a01cb058f8a18003dbee9eed79eb521.ipv6.abo.wanadoo.fr. [2a01:cb05:8f8a:1800:3dbe:e9ee:d79e:b521]) by smtp.gmail.com with ESMTPSA id l8sm20504080wmf.35.2020.12.20.07.12.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Dec 2020 07:12:05 -0800 (PST) From: Romain Naour To: buildroot@buildroot.org Date: Sun, 20 Dec 2020 16:11:59 +0100 Message-Id: <20201220151203.2206747-1-romain.naour@gmail.com> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 Subject: [Buildroot] [PATCHv6 1/5] package/llvm: add BPF backend X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jugurtha BELKALEM , Romain Naour , Qais Yousef Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Jugurtha BELKALEM bcc is a front-end tool for eBPF : https://github.com/iovisor/bcc/blob/master/README.md. eBPF is the most powerful Linux tracer, and bcc allows to write eBPF scripts in C and PYTHON3. BCC requires enabling LLVM backend BPF support. Signed-off-by: Jugurtha BELKALEM Signed-off-by: Romain Naour Tested-by: Qais Yousef Reviewed-by: Qais Yousef Cc: Qais Yousef --- package/llvm/Config.in | 6 ++++++ package/llvm/llvm.mk | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/package/llvm/Config.in b/package/llvm/Config.in index 1d21d879da..6ec2ffcfe6 100644 --- a/package/llvm/Config.in +++ b/package/llvm/Config.in @@ -47,6 +47,12 @@ config BR2_PACKAGE_LLVM_RTTI https://llvm.org/docs/HowToSetUpLLVMStyleRTTI.html +config BR2_PACKAGE_LLVM_BPF + bool "BPF backend" + help + Build BPF target. Select this option if you are going + to install bcc on the target. + endif comment "llvm needs a toolchain w/ wchar, threads, C++, gcc >= 4.8, dynamic library" diff --git a/package/llvm/llvm.mk b/package/llvm/llvm.mk index 24d033d124..48a298191c 100644 --- a/package/llvm/llvm.mk +++ b/package/llvm/llvm.mk @@ -61,6 +61,11 @@ ifeq ($(BR2_PACKAGE_LLVM_AMDGPU),y) LLVM_TARGETS_TO_BUILD += AMDGPU endif +# Build BPF backend +ifeq ($(BR2_PACKAGE_LLVM_BPF),y) +LLVM_TARGETS_TO_BUILD += BPF +endif + # Use native llvm-tblgen from host-llvm (needed for cross-compilation) LLVM_CONF_OPTS += -DLLVM_TABLEGEN=$(HOST_DIR)/bin/llvm-tblgen From patchwork Sun Dec 20 15:12:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain Naour X-Patchwork-Id: 1418826 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=amd1BrC4; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CzR2f5snwz9sWF for ; Mon, 21 Dec 2020 02:14:02 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 5857D2037A; Sun, 20 Dec 2020 15:14:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id c-gDk6dOGa9U; Sun, 20 Dec 2020 15:13:54 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 2E080204AA; Sun, 20 Dec 2020 15:13:54 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id F36EF1BF5A0 for ; Sun, 20 Dec 2020 15:13:51 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id DF6ED203BB for ; Sun, 20 Dec 2020 15:13:51 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Pib78fsIcPn3 for ; Sun, 20 Dec 2020 15:12:08 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) by silver.osuosl.org (Postfix) with ESMTPS id 8BCBC2002B for ; Sun, 20 Dec 2020 15:12:08 +0000 (UTC) Received: by mail-wm1-f50.google.com with SMTP id x22so7332834wmc.5 for ; Sun, 20 Dec 2020 07:12:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wufIILuuVMU2GcolfbUlKR8xlhbIBfn3B/H+/rHMTNo=; b=amd1BrC4514Q+UB7xHJVP/5crN/B9Oj65Rpma89NCOZKbfeGTwV9Tvllf6E2tk9TNe bfnz/TSiXYdgV0fUOdLemXKw7bPWlLH2a511X5H7rETi00UhuCYAuunxs7R5PB8GR/8x MTr7kOs5ZXRN7cEtsWbn3azcXqLTmzGt3tI3zaHDeq7uQs8qFu06M+8STWyBWKpO+sVU FqyTw04sx5zxo0uHbzxI3HLdyVG32LLetPBCaKnujqplLSSoieaB/wRQMQqoulEBukDI WWAEbpfXBauaWw0lUf0I9yo+SVrAV6La4ZGhF6uSwol+Eb61kGz7TxbXywxcxg8pfxzy 8PBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wufIILuuVMU2GcolfbUlKR8xlhbIBfn3B/H+/rHMTNo=; b=cWzB34SiJBWil1ciPt4QspGsZUqY7/9BzwxrX6O4XL3vbycY+dA9lJ0k3sHqfn+NRv OZb7+l7qZPjjNO8r69bzIIKoKhfIEdA9+dFi1p3P8TA8S04gSgt9gQFlgPXQwFg6pXgR KD4w6YbZTDwpu1Dcl+5D7N5HYlGdA74Ggvn4iY7dW1YqrCY6ruyX8mVcaYIiS2SJ8jUa +VoIrOOi3x7jzL3uhK7+HaUz9Dij8SWzftqFv2ZWAa5gyaRQZwbQ/ZlV/DpZNLM6OunL RNrStowO3r825HZ8bfePfsM/lCZBB5xKMkekv2uVPF8PboEFRZ0yF1FhfVl818vAEn37 hIhQ== X-Gm-Message-State: AOAM53050beBGNsh8ASM2MmeUaROnvbHk2kzrwTdodQrTxt1bip8WP4s jv1AKrNJc2osGXaDWJPKqXHxOkncSVfGcw== X-Google-Smtp-Source: ABdhPJwqM5dJGzUxmPouihdti6rXG5AuqXoFs8KMVs+0W+1EqFWhAljZVrXxz5KjhcCH499axwHUOw== X-Received: by 2002:a05:600c:20f:: with SMTP id 15mr12493461wmi.36.1608477127026; Sun, 20 Dec 2020 07:12:07 -0800 (PST) Received: from atlas.home (2a01cb058f8a18003dbee9eed79eb521.ipv6.abo.wanadoo.fr. [2a01:cb05:8f8a:1800:3dbe:e9ee:d79e:b521]) by smtp.gmail.com with ESMTPSA id l8sm20504080wmf.35.2020.12.20.07.12.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Dec 2020 07:12:06 -0800 (PST) From: Romain Naour To: buildroot@buildroot.org Date: Sun, 20 Dec 2020 16:12:00 +0100 Message-Id: <20201220151203.2206747-2-romain.naour@gmail.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20201220151203.2206747-1-romain.naour@gmail.com> References: <20201220151203.2206747-1-romain.naour@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCHv6 2/5] package/bcc: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jugurtha BELKALEM , Romain Naour , Qais Yousef Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Jugurtha BELKALEM bcc is a front-end tool for eBPF : https://github.com/iovisor/bcc/blob/master/README.md. eBPF is the most powerful Linux tracer, and bcc allows to write eBPF scripts in C and PYTHON3. bcc can help to troubleshoot issues quickly on embedded systems (as long as Linux kernel version >= 4.1). bcc can also make it easy to create observabilty tools, SDN configuration, ddos mitigation, intrusion detection and secure containers. More information is available at: https://ebpf.io/ BCC can be tested on the target : $ mount -t debugfs none /sys/kernel/debug $ cd /usr/share/bcc/tools $ ./execsnoop Signed-off-by: Jugurtha BELKALEM Signed-off-by: Romain Naour Tested-by: Qais Yousef Cc: Qais Yousef Reviewed-by: Qais Yousef --- v6 - Add missing python patch from Qais - remove luajit patch since the luajit support is explicitely disabled - keep tested-by from Qais since he tested bcc (but not the luajit support) - drop the reviewed-by due to luajit and python changes - Add Romain in DEVELOPERS file v5 - Add a patch to disable luajit support - remove iperf3, netperf, audit optional runtime dependencies (Qais) v4 - Bump to version 0.17.0. - Remove kernel dependency (Qais) - Remove optional kernel option handling (Quais) - Update ebpf url (Quais) - Fix tools path in the commit log (Quais) - Add full tar dependency (used to extract the kernel sources from IKHEADERS module) (Quais) - Make luajit optional dependeny (Quais) - Remove python module install hook (Quais) - Keep BCC_LINUX_CONFIG_FIXUPS but only for kernel built by Buildroot. V3 - Bump to version 0.16.0. - Add required python dependency. - Remove unnecessary and duplicated kernel flags (#Testing section) in bcc.mk. V2 - Add eBPF's required Kernel flags. - Fix submodule source fetch problem. - Add toolchain dependency. --- DEVELOPERS | 2 + package/Config.in | 1 + ...-an-option-to-disable-luajit-support.patch | 45 +++++++++++++++++++ ...sts.txt-Fix-python-installation-path.patch | 34 ++++++++++++++ package/bcc/Config.in | 39 ++++++++++++++++ package/bcc/bcc.hash | 3 ++ package/bcc/bcc.mk | 43 ++++++++++++++++++ 7 files changed, 167 insertions(+) create mode 100644 package/bcc/0001-CMake-add-an-option-to-disable-luajit-support.patch create mode 100644 package/bcc/0002-python-CMakeLists.txt-Fix-python-installation-path.patch create mode 100644 package/bcc/Config.in create mode 100644 package/bcc/bcc.hash create mode 100644 package/bcc/bcc.mk diff --git a/DEVELOPERS b/DEVELOPERS index 9406f30cd5..681c4e18db 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -1392,6 +1392,7 @@ N: Joshua Henderson F: package/qt5/qt5wayland/ N: Jugurtha BELKALEM +F: package/bcc/ F: package/python-aiofiles/ F: package/python-crayons/ F: package/python-cycler/ @@ -2233,6 +2234,7 @@ F: board/qemu/ F: configs/qemu_* F: package/alure/ F: package/aubio/ +F: package/bcc/ F: package/binutils/ F: package/bullet/ F: package/clang/ diff --git a/package/Config.in b/package/Config.in index dc7139a49a..c04392126c 100644 --- a/package/Config.in +++ b/package/Config.in @@ -83,6 +83,7 @@ endmenu menu "Debugging, profiling and benchmark" source "package/babeltrace2/Config.in" + source "package/bcc/Config.in" source "package/blktrace/Config.in" source "package/bonnie/Config.in" source "package/cache-calibrator/Config.in" diff --git a/package/bcc/0001-CMake-add-an-option-to-disable-luajit-support.patch b/package/bcc/0001-CMake-add-an-option-to-disable-luajit-support.patch new file mode 100644 index 0000000000..93d3e16a7f --- /dev/null +++ b/package/bcc/0001-CMake-add-an-option-to-disable-luajit-support.patch @@ -0,0 +1,45 @@ +From b61c5eb0b2c385a6d3bbabf2396cb363588b32ab Mon Sep 17 00:00:00 2001 +From: Romain Naour +Date: Sun, 6 Dec 2020 17:15:25 +0100 +Subject: [PATCH] CMake: add an option to disable luajit support + +bcc luajit support is optional and should be disabled +when luajit is not available. + +This option allow to explicitely disable luajit when +cross-compiling. + +Signed-off-by: Romain Naour +--- + CMakeLists.txt | 2 ++ + src/CMakeLists.txt | 2 ++ + 2 files changed, 4 insertions(+) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 74fe4f19..c87b28c4 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -40,6 +40,8 @@ option(ENABLE_LLVM_SHARED "Enable linking LLVM as a shared library" OFF) + option(ENABLE_CLANG_JIT "Enable Loading BPF through Clang Frontend" ON) + option(ENABLE_USDT "Enable User-level Statically Defined Tracing" ON) + option(ENABLE_MAN "Build man pages" ON) ++cmake_dependent_option(ENABLE_LUAJIT "Use Luajit" ON "ENABLE_CLANG_JIT" OFF) ++ + CMAKE_DEPENDENT_OPTION(ENABLE_CPP_API "Enable C++ API" ON "ENABLE_USDT" OFF) + + set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 37b7e289..78c5fe58 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -17,5 +17,7 @@ add_subdirectory(cc) + endif() + if(ENABLE_CLANG_JIT) + add_subdirectory(python) ++if(ENABLE_LUAJIT) + add_subdirectory(lua) + endif() ++endif() +-- +2.25.4 + diff --git a/package/bcc/0002-python-CMakeLists.txt-Fix-python-installation-path.patch b/package/bcc/0002-python-CMakeLists.txt-Fix-python-installation-path.patch new file mode 100644 index 0000000000..507a5aced7 --- /dev/null +++ b/package/bcc/0002-python-CMakeLists.txt-Fix-python-installation-path.patch @@ -0,0 +1,34 @@ +From 15d8445905b6023eb369083392dd1018d31e9664 Mon Sep 17 00:00:00 2001 +From: Qais Yousef +Date: Fri, 18 Dec 2020 16:36:15 +0000 +Subject: [PATCH] python/CMakeLists.txt: Fix python installation path + +The check for /etc/debian_version is unfriendly to cross build +environment like buildroot. It tries to identify the distro of the host, +but since we're in cross build environment this obviously breaks. + +Remove this check for now. + +Signed-off-by: Qais Yousef +--- + src/python/CMakeLists.txt | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/src/python/CMakeLists.txt b/src/python/CMakeLists.txt +index fa602397..797e0d14 100644 +--- a/src/python/CMakeLists.txt ++++ b/src/python/CMakeLists.txt +@@ -5,10 +5,6 @@ if(NOT PYTHON_CMD) + set(PYTHON_CMD "python") + endif() + +-if(EXISTS "/etc/debian_version") +- set(PYTHON_FLAGS "${PYTHON_FLAGS} --install-layout deb") +-endif() +- + file(GLOB_RECURSE PYTHON_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.py) + file(GLOB_RECURSE PYTHON_INCLUDES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} +-- +2.25.1 + diff --git a/package/bcc/Config.in b/package/bcc/Config.in new file mode 100644 index 0000000000..087d0cb932 --- /dev/null +++ b/package/bcc/Config.in @@ -0,0 +1,39 @@ +config BR2_PACKAGE_BCC + bool "bcc" + depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS + depends on BR2_TOOLCHAIN_USES_GLIBC # hardcode GNU tuple (x86_64-unknown-linux-gnu) + depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 # clang + depends on BR2_INSTALL_LIBSTDCPP # clang + select BR2_PACKAGE_BUSYBOX_SHOW_OTHERS # to select tar package + select BR2_PACKAGE_CLANG + select BR2_PACKAGE_ELFUTILS + select BR2_PACKAGE_FLEX # needs FlexLexer.h + select BR2_PACKAGE_LLVM_BPF + select BR2_PACKAGE_PYTHON3 + select BR2_PACKAGE_TAR # Decompress kernel headers required by BCC + help + BPF Compiler Collection (BCC) + + BCC is a toolkit for creating efficient kernel tracing and + manipulation programs, and includes several useful tools and + examples. It makes use of extended BPF (Berkeley Packet + Filters), formally known as eBPF, a new feature that was + first added to Linux 3.15. Much of what BCC uses requires + Linux 4.1 and above. + + Note: Before using bcc, you need either need to : + - For kernel_ver = [4.1, 5.2) : Copy kernel source code + to target folder /lib/module//build. + - Or kernel_ver >= 5.2 : Compile kernel with CONFIG_IKHEADERS + and use generated headers under /sys/kernel/kheaders.tar.xz + to populate /lib/module//build. + + That's because the clang frontend build eBPF code at runtime. + + https://github.com/iovisor/bcc + http://www.ebpf.io + +comment "bcc needs a glibc toolchain, C++, gcc >= 4.8, host gcc >= 4.8" + depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS + depends on !BR2_TOOLCHAIN_USES_GLIBC || !BR2_INSTALL_LIBSTDCPP \ + || !BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 diff --git a/package/bcc/bcc.hash b/package/bcc/bcc.hash new file mode 100644 index 0000000000..a9ca0a36cd --- /dev/null +++ b/package/bcc/bcc.hash @@ -0,0 +1,3 @@ +# locally calculated +sha256 7a3ef28a493dcd7ee0797ebca8f13b30ffca08efc93ff73ff8fa9ba0234d7947 bcc-v0.17.0.tar.gz +sha256 b40930bbcf80744c86c46a12bc9da056641d722716c378f5659b9e555ef833e1 LICENSE.txt diff --git a/package/bcc/bcc.mk b/package/bcc/bcc.mk new file mode 100644 index 0000000000..bafa9e2096 --- /dev/null +++ b/package/bcc/bcc.mk @@ -0,0 +1,43 @@ +################################################################################ +# +# bcc +# +################################################################################ + +BCC_VERSION = v0.17.0 +BCC_SITE = https://github.com/iovisor/bcc.git +BCC_SITE_METHOD = git +BCC_GIT_SUBMODULES = YES +BCC_LICENSE = Apache-2.0 +BCC_LICENSE_FILES = LICENSE.txt +# libbcc.so and libbcc_bpf.so +BCC_INSTALL_STAGING = YES +BCC_DEPENDENCIES = host-bison host-flex clang elfutils flex llvm python3 tar + +# ENABLE_LLVM_SHARED=ON to use llvm.so. +# Force REVISION otherwise bcc will use git describe to generate a version number. +BCC_CONF_OPTS = -DENABLE_LLVM_SHARED=ON \ + -DREVISION=$(BCC_VERSION) \ + -DENABLE_CLANG_JIT=ON \ + -DENABLE_MAN=OFF \ + -DENABLE_LUAJIT=OFF + +define BCC_LINUX_CONFIG_FIXUPS + # Enable kernel support for eBPF + $(call KCONFIG_ENABLE_OPT,CONFIG_BPF) + $(call KCONFIG_ENABLE_OPT,CONFIG_BPF_SYSCALL) + $(call KCONFIG_ENABLE_OPT,CONFIG_NET_CLS_BPF) + $(call KCONFIG_ENABLE_OPT,CONFIG_NET_ACT_BPF) + $(call KCONFIG_ENABLE_OPT,CONFIG_BPF_JIT) + # [for Linux kernel versions 4.1 through 4.6] + $(call KCONFIG_ENABLE_OPT,CONFIG_HAVE_BPF_JIT) + # [for Linux kernel versions 4.7 and later] + $(call KCONFIG_ENABLE_OPT,CONFIG_HAVE_EBPF_JIT) + $(call KCONFIG_ENABLE_OPT,CONFIG_BPF_EVENTS) + # [for Linux kernel versions 5.2 and later] + $(call KCONFIG_ENABLE_OPT,CONFIG_IKHEADERS) + # bcc needs debugfs at runtime + $(call KCONFIG_ENABLE_OPT,CONFIG_DEBUG_FS) +endef + +$(eval $(cmake-package)) From patchwork Sun Dec 20 15:12:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain Naour X-Patchwork-Id: 1418824 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=FVwLHH2W; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CzR2c5b6Dz9sWF for ; Mon, 21 Dec 2020 02:13:59 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 8818D8754C; Sun, 20 Dec 2020 15:13:53 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IruEeDEnufvZ; Sun, 20 Dec 2020 15:13:52 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id EFA1A87530; Sun, 20 Dec 2020 15:13:51 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 253911BF5A0 for ; Sun, 20 Dec 2020 15:13:50 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id EDA27204AF for ; Sun, 20 Dec 2020 15:13:49 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id usLmv2SsxYxt for ; Sun, 20 Dec 2020 15:12:10 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) by silver.osuosl.org (Postfix) with ESMTPS id E89FF2037A for ; Sun, 20 Dec 2020 15:12:09 +0000 (UTC) Received: by mail-wm1-f52.google.com with SMTP id r4so8193377wmh.5 for ; Sun, 20 Dec 2020 07:12:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BclJIHxKgn0TekbCw+KQf3S4olWHgGQqptd4Zh3UFxc=; b=FVwLHH2WXD7FwbbnuON22Dy7pw7jls3qmGK8fQ1+BN0YE3LpEgwh8vnElm48RGSnQh 0YcRsrKZrxHcosMDOUWl1m4jbDYyDVKeYvFtlI7I0RIKqmeJr3nsLZ5V5jj5OW2/1Xl1 hIulWUBr43PTxJXCDm83xII2WW+j5+pmAcnvbMY1LMRjEgR0X27m8WhlTRxQOLI/T4vS HknHbAkbHXZfxz5eoG1tiDpX2RoyQvCk9ciluvjVQCixBYkJKmcYT8UB82Dj+CqdXA+a QqGaZdwOSf5a7E3OBLKq5PyIB1TJ7tZ5oKUy3UpVCj8XrlTqEt5Nn5yNxD7doUSvIl/D LlLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BclJIHxKgn0TekbCw+KQf3S4olWHgGQqptd4Zh3UFxc=; b=nDS3GggaPwJBbfAksg+d1nO9pLC1F7HOkCKzNt0mRYS3tNKx5js3oBpR2P20Qfr39q VFvy2EuJ1vZOy3bn4a4RCYUPjaTRMr/gPGRTkcAUBJH6BQDUU4t7Yi9FOEfd8mjjX9ee Y52DXlt1SoFDOnL96qwCpzqvAehXHa+2hixUQnHFs6vTFqga+4/F5LxUXIjcmIC/XE/z sCX7nsXMnoodLa3EPB40f+/jeaFjrtHPbNaPPXOPzia+MHwmmxCBXzvibMZT0iPf+pks XPr+h/g4LKsuwr+wu4jSKqAmupF8azqJFXrkulTP6KOcodROFX2r7PoS52rnVoSUS8E+ LmRw== X-Gm-Message-State: AOAM532lDbgrS6sWAN8QO4BZeTmSaz/q9uiOCvbKDDoAwefCuG+1HEVA hUQojS/5oEgShIABGk3dJHSThklgq0qU+A== X-Google-Smtp-Source: ABdhPJzqqiHjwTz3Izrn34WFxKNWytCDxEaakBW+x0ZTPNX9Nq9n7w77F0W3KLKsIy5waVkJUOWdaw== X-Received: by 2002:a1c:7d58:: with SMTP id y85mr2598627wmc.50.1608477128388; Sun, 20 Dec 2020 07:12:08 -0800 (PST) Received: from atlas.home (2a01cb058f8a18003dbee9eed79eb521.ipv6.abo.wanadoo.fr. [2a01:cb05:8f8a:1800:3dbe:e9ee:d79e:b521]) by smtp.gmail.com with ESMTPSA id l8sm20504080wmf.35.2020.12.20.07.12.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Dec 2020 07:12:07 -0800 (PST) From: Romain Naour To: buildroot@buildroot.org Date: Sun, 20 Dec 2020 16:12:01 +0100 Message-Id: <20201220151203.2206747-3-romain.naour@gmail.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20201220151203.2206747-1-romain.naour@gmail.com> References: <20201220151203.2206747-1-romain.naour@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCHv6 3/5] package/libbpf: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jugurtha BELKALEM , Romain Naour , Qais Yousef Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" A mirror of bpf-next linux tree bpf-next/tools/lib/bpf directory plus its supporting header files. The version of the package reflects the version of ABI. Signed-off-by: Jugurtha BELKALEM Signed-off-by: Romain Naour Cc: Qais Yousef Reviewed-by: Qais Yousef --- I'm not sure if updating the bpf.h provided by the toolchain linux-headers is the right things to do. v6: Update DEVELOPERS file --- DEVELOPERS | 1 + package/Config.in | 1 + package/libbpf/Config.in | 20 ++++++++++++++++++++ package/libbpf/libbpf.mk | 40 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 62 insertions(+) create mode 100644 package/libbpf/Config.in create mode 100644 package/libbpf/libbpf.mk diff --git a/DEVELOPERS b/DEVELOPERS index 681c4e18db..00e12af974 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -2249,6 +2249,7 @@ F: package/glibc/ F: package/irrlicht/ F: package/liblinear/ F: package/lensfun/ +F: package/libbpf/ F: package/libclc/ F: package/libgta/ F: package/libspatialindex/ diff --git a/package/Config.in b/package/Config.in index c04392126c..4dc27694d1 100644 --- a/package/Config.in +++ b/package/Config.in @@ -107,6 +107,7 @@ menu "Debugging, profiling and benchmark" source "package/kvm-unit-tests/Config.in" source "package/kyua/Config.in" source "package/latencytop/Config.in" + source "package/libbpf/Config.in" source "package/lmbench/Config.in" source "package/lsof/Config.in" source "package/ltp-testsuite/Config.in" diff --git a/package/libbpf/Config.in b/package/libbpf/Config.in new file mode 100644 index 0000000000..c5b24c5eb5 --- /dev/null +++ b/package/libbpf/Config.in @@ -0,0 +1,20 @@ +config BR2_PACKAGE_LIBBPF + bool "libbpf" + depends on BR2_USE_WCHAR # elfutils + depends on !BR2_STATIC_LIBS # elfutils + depends on BR2_TOOLCHAIN_HAS_THREADS # elfutils + depends on BR2_TOOLCHAIN_USES_UCLIBC || BR2_TOOLCHAIN_USES_GLIBC # elfutils + select BR2_PACKAGE_ELFUTILS + select BR2_PACKAGE_ZLIB + help + libbpf library. + A mirror of bpf-next linux tree bpf-next/tools/lib/bpf + directory plus its supporting header files. The version + of the package reflects the version of ABI. + + https://github.com/libbpf/libbpf + +comment "libbpf needs a uClibc or glibc toolchain w/ wchar, dynamic library, threads" + depends on !BR2_USE_WCHAR || BR2_STATIC_LIBS \ + || !BR2_TOOLCHAIN_HAS_THREADS \ + || !(BR2_TOOLCHAIN_USES_UCLIBC || BR2_TOOLCHAIN_USES_GLIBC) diff --git a/package/libbpf/libbpf.mk b/package/libbpf/libbpf.mk new file mode 100644 index 0000000000..33e303db16 --- /dev/null +++ b/package/libbpf/libbpf.mk @@ -0,0 +1,40 @@ +################################################################################ +# +# libbpf +# +################################################################################ + +LIBBPF_VERSION = 0.2 +LIBBPF_SITE = $(call github,libbpf,libbpf,v$(LIBBPF_VERSION)) +LIBBPF_LICENSE = GPL-2.0, LGPL-2.1, BSD-2-Clause +LIBBPF_LICENSE_FILES = LICENSE LICENSE.BSD-2-Clause LICENSE.LPGL-2.1 +LIBBPF_DEPENDENCIES = host-bison host-flex host-pkgconf elfutils zlib +LIBBPF_INSTALL_STAGING = YES + +define LIBBPF_BUILD_CMDS + $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) \ + -C $(@D)/src +endef + +# bpf/bpf.h installed by libbpf use enm bpf_iter_link_info that was added since +# kernel 5.9, so we need to update some uapi headers in STAGING_DIR if the +# toolchain is build with linux-headers < 5.9. +# Otherwise bpf/bpf.h is broken due to out of date linux/bpf.h installed by the +# toolchain. +# https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=a5cbe05a6673b85bed2a63ffcfea6a96c6410cff +ifeq ($(BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_9),) +LIBBPF_UPDATE_UAPI_HEADERS = install_uapi_headers +endif + +define LIBBPF_INSTALL_STAGING_CMDS + $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) \ + -C $(@D)/src install $(LIBBPF_UPDATE_UAPI_HEADERS) \ + DESTDIR=$(STAGING_DIR) +endef + +define LIBBPF_INSTALL_TARGET_CMDS + $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) \ + -C $(@D)/src install DESTDIR=$(TARGET_DIR) +endef + +$(eval $(generic-package)) From patchwork Sun Dec 20 15:12:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain Naour X-Patchwork-Id: 1418825 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=PWvb1QXz; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CzR2d5T1hz9sWF for ; Mon, 21 Dec 2020 02:14:01 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id AA66A86B5B; Sun, 20 Dec 2020 15:13:58 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iMiKv_HFD9nZ; Sun, 20 Dec 2020 15:13:56 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 24C878690E; Sun, 20 Dec 2020 15:13:56 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id EEE9A1BF5A0 for ; Sun, 20 Dec 2020 15:13:54 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id E30AF204A5 for ; Sun, 20 Dec 2020 15:13:54 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uzQT6RYNknuK for ; Sun, 20 Dec 2020 15:13:50 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) by silver.osuosl.org (Postfix) with ESMTPS id 98009203DF for ; Sun, 20 Dec 2020 15:12:11 +0000 (UTC) Received: by mail-wm1-f48.google.com with SMTP id n16so8750265wmc.0 for ; Sun, 20 Dec 2020 07:12:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7J4nSJLndJ+kXwfnlExzvJyvDymzt77Ns0KH2wilt2M=; b=PWvb1QXzA8JACGn9suzF3fybUV1bIO6PUEJCtrJzT9WIuqVf0yM3uH13r89zZnYeGv sWsoQXQpg2JNjImTLU7N4WhCSdzUtxeIqNeP3pbzQXBWVdCoQqzvvDjV57on7a8vyPjj UV1VKXR6ADWlAtjSHxx9lK+n7fuc9zjfqq43z9vjhi76jxzmHed31Zl3Tqa3jMhjMAmR wg+TH4W6wEr4iNHm2c+Przm/HWA/D40mci3ZsNnuJ2hBSod2lQ8/sd79uydd5I1TXrJX UkVI10nDz7PAG/K0Fu03zEvzcZQeVRJAi26gFIeJe0p83XlJbfAJuD1g+xYIUG7CDeqM akGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7J4nSJLndJ+kXwfnlExzvJyvDymzt77Ns0KH2wilt2M=; b=W3N7esMix8BR6sM8fCoHts36Dj2Fj+5zD/aqZmfaZ/rsnXyKxRWip/JtfeFYYiZ0ad h0YaMRzVGQpS4ld3BW4SEG44GNaN7w1YXh/xhelaIV//ljjWHspLEJ6WWA7OQMiDYtUX 6hOiT7nSgNjSjmNzIDVGpn/mp946Rc7/tTcBoYrdttaaR9zdns+CVM1IfVOk4Cx6L8k+ a0s0ncKhSKgzhuFnaPIZgt8ZPpMU+m75D/5JZAbYz9jcB0KdUEMSb2r4fZOZQdAbXF+e KIEVj5q7UhrAx/G1HR//kw2YQHnWGHhutmzJ612wCP8QbuEPI1wotCnSQ5AFgWfkPeI7 /vCA== X-Gm-Message-State: AOAM5302PgsnnavlnmWxdgvTnhIP81Mo0WlxCV/gFzv04zHpj1+BzPE/ fUpLDssJiafoiySGuSLT7JFc8nJ2VUc8Iw== X-Google-Smtp-Source: ABdhPJyrdLHzsVSAq0WD63jNVDesT7ONfnsQW9jlh5A8wDrZrppB+87sKBNa8SU01jjNvUP4FqphoA== X-Received: by 2002:a1c:9d85:: with SMTP id g127mr12526627wme.118.1608477130021; Sun, 20 Dec 2020 07:12:10 -0800 (PST) Received: from atlas.home (2a01cb058f8a18003dbee9eed79eb521.ipv6.abo.wanadoo.fr. [2a01:cb05:8f8a:1800:3dbe:e9ee:d79e:b521]) by smtp.gmail.com with ESMTPSA id l8sm20504080wmf.35.2020.12.20.07.12.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Dec 2020 07:12:09 -0800 (PST) From: Romain Naour To: buildroot@buildroot.org Date: Sun, 20 Dec 2020 16:12:02 +0100 Message-Id: <20201220151203.2206747-4-romain.naour@gmail.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20201220151203.2206747-1-romain.naour@gmail.com> References: <20201220151203.2206747-1-romain.naour@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCHv6 4/5] package/bpftrace: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jugurtha BELKALEM , Romain Naour , Qais Yousef Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Qais Yousef bpftrace is a high-level tracing language for Linux enhanced Berkeley Packet Filter (eBPF) available in recent Linux kernels (4.x). Only tested on x86_64 and aarch64. The package doesn't support i386 and aarch32. The libbpf dependency allow to enable the BTF support: # bpftrace --info System OS: Linux 5.4.58 #1 SMP Sun Dec 20 15:56:56 CET 2020 Arch: aarch64 Build version: 2020.11-328-g019a9 LLVM: 9.0.1 foreach_sym: yes unsafe uprobe: no bfd: yes bpf_attach_kfunc: yes bcc_usdt_addsem: yes bcc bpf_attach_uprobe refcount: yes libbpf: yes libbpf btf dump: yes libbpf btf dump type decl: yes bfptrace doesn't use the libbpf_bcc library provided by bcc package. Signed-off-by: Qais Yousef Signed-off-by: Romain Naour Cc: Jugurtha BELKALEM --- v6: Update DEVELOPERS file v2: patch to build bundled libraries statically Add glibc dependency Rework to select bcc, libbpf and llvm RTII dependencies. Add reverse dependencies Add BR2_PACKAGE_BPFTRACE_ARCH_SUPPORTS Bump the version to the latest (upcoming 0.12) due to many build issues (and patch to backport) with the latest release. Add binutils optional dependency to provide libbfd and libopcodes. Disable manpages. --- DEVELOPERS | 4 ++ package/Config.in | 1 + ...resources-parser-as-static-libraries.patch | 71 +++++++++++++++++++ package/bpftrace/Config.in | 40 +++++++++++ package/bpftrace/bpftrace.hash | 3 + package/bpftrace/bpftrace.mk | 21 ++++++ 6 files changed, 140 insertions(+) create mode 100644 package/bpftrace/0001-cmake-link-ast-resources-parser-as-static-libraries.patch create mode 100644 package/bpftrace/Config.in create mode 100644 package/bpftrace/bpftrace.hash create mode 100644 package/bpftrace/bpftrace.mk diff --git a/DEVELOPERS b/DEVELOPERS index 00e12af974..793137b798 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -2159,6 +2159,9 @@ F: package/libdvbpsi/ F: package/mraa/ F: package/synergy/ +N: Qais Yousef +F: package/bpftrace/ + N: Rafal Susz F: board/avnet/s6lx9_microboard/ F: configs/s6lx9_microboard_defconfig @@ -2236,6 +2239,7 @@ F: package/alure/ F: package/aubio/ F: package/bcc/ F: package/binutils/ +F: package/bpftrace/ F: package/bullet/ F: package/clang/ F: package/clinfo/ diff --git a/package/Config.in b/package/Config.in index 4dc27694d1..6a40e17303 100644 --- a/package/Config.in +++ b/package/Config.in @@ -86,6 +86,7 @@ menu "Debugging, profiling and benchmark" source "package/bcc/Config.in" source "package/blktrace/Config.in" source "package/bonnie/Config.in" + source "package/bpftrace/Config.in" source "package/cache-calibrator/Config.in" source "package/clinfo/Config.in" source "package/dacapo/Config.in" diff --git a/package/bpftrace/0001-cmake-link-ast-resources-parser-as-static-libraries.patch b/package/bpftrace/0001-cmake-link-ast-resources-parser-as-static-libraries.patch new file mode 100644 index 0000000000..d99b97c3a4 --- /dev/null +++ b/package/bpftrace/0001-cmake-link-ast-resources-parser-as-static-libraries.patch @@ -0,0 +1,71 @@ +From 960d2b69975462e445733482ac8d6ea319d3c5b2 Mon Sep 17 00:00:00 2001 +From: Romain Naour +Date: Thu, 5 Nov 2020 01:19:54 +0100 +Subject: [PATCH] cmake: link ast, resources parser as static libraries + +Signed-off-by: Romain Naour +--- + CMakeLists.txt | 2 +- + resources/CMakeLists.txt | 2 +- + src/arch/CMakeLists.txt | 8 ++++---- + src/ast/CMakeLists.txt | 2 +- + 4 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d732d23..4ebd3ce 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -91,7 +91,7 @@ find_package(FLEX REQUIRED) + bison_target(bison_parser src/parser.yy ${CMAKE_BINARY_DIR}/parser.tab.cc VERBOSE) + flex_target(flex_lexer src/lexer.l ${CMAKE_BINARY_DIR}/lex.yy.cc) + add_flex_bison_dependency(flex_lexer bison_parser) +-add_library(parser ${BISON_bison_parser_OUTPUTS} ${FLEX_flex_lexer_OUTPUTS}) ++add_library(parser STATIC ${BISON_bison_parser_OUTPUTS} ${FLEX_flex_lexer_OUTPUTS}) + target_compile_options(parser PRIVATE "-w") + target_include_directories(parser PUBLIC src src/ast ${CMAKE_BINARY_DIR}) + +diff --git a/resources/CMakeLists.txt b/resources/CMakeLists.txt +index a95c60a..2b05a68 100644 +--- a/resources/CMakeLists.txt ++++ b/resources/CMakeLists.txt +@@ -1,4 +1,4 @@ +-add_library(resources headers.cpp) ++add_library(resources STATIC headers.cpp) + + target_include_directories(resources PUBLIC ../src) + +diff --git a/src/arch/CMakeLists.txt b/src/arch/CMakeLists.txt +index a26c1c8..fca9a6b 100644 +--- a/src/arch/CMakeLists.txt ++++ b/src/arch/CMakeLists.txt +@@ -1,13 +1,13 @@ + if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64") +- add_library(arch aarch64.cpp) ++ add_library(arch STATIC aarch64.cpp) + elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "ppc64" OR + CMAKE_SYSTEM_PROCESSOR STREQUAL "ppc64le") +- add_library(arch ppc64.cpp) ++ add_library(arch STATIC ppc64.cpp) + elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "s390" OR + CMAKE_SYSTEM_PROCESSOR STREQUAL "s390x") +- add_library(arch s390.cpp) ++ add_library(arch STATIC s390.cpp) + elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") +- add_library(arch x86_64.cpp) ++ add_library(arch STATIC x86_64.cpp) + else() + message(FATAL_ERROR "Unsupported architecture: ${CMAKE_SYSTEM_PROCESSOR}") + endif() +diff --git a/src/ast/CMakeLists.txt b/src/ast/CMakeLists.txt +index 649bf0a..477d809 100644 +--- a/src/ast/CMakeLists.txt ++++ b/src/ast/CMakeLists.txt +@@ -1,4 +1,4 @@ +-add_library(ast ++add_library(ast STATIC + ast.cpp + attachpoint_parser.cpp + codegen_llvm.cpp +-- +2.25.4 + diff --git a/package/bpftrace/Config.in b/package/bpftrace/Config.in new file mode 100644 index 0000000000..f627725afe --- /dev/null +++ b/package/bpftrace/Config.in @@ -0,0 +1,40 @@ +config BR2_PACKAGE_BPFTRACE_ARCH_SUPPORTS + bool + default y if BR2_aarch64 || BR2_aarch64_be + default y if BR2_x86_64 + +config BR2_PACKAGE_BPFTRACE + bool "bpftrace" + depends on BR2_PACKAGE_BPFTRACE_ARCH_SUPPORTS + depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS # bcc + depends on BR2_TOOLCHAIN_USES_GLIBC # bcc + depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 # bcc, clang + depends on BR2_INSTALL_LIBSTDCPP # bcc, clang + select BR2_PACKAGE_BCC + select BR2_PACKAGE_LIBBPF + # LLVM RTTI mendatory: https://github.com/iovisor/bpftrace/issues/1156 + select BR2_PACKAGE_LLVM_RTTI + help + bpftrace is a high-level tracing language for Linux enhanced + Berkeley Packet Filter (eBPF) available in recent Linux + kernels (4.x). + + bpftrace uses LLVM as a backend to compile scripts to + BPF-bytecode and makes use of BCC for interacting with the + Linux BPF system, as well as existing Linux tracing + capabilities: kernel dynamic tracing (kprobes), user-level + dynamic tracing (uprobes), and tracepoints. The bpftrace + language is inspired by awk and C, and predecessor tracers + such as DTrace and SystemTap. + + It's highly recommended to NOT strip bpftrace binary. + To do so, add "bpftrace" to BR2_STRIP_EXCLUDE_FILES. + See: + https://bugzilla.redhat.com/show_bug.cgi?id=1865787 + + https://www.github.com/iovisor/bpftrace + +comment "bpftrace needs a glibc toolchain w/ C++, gcc >= 4.8" + depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS + depends on !BR2_TOOLCHAIN_USES_GLIBC || !BR2_INSTALL_LIBSTDCPP \ + || !BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 diff --git a/package/bpftrace/bpftrace.hash b/package/bpftrace/bpftrace.hash new file mode 100644 index 0000000000..b48d9555fd --- /dev/null +++ b/package/bpftrace/bpftrace.hash @@ -0,0 +1,3 @@ +# locally calculated +sha256 cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30 LICENSE +sha256 1f08661bac9dfa7d3d76b54b3b4d1738b02c3847049da90a5cff25093a9dc9c9 bpftrace-487dd815bfe4a24908950552f35ef17d6653b2f8.tar.gz diff --git a/package/bpftrace/bpftrace.mk b/package/bpftrace/bpftrace.mk new file mode 100644 index 0000000000..0d8640a184 --- /dev/null +++ b/package/bpftrace/bpftrace.mk @@ -0,0 +1,21 @@ +################################################################################ +# +# bpftrace +# +################################################################################ + +# upcoming 0.12 version. +BPFTRACE_VERSION = 487dd815bfe4a24908950552f35ef17d6653b2f8 +BPFTRACE_SITE = $(call github,iovisor,bpftrace,$(BPFTRACE_VERSION)) +BPFTRACE_LICENSE = Apache-2.0 +BPFTRACE_LICENSE_FILES = LICENSE +BPFTRACE_DEPENDENCIES = host-bison host-flex bcc libbpf llvm + +# libbfd, libopcodes +ifeq ($(BR2_PACKAGE_BINUTILS),y) +BPFTRACE_DEPENDENCIES += binutils +endif + +BPFTRACE_CONF_OPTS += -DENABLE_MAN=OFF + +$(eval $(cmake-package)) From patchwork Sun Dec 20 15:12:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain Naour X-Patchwork-Id: 1418822 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=KfXyDW0Z; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CzR0k0r96z9sWQ for ; Mon, 21 Dec 2020 02:12:19 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id B10B986D9A; Sun, 20 Dec 2020 15:12:16 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xheK8Q7BrcPW; Sun, 20 Dec 2020 15:12:15 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id A3E0A86B05; Sun, 20 Dec 2020 15:12:15 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id BD2DB1BF5A0 for ; Sun, 20 Dec 2020 15:12:13 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id B99FF86B05 for ; Sun, 20 Dec 2020 15:12:13 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id llKi0GHE2H60 for ; Sun, 20 Dec 2020 15:12:13 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) by whitealder.osuosl.org (Postfix) with ESMTPS id ADF5B86B03 for ; Sun, 20 Dec 2020 15:12:12 +0000 (UTC) Received: by mail-wm1-f44.google.com with SMTP id q75so8221247wme.2 for ; Sun, 20 Dec 2020 07:12:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=M4PcV1PqyeGUqp0Be6xSDtB3JXuL7fQv7ApbgNhE45c=; b=KfXyDW0ZHxi9fduvP41Xe2/4oPM6ANZk6g/VPkIVIesWLzvHc+Y5O9bD4I5PA9zOg9 UhrxWmD+p3cZ0L19ZR+LDMV7F8igIRozMuatEhMKAYI8jZuhNUL5Wl5ZTpy4Tl79O86j Hxue/3RSYih22CXWnGbepYtmyAM30RKshdILS0WmmXFMzReS+mGaIO3SmhjT1YzAsvU1 6nW1kvzkIAuogNyBUFTbrhQ2PaHqpYqL23hcSBu3enk9zicS7nyJ39mgDxJpLbkGfCV0 dyr59wyNrh4Nd9Fs5K6BO4ZQ+5E1ggRGir2H22BZ2RzRxTBxAk8Lkc7lNrk89BDC+Sjt T2Ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=M4PcV1PqyeGUqp0Be6xSDtB3JXuL7fQv7ApbgNhE45c=; b=Qfy2Ma7CeIZccmZr8VlbbKTQkhkmLY54zKsIbe4N0QYBlctvYiC7rDfOQAyEVTkSTc zXrgI9th4ZCGM2NVtpP7fBrclTFasZxNT3xvbyjFK64fs+6SJDQvq0zFZuorA2Uh7bQT YLnpjOR4LtBFn9Uz1UBmj9N4TCaBdt47UoEbNS76gqwrLMFsknwyL3XygGn04IYX7Vr4 WtAA+dyLMQ1uh7DpBvnCJJd9FHZUK3pAFet+tbeSKmcEnHrg7L14Pumx/K7fJXPWXiGC ZUjmLNPI10Zaf8PaxZsVm+0kTwQYzVjdcH02BL1zwo8ZXpuUoegfLGufafTAfNWbBMXE fLTw== X-Gm-Message-State: AOAM530Ho2H2KIFJPptwkpUH3jnM8JgELaoFoMb4ouLn61ffubBqzske qOpxkRmSJ7XZkdykQsKpJee3EWD45YXJkw== X-Google-Smtp-Source: ABdhPJw3eMALBVvlanqjWhRIEQbhviloV7qQqo4eMyPxTzj14z/Z3G161P4a2JmFHXdJXdJRFCDteg== X-Received: by 2002:a1c:356:: with SMTP id 83mr2843145wmd.31.1608477131290; Sun, 20 Dec 2020 07:12:11 -0800 (PST) Received: from atlas.home (2a01cb058f8a18003dbee9eed79eb521.ipv6.abo.wanadoo.fr. [2a01:cb05:8f8a:1800:3dbe:e9ee:d79e:b521]) by smtp.gmail.com with ESMTPSA id l8sm20504080wmf.35.2020.12.20.07.12.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Dec 2020 07:12:10 -0800 (PST) From: Romain Naour To: buildroot@buildroot.org Date: Sun, 20 Dec 2020 16:12:03 +0100 Message-Id: <20201220151203.2206747-5-romain.naour@gmail.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20201220151203.2206747-1-romain.naour@gmail.com> References: <20201220151203.2206747-1-romain.naour@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCHv6 5/5] package/bcc: add optional luajit dependency X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Romain Naour , Qais Yousef Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" The luajit dependency was explicitely disabled when bcc has been added to Buildroot. Even if the python binding is probably more used, enable luajit binding if luajit package is enabled in the defconfig. Fix the luajit command line used to build bcc.o, otherwise bcc.o is build for the host. Signed-off-by: Romain Naour Cc: Qais Yousef --- .../bcc/0003-fix-aarch64-cross-compile.patch | 65 +++++++++++++++++++ package/bcc/bcc.mk | 10 ++- 2 files changed, 73 insertions(+), 2 deletions(-) create mode 100644 package/bcc/0003-fix-aarch64-cross-compile.patch diff --git a/package/bcc/0003-fix-aarch64-cross-compile.patch b/package/bcc/0003-fix-aarch64-cross-compile.patch new file mode 100644 index 0000000000..6b4279754c --- /dev/null +++ b/package/bcc/0003-fix-aarch64-cross-compile.patch @@ -0,0 +1,65 @@ +From 5a5b0f04484e00c88e7be902101367d6d591fb96 Mon Sep 17 00:00:00 2001 +From: Jugurtha BELKALEM +Date: Thu, 2 May 2019 11:06:23 +0200 +Subject: [PATCH] cmake/luajit: Provide the target architecture to luaJIT while + cross-compiling + +Unlike CMAKE_SYSTEM_PROCESSOR which identifies aarch64 +as a valid architecture, luajit does not recognize it. +luajit defines aarch64 as arm64. + +LuaJIT doesn't use usual arch naming, so we have to convert +between CMake and Luajit for each architectures while +cross-compiling. + +Signed-off-by: Jugurtha BELKALEM +Signed-off-by: Romain Naour +--- +v2: Do the same for other architecture supported by LuaJIT. +https://github.com/iovisor/bcc/pull/2480 +--- + src/lua/CMakeLists.txt | 29 ++++++++++++++++++++++++++++- + 1 file changed, 28 insertions(+), 1 deletion(-) + +diff --git a/src/lua/CMakeLists.txt b/src/lua/CMakeLists.txt +index 7541d48df..226e1b1d2 100644 +--- a/src/lua/CMakeLists.txt ++++ b/src/lua/CMakeLists.txt +@@ -13,9 +13,36 @@ if (LUAJIT_LIBRARIES AND LUAJIT) + DEPENDS ${SRC_LUA} ${CMAKE_CURRENT_SOURCE_DIR}/squishy + ) + ++ # LuaJIT doesn't use usual arch naming, so we have to convert ++ # between CMake and Luajit while cross-compiling. ++ if (CMAKE_CROSSCOMPILING) ++ SET (LUAJIT_TARGET_ARCH "-a") ++ # https://github.com/LuaJIT/LuaJIT/blob/f0e865dd4861520258299d0f2a56491bd9d602e1/src/jit/bcsave.lua#L30 ++ # https://github.com/LuaJIT/LuaJIT/blob/f0e865dd4861520258299d0f2a56491bd9d602e1/src/jit/bcsave.lua#L65 ++ if (CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64") ++ SET (LUAJIT_TARGET_ARCH ${LUAJIT_TARGET_ARCH} "arm64") ++ elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64_be") ++ SET (LUAJIT_TARGET_ARCH ${LUAJIT_TARGET_ARCH} "arm64be") ++ elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "arm") ++ SET (LUAJIT_TARGET_ARCH ${LUAJIT_TARGET_ARCH} "arm") ++ elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^(i.86)$") ++ SET (LUAJIT_TARGET_ARCH ${LUAJIT_TARGET_ARCH} "x86") ++ elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "mips") ++ SET (LUAJIT_TARGET_ARCH ${LUAJIT_TARGET_ARCH} "mips") ++ elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "mipsel") ++ SET (LUAJIT_TARGET_ARCH ${LUAJIT_TARGET_ARCH} "mipsel") ++ elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "powerpc") ++ SET (LUAJIT_TARGET_ARCH ${LUAJIT_TARGET_ARCH} "ppc") ++ elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") ++ SET (LUAJIT_TARGET_ARCH ${LUAJIT_TARGET_ARCH} "x64") ++ else() ++ MESSAGE(FATAL_ERROR "${CMAKE_SYSTEM_PROCESSOR} is not supported by LuaJIT") ++ endif() ++ endif() ++ + ADD_CUSTOM_COMMAND( + OUTPUT bcc.o +- COMMAND ${LUAJIT} -bg bcc.lua bcc.o ++ COMMAND ${LUAJIT} -bg bcc.lua ${LUAJIT_TARGET_ARCH} bcc.o + DEPENDS bcc.lua + ) + diff --git a/package/bcc/bcc.mk b/package/bcc/bcc.mk index bafa9e2096..8b6ba63f90 100644 --- a/package/bcc/bcc.mk +++ b/package/bcc/bcc.mk @@ -19,8 +19,14 @@ BCC_DEPENDENCIES = host-bison host-flex clang elfutils flex llvm python3 tar BCC_CONF_OPTS = -DENABLE_LLVM_SHARED=ON \ -DREVISION=$(BCC_VERSION) \ -DENABLE_CLANG_JIT=ON \ - -DENABLE_MAN=OFF \ - -DENABLE_LUAJIT=OFF + -DENABLE_MAN=OFF + +ifeq ($(BR2_PACKAGE_LUAJIT),y) +BCC_DEPENDENCIES += luajit +BCC_CONF_OPTS += -DENABLE_LUAJIT=ON +else +BCC_CONF_OPTS += -DENABLE_LUAJIT=OFF +endif define BCC_LINUX_CONFIG_FIXUPS # Enable kernel support for eBPF