All of lore.kernel.org
 help / color / mirror / Atom feed
From: Francis Laniel <flaniel@linux.microsoft.com>
To: "buildroot@buildroot.org" <buildroot@buildroot.org>,
	Lang Daniel <d.lang@abatec.at>
Cc: Romain Naour <romain.naour@gmail.com>
Subject: Re: [Buildroot] [PATCH] package/libbpf: Don't remove bpf.h on host
Date: Tue, 07 Feb 2023 21:10:08 +0100	[thread overview]
Message-ID: <12146851.O9o76ZdvQC@pwmachine> (raw)
In-Reply-To: <VI1P190MB04936E3BDB708B8974C8287B9F139@VI1P190MB0493.EURP190.PROD.OUTLOOK.COM>

Hi.

Le lundi 28 novembre 2022, 16:06:20 CET Lang Daniel a écrit :
> libbpf >1.0.0 defines libbpf_bpf_link_type_str(enum bpf_link_type) in
> src/libbpf.h, which is included by host-pahole.
> bpf_link_type is defined in linux/bpf.h, therefore the comment stating
> that pahole doesn't need bpf.h is no longer valid.
> 
> Fixes:
> -
> http://autobuild.buildroot.net/results/d126a4b6eca786402dc362c86f8df3addec3
> d217/
> 
> Signed-off-by: Daniel Lang <d.lang@abatec.at>
> ---
> I wasn't able to reproduce the mentioned compile error in the kernel.
> The mentioned file (tools/lib/bpf/strset.c) shouldn't be compiled when
> compiling the kernel as it would recompile libbpf.
> ---
>  package/libbpf/libbpf.mk | 17 +----------------
>  1 file changed, 1 insertion(+), 16 deletions(-)
> 
> diff --git a/package/libbpf/libbpf.mk b/package/libbpf/libbpf.mk
> index 820f1dc4bf..0381fd833a 100644
> --- a/package/libbpf/libbpf.mk
> +++ b/package/libbpf/libbpf.mk
> @@ -39,26 +39,11 @@ define LIBBPF_INSTALL_TARGET_CMDS
>  		-C $(@D)/src install DESTDIR=$(TARGET_DIR)
>  endef
> 
> -# We need to install_uapi_headers so we have btf.h to compile
> -# host-pahole.
> -# Nonetheless, this target adds bpf.h which generates a conflict when
> -# building the kernel:
> -# In file included from libbpf_internal.h:17:0, from strset.c:9:
> -# relo_core.h:10:6: error: nested redefinition of 'enum bpf_core_relo_kind'
> -# enum bpf_core_relo_kind {
> -# ^~~~~~~~~~~~~~~~~~
> -# relo_core.h:10:6: error: redeclaration of 'enum bpf_core_relo_kind'
> -# In file included from libbpf_legacy.h:13:0,
> -# 		from libbpf_internal.h:16,
> -# 		from strset.c:9:
> -# /home/francis/buildroot/output/host/include/linux/bpf.h:6497:6: note:
> originally defined here -# enum bpf_core_relo_kind {
> -# So, better to remove remove it now since we do not need it to build
> +# We need to install_uapi_headers so we have bpf.h and btf.h to compile
>  # host-pahole, the only user of host-libbpf.
>  define HOST_LIBBPF_INSTALL_CMDS
>  	$(HOST_MAKE_ENV) $(HOST_CONFIGURE_OPTS) $(MAKE) \
>  		-C $(@D)/src install install_uapi_headers DESTDIR=$(HOST_DIR)
> -	rm $(HOST_DIR)/include/linux/bpf.h
>  endef
> 
>  $(eval $(generic-package))

Thank you for this patch and sorry for my very late reply.
Sadly, I do not think the patch addresses the underlying issue.
Indeed, this is not pahole which does not need this file, as pahole relies on 
<linux/bpf.h> to be built.
So, the whole point of this comment and the rm is to avoid a problem when 
building the kernel when pahole was built before.

Sadly, I tested your patch and I hit the problem described in the comment 
regarding redefinition of bpf_core_relo_kind.

Did you also hit it or you were able to build the kernel with 
BR2_LINUX_KERNEL_NEEDS_HOST_PAHOLE?


Best regards and thank you in advance.


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

  reply	other threads:[~2023-02-07 20:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-28 15:06 [Buildroot] [PATCH] package/libbpf: Don't remove bpf.h on host Lang Daniel via buildroot
2023-02-07 20:10 ` Francis Laniel [this message]
2023-02-08 15:47   ` Arnout Vandecappelle
2023-02-08 22:22     ` Francis Laniel
2023-02-13 12:24       ` Lang Daniel via buildroot
2023-02-14 21:16         ` Arnout Vandecappelle

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=12146851.O9o76ZdvQC@pwmachine \
    --to=flaniel@linux.microsoft.com \
    --cc=buildroot@buildroot.org \
    --cc=d.lang@abatec.at \
    --cc=romain.naour@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.