All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [git commit] package/libbpf: build for host
@ 2022-04-30 15:41 Arnout Vandecappelle
  0 siblings, 0 replies; only message in thread
From: Arnout Vandecappelle @ 2022-04-30 15:41 UTC (permalink / raw)
  To: buildroot

commit: https://git.buildroot.net/buildroot/commit/?id=43b4017ba7c5f2636e6a3f674c63c50050956ea4
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master

Signed-off-by: Francis Laniel <flaniel@linux.microsoft.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
 package/libbpf/libbpf.mk | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/package/libbpf/libbpf.mk b/package/libbpf/libbpf.mk
index d6914757d7..f50a82b581 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,27 @@ 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
+# 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))
+$(eval $(host-generic-package))
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-04-30 15:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-30 15:41 [Buildroot] [git commit] package/libbpf: build for host Arnout Vandecappelle

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.