From patchwork Wed Dec 22 17:49:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Francis Laniel X-Patchwork-Id: 1572272 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.a=rsa-sha256 header.s=default header.b=r0numt28; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=140.211.166.137; helo=smtp4.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JK16t4lPkz9s0r for ; Thu, 23 Dec 2021 04:49:42 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id E619B4023D; Wed, 22 Dec 2021 17:49:40 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id f2rlRfHeAk80; Wed, 22 Dec 2021 17:49:38 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id DFFA2402F6; Wed, 22 Dec 2021 17:49:37 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 8E2A41BF27E for ; Wed, 22 Dec 2021 17:49:26 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 893318278F for ; Wed, 22 Dec 2021 17:49:26 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp1.osuosl.org (amavisd-new); dkim=pass (1024-bit key) header.d=linux.microsoft.com Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IepRvnLu81Zz for ; Wed, 22 Dec 2021 17:49:25 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp1.osuosl.org (Postfix) with ESMTP id 76001826FF for ; Wed, 22 Dec 2021 17:49:25 +0000 (UTC) Received: from machine.home (lfbn-lyo-1-1484-111.w86-207.abo.wanadoo.fr [86.207.51.111]) by linux.microsoft.com (Postfix) with ESMTPSA id BE30620B717A; Wed, 22 Dec 2021 09:49:23 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com BE30620B717A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1640195364; bh=iLjh1RSaFNw+edZvpW8W7H7DV42GPmP6avp9mCEbVZs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r0numt28G3yJHSEtX1P+Jh1vEuu+B1gcsAPQAXVudeLc9VFhztk53Vmf/IJKXkDhG oMpRWzu3mLOMcsi24EF2qMExTDIOWkH01lSmutQxVnFDA0vMPWe5/HmDE5Jl3TXftQ OfsCHxm1D5wWKm1feTmmdB6Hou1Rqyyj3GHykd9U= From: Francis Laniel To: buildroot@buildroot.org Date: Wed, 22 Dec 2021 18:49:04 +0100 Message-Id: <20211222174905.71902-2-flaniel@linux.microsoft.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211222174905.71902-1-flaniel@linux.microsoft.com> References: <20211222174905.71902-1-flaniel@linux.microsoft.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v2 1/2] package/pahole: new host package X-BeenThere: buildroot@buildroot.org 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: Francis Laniel , Samuel Martin Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" pahole is a tool used to show data structure embedded in debugging information formats like DWARF. It is notably needed by the Linux kernel to generate BPF Type Format (BTF) information used by Compile Once - Run Everywhere (CO-RE) BPF tools. To be built, pahole needs __LIB to be set to lib at stated in its README. Signed-off-by: Francis Laniel --- DEVELOPERS | 3 +++ package/Config.in.host | 1 + package/pahole/Config.in.host | 6 ++++++ package/pahole/pahole.hash | 3 +++ package/pahole/pahole.mk | 18 ++++++++++++++++++ 5 files changed, 31 insertions(+) create mode 100644 package/pahole/Config.in.host create mode 100644 package/pahole/pahole.hash create mode 100644 package/pahole/pahole.mk diff --git a/DEVELOPERS b/DEVELOPERS index 64db6c51d0..70df957415 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -939,6 +939,9 @@ N: Floris Bos F: package/ipmitool/ F: package/odhcploc/ +N: Francis Laniel +F: package/pahole/ + N: Francisco Gonzalez F: package/ser2net/ diff --git a/package/Config.in.host b/package/Config.in.host index 6e5a5c5fc5..ae512c5643 100644 --- a/package/Config.in.host +++ b/package/Config.in.host @@ -60,6 +60,7 @@ menu "Host utilities" source "package/omap-u-boot-utils/Config.in.host" source "package/openocd/Config.in.host" source "package/opkg-utils/Config.in.host" + source "package/pahole/Config.in.host" source "package/parted/Config.in.host" source "package/patchelf/Config.in.host" source "package/pigz/Config.in.host" diff --git a/package/pahole/Config.in.host b/package/pahole/Config.in.host new file mode 100644 index 0000000000..e427629632 --- /dev/null +++ b/package/pahole/Config.in.host @@ -0,0 +1,6 @@ +config BR2_PACKAGE_HOST_PAHOLE + bool "host pahole" + help + Pahole and other DWARF utils. + + https://git.kernel.org/pub/scm/devel/pahole/pahole.git diff --git a/package/pahole/pahole.hash b/package/pahole/pahole.hash new file mode 100644 index 0000000000..9ee2ef9429 --- /dev/null +++ b/package/pahole/pahole.hash @@ -0,0 +1,3 @@ +# Locally computed +sha256 cde85af68b368f50a913be387f94f6b43612a04af6c92387b4dcabb712a668fe pahole-v1.23-br1.tar.gz +sha256 ab15fd526bd8dd18a9e77ebc139656bf4d33e97fc7238cd11bf60e2b9b8666c6 COPYING diff --git a/package/pahole/pahole.mk b/package/pahole/pahole.mk new file mode 100644 index 0000000000..26347cd8fd --- /dev/null +++ b/package/pahole/pahole.mk @@ -0,0 +1,18 @@ +######################################################################## +# +# pahole +# +######################################################################## + +PAHOLE_VERSION = v1.23 +PAHOLE_SITE = git://git.kernel.org/pub/scm/devel/pahole/pahole.git +PAHOLE_SITE_METHOD = git +# pahole contains git submodule and relies on them to be built. +PAHOLE_GIT_SUBMODULES = YES +HOST_PAHOLE_DEPENDENCIES = host-elfutils +# Defining __LIB is needed to build pahole. +HOST_PAHOLE_CONF_OPTS = -D__LIB=lib +PAHOLE_LICENSE = GPL-2.0 +PAHOLE_LICENSE_FILES = COPYING + +$(eval $(host-cmake-package)) From patchwork Wed Dec 22 17:49:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Francis Laniel X-Patchwork-Id: 1572274 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.a=rsa-sha256 header.s=default header.b=qD2zkBKa; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=140.211.166.137; helo=smtp4.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JK1772Q3Dz9s0r for ; Thu, 23 Dec 2021 04:49:55 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 9DE6E402F6; Wed, 22 Dec 2021 17:49:53 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bTexK-TqRpYB; Wed, 22 Dec 2021 17:49:51 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 08B4F41545; Wed, 22 Dec 2021 17:49:49 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 1D2DB1BF27E for ; Wed, 22 Dec 2021 17:49:28 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 0A5E040273 for ; Wed, 22 Dec 2021 17:49:28 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp2.osuosl.org (amavisd-new); dkim=pass (1024-bit key) header.d=linux.microsoft.com Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7B9NsnZeUUP6 for ; Wed, 22 Dec 2021 17:49:27 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp2.osuosl.org (Postfix) with ESMTP id 18A4540227 for ; Wed, 22 Dec 2021 17:49:26 +0000 (UTC) Received: from machine.home (lfbn-lyo-1-1484-111.w86-207.abo.wanadoo.fr [86.207.51.111]) by linux.microsoft.com (Postfix) with ESMTPSA id ABC7820B717A; Wed, 22 Dec 2021 09:49:25 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com ABC7820B717A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1640195366; bh=4csYjf4hIcVFkaodmLChJjECJ/Ob0vSV+2ZmgPwvJyw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qD2zkBKaa4dZUklBKHe8m67Atk05/wiBcnIiOtvRFX0U/teIGvZFhCnvQ1UjMRF14 FsTyF4Bqk8Xr0zfwEra5U0AfiyxHlCzrT2YXx2eQOSbho1BolGU8HQPvEcCCeRoFyy zchREnz+puHQxmATeZC1K4/GkMmSbWYjL6jtuG1Y= From: Francis Laniel To: buildroot@buildroot.org Date: Wed, 22 Dec 2021 18:49:05 +0100 Message-Id: <20211222174905.71902-3-flaniel@linux.microsoft.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211222174905.71902-1-flaniel@linux.microsoft.com> References: <20211222174905.71902-1-flaniel@linux.microsoft.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v2 2/2] linux: add BR2_LINUX_KERNEL_NEEDS_HOST_PAHOLE X-BeenThere: buildroot@buildroot.org 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: Francis Laniel , Samuel Martin Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" CONFIG_DEBUG_BTF_INFO relies on pahole, so kernel DWARF are converted to BTF. If CONFIG_DEBUG_BTF_INFO is set and BR2_LINUX_KERNEL_NEEDS_HOST_PAHOLE not, an error message is shown and .config is not written. Signed-off-by: Francis Laniel --- linux/Config.in | 12 ++++++++++++ linux/linux.mk | 12 ++++++++++++ package/pahole/Config.in.host | 2 ++ 3 files changed, 26 insertions(+) diff --git a/linux/Config.in b/linux/Config.in index 6c30100921..ef86cbc021 100644 --- a/linux/Config.in +++ b/linux/Config.in @@ -470,6 +470,18 @@ config BR2_LINUX_KERNEL_NEEDS_HOST_LIBELF CONFIG_UNWINDER_ORC=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel". +config BR2_LINUX_KERNEL_NEEDS_HOST_PAHOLE + bool "Needs host pahole" + help + Some Linux kernel configuration options (such as + CONFIG_DEBUG_INFO_BTF) require building a host + program called pahole. Enabling this option will ensure + host-pahole gets built before the Linux kernel. + + Enable this option if you get a Linux kernel build failure + such as "BTF: .tmp_vmlinux.btf: pahole (pahole) is not + available". + # Linux extensions source "linux/Config.ext.in" diff --git a/linux/linux.mk b/linux/linux.mk index 61fdc0c76c..acb2464e8d 100644 --- a/linux/linux.mk +++ b/linux/linux.mk @@ -114,6 +114,17 @@ ifeq ($(BR2_LINUX_KERNEL_NEEDS_HOST_LIBELF),y) LINUX_DEPENDENCIES += host-elfutils host-pkgconf endif +ifeq ($(BR2_LINUX_KERNEL_NEEDS_HOST_PAHOLE),y) +LINUX_DEPENDENCIES += host-pahole +else +define LINUX_FIXUP_CONFIG_PAHOLE_CHECK + if grep -q "^CONFIG_DEBUG_INFO_BTF=y" $(KCONFIG_DOT_CONFIG); then \ + echo "To use CONFIG_DEBUG_INFO_BTF, enable host-pahole (BR2_LINUX_KERNEL_NEEDS_HOST_PAHOLE)" 1>&2; \ + exit 1; \ + fi +endef +endif + # If host-uboot-tools is selected by the user, assume it is needed to # create a custom image ifeq ($(BR2_PACKAGE_HOST_UBOOT_TOOLS),y) @@ -324,6 +335,7 @@ define LINUX_KCONFIG_FIXUP_CMDS $(call KCONFIG_DISABLE_OPT,$(opt)) ) $(LINUX_FIXUP_CONFIG_ENDIANNESS) + $(LINUX_FIXUP_CONFIG_PAHOLE_CHECK) $(if $(BR2_arm)$(BR2_armeb), $(call KCONFIG_ENABLE_OPT,CONFIG_AEABI)) $(if $(BR2_powerpc)$(BR2_powerpc64)$(BR2_powerpc64le), diff --git a/package/pahole/Config.in.host b/package/pahole/Config.in.host index e427629632..521874961b 100644 --- a/package/pahole/Config.in.host +++ b/package/pahole/Config.in.host @@ -3,4 +3,6 @@ config BR2_PACKAGE_HOST_PAHOLE help Pahole and other DWARF utils. + Select this if you want to build a kernel with CONFIG_DEBUG_INFO_BTF set. + https://git.kernel.org/pub/scm/devel/pahole/pahole.git