From 2b2f6fad5cb45a3348750b97a341171f1afb845d Mon Sep 17 00:00:00 2001 From: Andrii Nakryiko Date: Sun, 3 Jul 2022 20:35:44 -0700 Subject: [PATCH 1/2] libbpf: update to latest libbpf master Update to latest libbpf master that removed deprecated APIs. Signed-off-by: Andrii Nakryiko --- libbpf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libbpf b/libbpf index 4eb6485c..b78c75fc 160000 --- a/libbpf +++ b/libbpf @@ -1 +1 @@ -Subproject commit 4eb6485c08867edaa5a0a81c64ddb23580420340 +Subproject commit b78c75fcb347b06c31996860353f40087ed02f48 From 58fb1359cf45967dcc3417d0d15d6f5f18261282 Mon Sep 17 00:00:00 2001 From: Andrii Nakryiko Date: Fri, 8 Jul 2022 09:44:28 -0700 Subject: [PATCH 2/2] Makefile: build and use lightweight bootstrap version of bpftool We don't need most of bpftool functionality, just the skeleton generation and, potentially, static linking, so there is no point in building full-featured final bpftool version. So build and use bootstrap bpftool. This should also ease user's pain like [0]. [0] https://github.com/libbpf/libbpf-bootstrap/issues/89 Cc: Quentin Monnet Signed-off-by: Andrii Nakryiko --- examples/c/Makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/examples/c/Makefile b/examples/c/Makefile index e16cf7f6..e77fca79 100644 --- a/examples/c/Makefile +++ b/examples/c/Makefile @@ -5,7 +5,8 @@ LLVM_STRIP ?= llvm-strip LIBBPF_SRC := $(abspath ../../libbpf/src) BPFTOOL_SRC := $(abspath ../../bpftool/src) LIBBPF_OBJ := $(abspath $(OUTPUT)/libbpf.a) -BPFTOOL ?= $(abspath $(OUTPUT)/bpftool/bpftool) +BPFTOOL_OUTPUT ?= $(abspath $(OUTPUT)/bpftool) +BPFTOOL ?= $(BPFTOOL_OUTPUT)/bootstrap/bpftool LIBBLAZESYM_SRC := $(abspath ../../blazesym/) LIBBLAZESYM_OBJ := $(abspath $(OUTPUT)/libblazesym.a) LIBBLAZESYM_HEADER := $(abspath $(OUTPUT)/blazesym.h) @@ -70,7 +71,7 @@ clean: $(call msg,CLEAN) $(Q)rm -rf $(OUTPUT) $(APPS) -$(OUTPUT) $(OUTPUT)/libbpf $(dir $(BPFTOOL)): +$(OUTPUT) $(OUTPUT)/libbpf $(BPFTOOL_OUTPUT): $(call msg,MKDIR,$@) $(Q)mkdir -p $@ @@ -83,9 +84,9 @@ $(LIBBPF_OBJ): $(wildcard $(LIBBPF_SRC)/*.[ch] $(LIBBPF_SRC)/Makefile) | $(OUTPU install # Build bpftool -$(BPFTOOL): | $(dir $(BPFTOOL)) +$(BPFTOOL): | $(BPFTOOL_OUTPUT) $(call msg,BPFTOOL,$@) - $(Q)$(MAKE) ARCH= CROSS_COMPILE= OUTPUT=$(dir $(BPFTOOL)) -C $(BPFTOOL_SRC) + $(Q)$(MAKE) ARCH= CROSS_COMPILE= OUTPUT=$(BPFTOOL_OUTPUT)/ -C $(BPFTOOL_SRC) bootstrap $(LIBBLAZESYM_SRC)/target/release/libblazesym.a::