All of lore.kernel.org
 help / color / mirror / Atom feed
From: Francis Laniel <flaniel@linux.microsoft.com>
To: buildroot@buildroot.org
Cc: Samuel Martin <s.martin49@gmail.com>
Subject: Re: [Buildroot] [RFC PATCH v1 2/2] linux: Add host-pahole as linux dependencies if selected by user.
Date: Wed, 22 Dec 2021 18:33:36 +0100	[thread overview]
Message-ID: <2626485.smBdOIXTmD@machine> (raw)
In-Reply-To: <4646c759-075f-e103-c690-6a6a576b8887@mind.be>

Le mardi 21 décembre 2021, 22:58:29 CET Arnout Vandecappelle a écrit :
> On 21/12/2021 15:54, Francis Laniel wrote:
> > If user set BR2_PACKAGE_HOST_PAHOLE, we add host-pahole to linux
> > dependencies in case the user also wants to compile the kernel with
> > CONFIG_DEBUG_BTF_INFO which relies on pahole to generate BTF information
> > used by CO-RE BPF tools.
> > 
> > Signed-off-by: Francis Laniel <flaniel@linux.microsoft.com>
> > ---
> > 
> >   linux/linux.mk                | 6 ++++++
> >   package/pahole/Config.in.host | 2 ++
> >   2 files changed, 8 insertions(+)
> > 
> > diff --git a/linux/linux.mk b/linux/linux.mk
> > index 61fdc0c76c..057d898c86 100644
> > --- a/linux/linux.mk
> > +++ b/linux/linux.mk
> > @@ -120,6 +120,12 @@ ifeq ($(BR2_PACKAGE_HOST_UBOOT_TOOLS),y)
> > 
> >   LINUX_DEPENDENCIES += host-uboot-tools
> >   endif
> > 
> > +# If host-pahole is selected by the user, assume it is needed to create a
> > custom +# kernel with CONFIG_DEBUG_INFO_BTF.
> > +ifeq ($(BR2_PACKAGE_HOST_PAHOLE),y)
> > +LINUX_DEPENDENCIES += host-pahole
> 
>   This is not a super user-friendly way to do it, but it's hard to do
> better.
> 
>   One way would be to make an explicit Config.in option for it (similar to
> openssl). Or an option that also sets CONFIG_DEBUG_INFO_BTF. But I think
> that adds too much complexity to Buildroot for relatively little gain.
> 
>   Perhaps a better improvement would be to add a check if the config option
> is set and print a warning if not.
> 
> 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_PACKAGE_HOST_PAHOLE)" 1>&2; \
> 		return 1; \
> 	fi
> endef
> 
> (and add LINUX_FIXUP_CONFIG_PAHOLE_CHECK to the end of
> LINUX_KCONFIG_FIXUP_CMDS).
> 
>   It's still pretty clunky though, so maybe not that much of an
> improvement...
> 
>   Anyway, I'd merge this patch without that change (but no time today).

When I first wrote this patch, I was looking for a solution to add dependencies 
conditionally to Linux kernel CONFIG_ but I did not find it.
Your solution is cool, so I added as well as an option (like one used for 
OpenSSL and libelf).
I will send v2 within 10 minutes.

>   Regards,
>   Arnout
> 
> > +endif
> > +
> > 
> >   ifneq ($(ARCH_XTENSA_OVERLAY_FILE),)
> >   define LINUX_XTENSA_OVERLAY_EXTRACT
> >   
> >   	$(call arch-xtensa-overlay-extract,$(@D),linux)
> > 
> > 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
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot




_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

      reply	other threads:[~2021-12-22 17:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-21 14:54 [Buildroot] [RFC PATCH v1 0/2] Enable BTF headers for Linux kernel Francis Laniel
2021-12-21 14:54 ` [Buildroot] [RFC PATCH v1 1/2] package/pahole: new host package Francis Laniel
2021-12-21 21:44   ` Arnout Vandecappelle
2021-12-22 17:32     ` Francis Laniel
2021-12-21 14:54 ` [Buildroot] [RFC PATCH v1 2/2] linux: Add host-pahole as linux dependencies if selected by user Francis Laniel
2021-12-21 21:58   ` Arnout Vandecappelle
2021-12-22 17:33     ` Francis Laniel [this message]

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=2626485.smBdOIXTmD@machine \
    --to=flaniel@linux.microsoft.com \
    --cc=buildroot@buildroot.org \
    --cc=s.martin49@gmail.com \
    /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.