From: Björn Töpel <[email protected]>

When libbpf was built was a shared library, libelf was not included in
the linking phase. Since libelf is an internal depedency to libbpf,
libeld should be included. This patch adds '-lelf' to resolve that.

Fixes: 1b76c13e4b36 ("bpf tools: Introduce 'bpf' library and add bpf feature 
check")
Suggested-by: Luca Boccassi <[email protected]>
Signed-off-by: Björn Töpel <[email protected]>
---
 tools/lib/bpf/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
index 279589c29983..7beec4d5b522 100644
--- a/tools/lib/bpf/Makefile
+++ b/tools/lib/bpf/Makefile
@@ -177,7 +177,7 @@ $(OUTPUT)libbpf.so: $(OUTPUT)libbpf.so.$(LIBBPF_VERSION)
 
 $(OUTPUT)libbpf.so.$(LIBBPF_VERSION): $(BPF_IN)
        $(QUIET_LINK)$(CC) --shared -Wl,-soname,libbpf.so.$(VERSION) \
-                                   -Wl,--version-script=$(VERSION_SCRIPT) $^ 
-o $@
+                                   -Wl,--version-script=$(VERSION_SCRIPT) $^ 
-lelf -o $@
        @ln -sf $(@F) $(OUTPUT)libbpf.so
        @ln -sf $(@F) $(OUTPUT)libbpf.so.$(VERSION)
 
-- 
2.19.1

Reply via email to