Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Francis Laniel <flaniel@linux.microsoft.com>
To: buildroot@buildroot.org
Cc: Francis Laniel <flaniel@linux.microsoft.com>,
	Romain Naour <romain.naour@gmail.com>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: [Buildroot] [RFC PATCH v1 1/2] package/libbpf: build for host
Date: Fri, 22 Apr 2022 19:16:11 +0100	[thread overview]
Message-ID: <20220422181612.51246-2-flaniel@linux.microsoft.com> (raw)
In-Reply-To: <20220422181612.51246-1-flaniel@linux.microsoft.com>

Signed-off-by: Francis Laniel <flaniel@linux.microsoft.com>
---
 package/libbpf/libbpf.mk | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/package/libbpf/libbpf.mk b/package/libbpf/libbpf.mk
index d6914757d7..709277fac4 100644
--- a/package/libbpf/libbpf.mk
+++ b/package/libbpf/libbpf.mk
@@ -10,6 +10,7 @@ LIBBPF_LICENSE = GPL-2.0, LGPL-2.1, BSD-2-Clause
 LIBBPF_LICENSE_FILES = LICENSE LICENSE.BSD-2-Clause LICENSE.LGPL-2.1
 LIBBPF_CPE_ID_VENDOR = libbpf_project
 LIBBPF_DEPENDENCIES = host-bison host-flex host-pkgconf elfutils zlib
+HOST_LIBBPF_DEPENDENCIES = host-bison host-flex host-pkgconf host-elfutils host-zlib
 LIBBPF_INSTALL_STAGING = YES
 
 define LIBBPF_BUILD_CMDS
@@ -38,4 +39,28 @@ define LIBBPF_INSTALL_TARGET_CMDS
 		-C $(@D)/src install DESTDIR=$(TARGET_DIR)
 endef
 
+define HOST_LIBBPF_INSTALL_CMDS
+	$(HOST_MAKE_ENV) $(HOST_CONFIGURE_OPTS) $(MAKE) \
+		-C $(@D)/src install install_uapi_headers DESTDIR=$(HOST_DIR)
+
+	# 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
+	# host-pahole.
+	rm $(HOST_DIR)/include/linux/bpf.h
+endef
+
 $(eval $(generic-package))
+$(eval $(host-generic-package))
-- 
2.25.1

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

  reply	other threads:[~2022-04-22 18:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-22 18:16 [Buildroot] [RFC PATCH v1 0/2] Use host-libbpf for host-pahole Francis Laniel
2022-04-22 18:16 ` Francis Laniel [this message]
2022-04-30 15:46   ` [Buildroot] [RFC PATCH v1 1/2] package/libbpf: build for host Arnout Vandecappelle
2022-04-22 18:16 ` [Buildroot] [RFC PATCH v1 2/2] package/pahole: use commit 73383b3a39af Francis Laniel

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=20220422181612.51246-2-flaniel@linux.microsoft.com \
    --to=flaniel@linux.microsoft.com \
    --cc=buildroot@buildroot.org \
    --cc=romain.naour@gmail.com \
    --cc=thomas.petazzoni@bootlin.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox