1 diff --git a/Makefile b/Makefile
2 index c72cf63d..e96b7eed 100644
5 @@ -50,6 +50,7 @@ CMD_STATICCHECK ?= staticcheck
13 @@ -172,10 +173,6 @@ env:
14 @echo "KERN_BUILD_PATH $(KERN_BUILD_PATH)"
15 @echo "KERN_SRC_PATH $(KERN_SRC_PATH)"
16 @echo ---------------------------------------
17 - @echo "LIBBPF_CFLAGS $(LIBBPF_CFLAGS)"
18 - @echo "LIBBPF_LDLAGS $(LIBBPF_LDFLAGS)"
19 - @echo "LIBBPF_SRC $(LIBBPF_SRC)"
20 - @echo ---------------------------------------
21 @echo "STATIC $(STATIC)"
22 @echo ---------------------------------------
23 @echo "BPF_VCPU $(BPF_VCPU)"
24 @@ -274,8 +271,6 @@ OUTPUT_DIR = ./dist
28 - @$(CMD_MKDIR) -p $@/libbpf
29 - @$(CMD_MKDIR) -p $@/libbpf/obj
33 @@ -286,37 +281,6 @@ $(OUTPUT_DIR)/btfhub:
35 @$(CMD_TOUCH) $@/.place-holder # needed for embed.FS
41 -LIBBPF_CFLAGS = "-fPIC"
43 -LIBBPF_SRC = ./3rdparty/libbpf/src
45 -$(OUTPUT_DIR)/libbpf/libbpf.a: \
47 - $(wildcard $(LIBBPF_SRC)/*.[ch]) \
48 - | .checkver_$(CMD_CLANG) $(OUTPUT_DIR)
51 - CFLAGS="$(LIBBPF_CFLAGS)" \
52 - LD_FLAGS="$(LIBBPF_LDFLAGS)" \
55 - BUILD_STATIC_ONLY=1 \
56 - DESTDIR=$(abspath ./$(OUTPUT_DIR)/libbpf/) \
57 - OBJDIR=$(abspath ./$(OUTPUT_DIR)/libbpf/obj) \
58 - INCLUDEDIR= LIBDIR= UAPIDIR= prefix= libdir= \
59 - install install_uapi_headers
64 -ifeq ($(wildcard $@), )
65 - @$(CMD_GIT) submodule update --init --recursive
71 @@ -333,7 +297,6 @@ BPF_NOCORE_TAG = $(subst .,_,$(KERN_RELEASE)).$(subst .,_,$(VERSION))
72 bpf-nocore: $(OUTPUT_DIR)/tracee.bpf.$(BPF_NOCORE_TAG).o
74 $(OUTPUT_DIR)/tracee.bpf.$(BPF_NOCORE_TAG).o: \
75 - $(OUTPUT_DIR)/libbpf/libbpf.a \
76 $(TRACEE_EBPF_OBJ_SRC)
78 MAKEFLAGS="--no-print-directory"
79 @@ -351,7 +314,6 @@ $(OUTPUT_DIR)/tracee.bpf.$(BPF_NOCORE_TAG).o: \
80 -I $(KERN_SRC_PATH)/include/uapi \
81 -I $(KERN_BUILD_PATH)/include/generated \
82 -I $(KERN_BUILD_PATH)/include/generated/uapi \
83 - -I $(OUTPUT_DIR)/libbpf \
84 -I ./3rdparty/include \
87 @@ -412,7 +374,6 @@ TRACEE_EBPF_OBJ_CORE_HEADERS = $(shell find pkg/ebpf/c -name *.h)
88 bpf-core: $(OUTPUT_DIR)/tracee.bpf.core.o
90 $(OUTPUT_DIR)/tracee.bpf.core.o: \
91 - $(OUTPUT_DIR)/libbpf/libbpf.a \
92 $(TRACEE_EBPF_OBJ_SRC) \
93 $(TRACEE_EBPF_OBJ_CORE_HEADERS)
95 @@ -421,7 +382,6 @@ $(OUTPUT_DIR)/tracee.bpf.core.o: \
99 - -I$(OUTPUT_DIR)/libbpf/ \
100 -I ./3rdparty/include \
103 @@ -447,8 +407,8 @@ ifeq ($(STATIC), 1)
104 GO_TAGS_EBPF := $(GO_TAGS_EBPF),netgo
107 -CUSTOM_CGO_CFLAGS = "-I$(abspath $(OUTPUT_DIR)/libbpf)"
108 -CUSTOM_CGO_LDFLAGS = "$(shell $(call pkg_config, $(LIB_ELF))) $(shell $(call pkg_config, $(LIB_ZLIB))) $(abspath $(OUTPUT_DIR)/libbpf/libbpf.a)"
109 +CUSTOM_CGO_CFLAGS = ""
110 +CUSTOM_CGO_LDFLAGS = "$(shell $(call pkg_config, $(LIB_BPF))) $(shell $(call pkg_config, $(LIB_ELF))) $(shell $(call pkg_config, $(LIB_ZLIB)))"
113 GO_ENV_EBPF += GOOS=linux
114 @@ -468,6 +428,7 @@ $(OUTPUT_DIR)/tracee-ebpf: \
117 | .checkver_$(CMD_GO) \
118 + .checklib_$(LIB_BPF) \
119 .checklib_$(LIB_ELF) \
120 .checklib_$(LIB_ZLIB) \
122 @@ -658,7 +619,6 @@ test-rules: \
123 .PHONY: test-upstream-libbpfgo
124 test-upstream-libbpfgo: \
125 .checkver_$(CMD_GO) \
126 - $(OUTPUT_DIR)/libbpf/libbpf.a
128 ./tests/libbpfgo.sh $(GO_ENV_EBPF)