From 8ded7c6db06f15e1cc8edb6e1f47fc582d5649df Mon Sep 17 00:00:00 2001 From: Rafael David Tinoco Date: Fri, 6 Aug 2021 15:31:24 -0300 Subject: [PATCH] makefile: fix missing object for static compilation Makefile needs relo_core object added to objects list to avoid static linking errors when doing static compilation: /bin/ld: .../libbpf.a(libbpf.o): in function `bpf_core_apply_relo': .../libbpf/src/libbpf.c:5134: undefined reference to `bpf_core_apply_relo_insn' Signed-off-by: Rafael David Tinoco --- src/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Makefile b/src/Makefile index 8bf1d8a..913082d 100644 --- a/src/Makefile +++ b/src/Makefile @@ -36,7 +36,8 @@ SHARED_OBJDIR := $(OBJDIR)/sharedobjs STATIC_OBJDIR := $(OBJDIR)/staticobjs OBJS := bpf.o btf.o libbpf.o libbpf_errno.o netlink.o \ nlattr.o str_error.o libbpf_probes.o bpf_prog_linfo.o xsk.o \ - btf_dump.o hashmap.o ringbuf.o strset.o linker.o gen_loader.o + btf_dump.o hashmap.o ringbuf.o strset.o linker.o gen_loader.o \ + relo_core.o SHARED_OBJS := $(addprefix $(SHARED_OBJDIR)/,$(OBJS)) STATIC_OBJS := $(addprefix $(STATIC_OBJDIR)/,$(OBJS))