41 lines
2.2 KiB
Diff
41 lines
2.2 KiB
Diff
From: Ben Hutchings <benh@debian.org>
|
|
Date: Sun, 20 Apr 2025 18:50:44 +0200
|
|
Subject: libbpf: Use the standard fixdep build rule
|
|
|
|
libbpf's all target depends on the fixdep target defined in
|
|
tools/scripts/Makefile.include. However the $(BPF_IN_SHARED) and
|
|
$(BPF_IN_STATIC) targets don't use it, but instead rebuild fixdep in
|
|
the staticobjs or sharedobjs subdirectory using a different command.
|
|
|
|
Change the $(BPF_IN_SHARED) and $(BPF_IN_STATIC) targets to depend on
|
|
fixdep and to symlink the executable into the respective output
|
|
subdirectory.
|
|
|
|
Signed-off-by: Ben Hutchings <benh@debian.org>
|
|
---
|
|
--- a/tools/lib/bpf/Makefile
|
|
+++ b/tools/lib/bpf/Makefile
|
|
@@ -134,7 +134,7 @@ all_cmd: $(CMD_TARGETS) check
|
|
$(SHARED_OBJDIR) $(STATIC_OBJDIR):
|
|
$(Q)mkdir -p $@
|
|
|
|
-$(BPF_IN_SHARED): force $(BPF_GENERATED) | $(SHARED_OBJDIR)
|
|
+$(BPF_IN_SHARED): fixdep force $(BPF_GENERATED) | $(SHARED_OBJDIR)
|
|
@(test -f ../../include/uapi/linux/bpf.h -a -f ../../../include/uapi/linux/bpf.h && ( \
|
|
(diff -B ../../include/uapi/linux/bpf.h ../../../include/uapi/linux/bpf.h >/dev/null) || \
|
|
echo "Warning: Kernel ABI header at 'tools/include/uapi/linux/bpf.h' differs from latest version at 'include/uapi/linux/bpf.h'" >&2 )) || true
|
|
@@ -144,11 +144,11 @@ $(BPF_IN_SHARED): force $(BPF_GENERATED)
|
|
@(test -f ../../include/uapi/linux/if_xdp.h -a -f ../../../include/uapi/linux/if_xdp.h && ( \
|
|
(diff -B ../../include/uapi/linux/if_xdp.h ../../../include/uapi/linux/if_xdp.h >/dev/null) || \
|
|
echo "Warning: Kernel ABI header at 'tools/include/uapi/linux/if_xdp.h' differs from latest version at 'include/uapi/linux/if_xdp.h'" >&2 )) || true
|
|
- $(SILENT_MAKE) -C $(srctree)/tools/build CFLAGS= LDFLAGS= OUTPUT=$(SHARED_OBJDIR) $(SHARED_OBJDIR)fixdep
|
|
+ ln -sf ../fixdep $(SHARED_OBJDIR)/
|
|
$(Q)$(MAKE) $(build)=libbpf OUTPUT=$(SHARED_OBJDIR) CFLAGS="$(CFLAGS) $(SHLIB_FLAGS)"
|
|
|
|
-$(BPF_IN_STATIC): force $(BPF_GENERATED) | $(STATIC_OBJDIR)
|
|
- $(SILENT_MAKE) -C $(srctree)/tools/build CFLAGS= LDFLAGS= OUTPUT=$(STATIC_OBJDIR) $(STATIC_OBJDIR)fixdep
|
|
+$(BPF_IN_STATIC): fixdep force $(BPF_GENERATED) | $(STATIC_OBJDIR)
|
|
+ ln -sf ../fixdep $(STATIC_OBJDIR)/
|
|
$(Q)$(MAKE) $(build)=libbpf OUTPUT=$(STATIC_OBJDIR)
|
|
|
|
$(BPF_HELPER_DEFS): $(srctree)/tools/include/uapi/linux/bpf.h
|