libbpf: link shared object with libelf
authorHilko Bengen <bengen@debian.org>
Sun, 2 Dec 2018 23:26:03 +0000 (23:26 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 19 Jun 2019 22:16:58 +0000 (23:16 +0100)
libbpf.so needs to be linked against libelf to avoid missing symbols.

Signed-off-by: Hilko Bengen <bengen@debian.org>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name libbpf-link-shared-object-with-libelf.patch

tools/lib/bpf/Makefile

index d40b6432e93bbbffb0d863154084b7e783370f91..86fd56c698bbcb30eba98d258e7ab2f497f4c9c5 100644 (file)
@@ -170,7 +170,7 @@ $(BPF_IN): force elfdep bpfdep
        $(Q)$(MAKE) $(build)=libbpf
 
 $(OUTPUT)libbpf.so.$(LIBBPF_VERSION): $(BPF_IN)
-       $(QUIET_LINK)$(CC) --shared $^ -Wl,-soname,$(@F) -o $@
+       $(QUIET_LINK)$(CC) --shared $^ -lelf -Wl,-soname,$(@F) -o $@
 
 $(OUTPUT)libbpf.a: $(BPF_IN)
        $(QUIET_LINK)$(RM) $@; $(AR) rcs $@ $^