mirror of
https://github.com/netdata/libbpf.git
synced 2026-04-09 10:09:07 +08:00
Enable version script for DSO building
Version script was synced from kernel tree but not enabled in Makefile.
Enable it same way it's done in kernel tree.
% readelf -s --wide src/libbpf.so | grep -Eo '[^ ]+@LIBBPF_.*' | \
cut -d@ -f 3 | sort | uniq -c
121 LIBBPF_0.0.1
29 LIBBPF_0.0.2
Signed-off-by: Andrey Ignatov <rdna@fb.com>
This commit is contained in:
@@ -33,6 +33,7 @@ OBJS := $(addprefix $(OBJDIR)/,bpf.o btf.o libbpf.o libbpf_errno.o netlink.o \
|
|||||||
LIBS := $(OBJDIR)/libbpf.a
|
LIBS := $(OBJDIR)/libbpf.a
|
||||||
ifndef BUILD_STATIC_ONLY
|
ifndef BUILD_STATIC_ONLY
|
||||||
LIBS += $(OBJDIR)/libbpf.so
|
LIBS += $(OBJDIR)/libbpf.so
|
||||||
|
VERSION_SCRIPT := libbpf.map
|
||||||
endif
|
endif
|
||||||
|
|
||||||
HEADERS := bpf.h libbpf.h btf.h
|
HEADERS := bpf.h libbpf.h btf.h
|
||||||
@@ -62,7 +63,8 @@ $(OBJDIR)/libbpf.a: $(OBJS)
|
|||||||
$(AR) rcs $@ $^
|
$(AR) rcs $@ $^
|
||||||
|
|
||||||
$(OBJDIR)/libbpf.so: $(OBJS)
|
$(OBJDIR)/libbpf.so: $(OBJS)
|
||||||
$(CC) -shared $(ALL_LDFLAGS) $^ -o $@
|
$(CC) -shared $(ALL_LDFLAGS) -Wl,--version-script=$(VERSION_SCRIPT) \
|
||||||
|
$^ -o $@
|
||||||
|
|
||||||
$(OBJDIR)/libbpf.pc:
|
$(OBJDIR)/libbpf.pc:
|
||||||
sed -e "s|@PREFIX@|$(PREFIX)|" \
|
sed -e "s|@PREFIX@|$(PREFIX)|" \
|
||||||
|
|||||||
Reference in New Issue
Block a user