fuel-plugin-ovs/ovs_build/dpdk_2.2.0/debian/patches/ubuntu-combined-shared-lib-...

52 lines
1.8 KiB
Diff

Description: build: Set soabi for the combined shared library
Currently the build for the combined shared library does not set
any ABI version. Since this deviates from upstream we start with
version 0.
Probably it would be ok if upstream kept individual ABI versions
for each individual library. Then the combined one would have to
be incremented whenever any of those changes version.
Though to me it would feel more logical if there would be only
one ABI version for the whole set.
Forwarded: Not yet. Needs discussion about library versioning.
Author: Stefan Bader <stefan.bader@canonical.com>
Last-Update: 2015-12-01
--- a/mk/rte.sharelib.mk
+++ b/mk/rte.sharelib.mk
@@ -33,10 +33,12 @@
# VPATH contains at least SRCDIR
VPATH += $(SRCDIR)
+# The shared libs abi number.
+LIBABIVER := 0
ifeq ($(CONFIG_RTE_BUILD_COMBINE_LIBS),y)
ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
-LIB_ONE := lib$(RTE_LIBNAME).so
+LIB_ONE := lib$(RTE_LIBNAME).so.$(LIBABIVER)
else
LIB_ONE := lib$(RTE_LIBNAME).a
endif
@@ -54,10 +56,10 @@
LD := $(CC) $(CPU_CFLAGS)
O_TO_S = $(LD) $(call linkerprefix,$(CPU_LDFLAGS)) \
$(call linkerprefix,$(COMBINED_LDFLAGS)) \
- -shared $(OBJS) -o $(RTE_OUTPUT)/lib/$(LIB_ONE)
+ -shared $(OBJS) -Wl,-soname,$(LIB_ONE) -o $(RTE_OUTPUT)/lib/$(LIB_ONE)
else
O_TO_S = $(LD) $(CPU_LDFLAGS) $(COMBINED_LDFLAGS) \
- -shared $(OBJS) -o $(RTE_OUTPUT)/lib/$(LIB_ONE)
+ -shared $(OBJS) -Wl,-soname,$(LIB_ONE) -o $(RTE_OUTPUT)/lib/$(LIB_ONE)
endif
O_TO_S_STR = $(subst ','\'',$(O_TO_S)) #'# fix syntax highlight
@@ -84,6 +86,8 @@
@[ -d $(dir $@) ] || mkdir -p $(dir $@)
@$(SRCDIR)/scripts/merge-maps.sh > $(COMBINED_MAP)
$(O_TO_S_DO)
+ @[ -L $(RTE_OUTPUT)/lib/$(basename $(LIB_ONE)) ] || \
+ ln -s $(LIB_ONE) $(RTE_OUTPUT)/lib/$(basename $(LIB_ONE))
else
$(LIB_ONE): FORCE
@[ -d $(dir $@) ] || mkdir -p $(dir $@)