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:
Andrey Ignatov
2019-04-02 16:33:00 -07:00
parent 2dd2a2d701
commit 8c091e4ffd

View File

@@ -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)|" \