mirror of
https://github.com/netdata/libbpf.git
synced 2026-03-26 03: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
|
||||
ifndef BUILD_STATIC_ONLY
|
||||
LIBS += $(OBJDIR)/libbpf.so
|
||||
VERSION_SCRIPT := libbpf.map
|
||||
endif
|
||||
|
||||
HEADERS := bpf.h libbpf.h btf.h
|
||||
@@ -62,7 +63,8 @@ $(OBJDIR)/libbpf.a: $(OBJS)
|
||||
$(AR) rcs $@ $^
|
||||
|
||||
$(OBJDIR)/libbpf.so: $(OBJS)
|
||||
$(CC) -shared $(ALL_LDFLAGS) $^ -o $@
|
||||
$(CC) -shared $(ALL_LDFLAGS) -Wl,--version-script=$(VERSION_SCRIPT) \
|
||||
$^ -o $@
|
||||
|
||||
$(OBJDIR)/libbpf.pc:
|
||||
sed -e "s|@PREFIX@|$(PREFIX)|" \
|
||||
|
||||
Reference in New Issue
Block a user