On Tue, 2024-10-15 at 08:54 +0200, Viktor Malik wrote: Tried this, seems to work as expected, but see below. Tested-by: Eduard Zingerman <eddyz87@xxxxxxxxx> [...] > @@ -388,8 +394,8 @@ $(BPFOBJ): $(wildcard $(BPFDIR)/*.[ch] $(BPFDIR)/Makefile) \ > $(APIDIR)/linux/bpf.h \ > | $(BUILD_DIR)/libbpf > $(Q)$(MAKE) $(submake_extras) -C $(BPFDIR) OUTPUT=$(BUILD_DIR)/libbpf/ \ > - EXTRA_CFLAGS='-g $(OPT_FLAGS) $(SAN_CFLAGS)' \ > - EXTRA_LDFLAGS='$(SAN_LDFLAGS)' \ > + EXTRA_CFLAGS='-g $(OPT_FLAGS) $(SAN_CFLAGS) $(EXTRA_CFLAGS)' \ > + EXTRA_LDFLAGS='$(SAN_LDFLAGS) $(EXTRA_LDFLAGS)' \ > DESTDIR=$(SCRATCH_DIR) prefix= all install_headers > > ifneq ($(BPFOBJ),$(HOST_BPFOBJ)) Note, that there is also the following code just below this hunk: ifneq ($(BPFOBJ),$(HOST_BPFOBJ)) $(HOST_BPFOBJ): $(wildcard $(BPFDIR)/*.[ch] $(BPFDIR)/Makefile) \ $(APIDIR)/linux/bpf.h \ | $(HOST_BUILD_DIR)/libbpf $(Q)$(MAKE) $(submake_extras) -C $(BPFDIR) \ EXTRA_CFLAGS='-g $(OPT_FLAGS)' ARCH= CROSS_COMPILE= \ ^^^^^^^^^^^^ needs an update? OUTPUT=$(HOST_BUILD_DIR)/libbpf/ \ CC="$(HOSTCC)" LD="$(HOSTLD)" \ DESTDIR=$(HOST_SCRATCH_DIR)/ prefix= all install_headers endif