You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/dev-libs/libbpf/files/libbpf-makefile.patch

25 lines
655 B

diff --git a/Makefile b/Makefile
index 7ea1ff1..75ca998 100644
--- a/Makefile
+++ b/Makefile
@@ -22,7 +22,9 @@ OBJDIR ?= .
OBJS := $(addprefix $(OBJDIR)/,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)
-LIBS := $(OBJDIR)/libbpf.a
+ifdef BUILD_STATIC
+ LIBS := $(OBJDIR)/libbpf.a
+endif
ifdef BUILD_SHARED
LIBS += $(OBJDIR)/libbpf.so
endif
@@ -52,7 +54,7 @@ $(OBJDIR)/libbpf.a: $(OBJS)
$(AR) rcs $@ $^
$(OBJDIR)/libbpf.so: $(OBJS)
- $(CC) -shared $(LDFLAGS) $^ -o $@
+ $(CC) -shared $(LDFLAGS) $^ -Wl,-soname,libbpf.so -o $@
$(OBJDIR)/%.o: %.c
$(CC) $(ALL_CFLAGS) -c $< -o $@