package/bpftool: add a patch to fix cross compilation
PATCH 1/1 package/bpftool: add a patch to fix cross compilation
If on the host machine the "co-re" is supported, bpftool will build a bootstrap version of itself as well. In that case, the cross compilation can fail. This commit adds a patch to remedy that. The fix that you see here is already upsteamed [1].
Signed-off-by Shahab Vahedi <[email protected]>
--- package/bpftool/0001-fix-bootsrap.patch | 32 +++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 package/bpftool/0001-fix-bootsrap.patch
package/bpftool/0001-fix-bootsrap.patch new file +32 -0
@@ -0,0 +1,32 @@ +This is an adapted version of an upstreamed patch [1], else it won't be +possible to cross compile bpftool if "clang-bpf-co-re" feature is enabled. + +[1] bpftool: Fix bootstrapping during a cross compilation +https://lore.kernel.org/bpf/[email protected]/t/#u +--- bpftool-v6.8.0/src/Makefile ++++ bpftool-v6.8.0/src/Makefile +@@ -51,7 +51,7 @@ + $(LIBBPF_BOOTSTRAP): $(wildcard $(BPF_DIR)/*.[ch] $(BPF_DIR)/Makefile) | $(LIBBPF_BOOTSTRAP_OUTPUT) + $(Q)$(MAKE) -C $(BPF_DIR) OBJDIR=$(patsubst %/,%,$(LIBBPF_BOOTSTRAP_OUTPUT)) \ + PREFIX=$(LIBBPF_BOOTSTRAP_DESTDIR:/=) \ +- ARCH= CROSS_COMPILE= CC=$(HOSTCC) LD=$(HOSTLD) $@ install_headers ++ ARCH= CROSS_COMPILE= CC=$(HOSTCC) LD=$(HOSTLD) AR=$(HOSTAR) $@ install_headers + + $(LIBBPF_BOOTSTRAP_INTERNAL_HDRS): $(LIBBPF_BOOTSTRAP_HDRS_DIR)/%.h: $(BPF_DIR)/%.h | $(LIBBPF_BOOTSTRAP_HDRS_DIR) + $(call QUIET_INSTALL, $@) +--- bpftool-v6.8.0/src/Makefile.include ++++ bpftool-v6.8.0/src/Makefile.include +@@ -12,11 +12,13 @@ + ifneq ($(LLVM),) + $(if $(findstring default,$(origin CC)),$(eval CC := clang$(LLVM_VERSION))) + $(if $(findstring default,$(origin LD)),$(eval LD := ld.lld$(LLVM_VERSION))) ++ HOSTAR ?= llvm-ar + HOSTCC ?= clang + HOSTLD ?= ld.lld + else + $(if $(findstring default,$(origin CC)),$(eval CC = $(CROSS_COMPILE)$(CC))) + $(if $(findstring default,$(origin LD)),$(eval LD = $(CROSS_COMPILE)$(LD))) ++ HOSTAR ?= ar + HOSTCC ?= gcc + HOSTLD ?= ld + endif
_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc