From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f196.google.com (mail-wr0-f196.google.com [209.85.128.196]) by dpdk.org (Postfix) with ESMTP id AC4D82BDF for ; Wed, 1 Mar 2017 15:35:53 +0100 (CET) Received: by mail-wr0-f196.google.com with SMTP id u48so5791534wrc.1 for ; Wed, 01 Mar 2017 06:35:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=xajvg8XFBsJHgfOBN+JVJahcqzb+PhoToJ3BBtof6J8=; b=CuWDDOhUoXTvlNE1cjvBqwwhlyvTV3J8kYNzbBbR05ql4QSuoGJnaZmSK2rBenfCys EsnxUST0PR8rOoSzPYMufuWuMMJ0kaei7lcBTXYwM46w3yaOJZu7L1fd8Pec0LLunp5d 9MBYqm5ziQiQ4AnIjeIOxyBxCCpvjaxcAjCiewNC61PMjMpq5pne3x7KZ/h6exTAh1Mb Sh4kCM55lIXTJBPD8lHBED4gYfOinXXMkZGRokfMo8pS/FvEXvXQH3FstNScQnfC30lk ch3Hbr2MWATWeE0o3oU10YtNzw1i+UfCkwxlO0HXdkF/ECAOAw2YLl7gBavYIQm3Upak P+vA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=xajvg8XFBsJHgfOBN+JVJahcqzb+PhoToJ3BBtof6J8=; b=LJZyjw2GPvvFuxuR+nb+OxhiBjOQU2xR48fpZhjtHDb1s3EYgd24QOvf5tSj+e14/b MH0t/iRicZ09jqvscovoZCCDHsAGx02HrsScvZqklluv/foN52HYuokNPFuqU+IGLfNd fwSpHiX7KgpgLDrEGvATMypox+8iaGFCvwrAY+lk3qgYZhPbQtst0YM7fMJ2p/wyJeCp kOk2bALPFU+cx+zMGY64z6RUSa1c6FZnGKLFKw+CQNb9aLIchJHKfGOaHS++eRoRgCFK 69MvgMcO1fy3f+zewX+ynP8N78KYtT+nWJOUOKU8qE2hNeyJIczzNkaRzHYE/DNO2YQF WEmQ== X-Gm-Message-State: AMke39lPB/RA/6NP1vb+iTT2gO7nvLfSz1jQtfsTdSxU+LYYmSrOs1hzdyzHFvnvX1Uu1h5VUom+AQ9xw0VLRw== X-Received: by 10.223.172.77 with SMTP id v71mr8676888wrc.131.1488378953428; Wed, 01 Mar 2017 06:35:53 -0800 (PST) MIME-Version: 1.0 Sender: jblunck@gmail.com Received: by 10.28.211.20 with HTTP; Wed, 1 Mar 2017 06:35:52 -0800 (PST) In-Reply-To: <1488360852-14458-1-git-send-email-christian.ehrhardt@canonical.com> References: <1488360852-14458-1-git-send-email-christian.ehrhardt@canonical.com> From: Jan Blunck Date: Wed, 1 Mar 2017 15:35:52 +0100 X-Google-Sender-Auth: rBgdSQys7sEy2JkGwjuc9FjArPs Message-ID: To: Christian Ehrhardt Cc: dev , "cjcollier @ linuxfoundation . org" , ricardo.salveti@linaro.org, Luca Boccassi Content-Type: text/plain; charset=UTF-8 Subject: Re: [dpdk-dev] [PATCH v2] mk: Provide option to set Major ABI version X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Mar 2017 14:35:53 -0000 On Wed, Mar 1, 2017 at 10:34 AM, Christian Ehrhardt wrote: > Downstreams might want to provide different DPDK releases at the same > time to support multiple consumers of DPDK linked against older and newer > sonames. > > Also due to the interdependencies that DPDK libraries can have applications > might end up with an executable space in which multiple versions of a > library are mapped by ld.so. > > Think of LibA that got an ABI bump and LibB that did not get an ABI bump > but is depending on LibA. > > Application > \-> LibA.old > \-> LibB.new -> LibA.new > > That is a conflict which can be avoided by setting CONFIG_RTE_MAJOR_ABI. > If set CONFIG_RTE_MAJOR_ABI overwrites any LIBABIVER value. > An example might be ``CONFIG_RTE_MAJOR_ABI=16.11`` which will make all > libraries librte.so.16.11 instead of librte.so.. > > We need to cut arbitrary long stings after the .so now and this would work > for any ABI version in LIBABIVER: > $(Q)ln -s -f $< $(patsubst %.$(LIBABIVER),%,$@) > But using the following instead additionally allows to simplify the Make > File for the CONFIG_RTE_NEXT_ABI case. > $(Q)ln -s -f $< $(shell echo $@ | sed 's/\.so.*/.so/') > > Signed-off-by: Christian Ehrhardt > --- > config/common_base | 5 +++++ > doc/guides/contributing/versioning.rst | 25 +++++++++++++++++++++++++ > mk/rte.lib.mk | 14 +++++++++----- > 3 files changed, 39 insertions(+), 5 deletions(-) > > diff --git a/config/common_base b/config/common_base > index aeee13e..37aa1e1 100644 > --- a/config/common_base > +++ b/config/common_base > @@ -75,6 +75,11 @@ CONFIG_RTE_BUILD_SHARED_LIB=n > CONFIG_RTE_NEXT_ABI=y > > # > +# Major ABI to overwrite library specific LIBABIVER > +# > +CONFIG_RTE_MAJOR_ABI= > + > +# > # Machine's cache line size > # > CONFIG_RTE_CACHE_LINE_SIZE=64 > diff --git a/doc/guides/contributing/versioning.rst b/doc/guides/contributing/versioning.rst > index fbc44a7..8aaf370 100644 > --- a/doc/guides/contributing/versioning.rst > +++ b/doc/guides/contributing/versioning.rst > @@ -133,6 +133,31 @@ The macros exported are: > fully qualified function ``p``, so that if a symbol becomes versioned, it > can still be mapped back to the public symbol name. > > +Setting a Major ABI version > +--------------------------- > + > +Downstreams might want to provide different DPDK releases at the same time to > +support multiple consumers of DPDK linked against older and newer sonames. > + > +Also due to the interdependencies that DPDK libraries can have applications > +might end up with an executable space in which multiple versions of a library > +are mapped by ld.so. > + > +Think of LibA that got an ABI bump and LibB that did not get an ABI bump but is > +depending on LibA. > + > +.. note:: > + > + Application > + \-> LibA.old > + \-> LibB.new -> LibA.new > + > +That is a conflict which can be avoided by setting ``CONFIG_RTE_MAJOR_ABI``. > +If set, the value of ``CONFIG_RTE_MAJOR_ABI`` overwrites all - otherwise per > +library - versions defined in the libraries ``LIBABIVER``. > +An example might be ``CONFIG_RTE_MAJOR_ABI=16.11`` which will make all libraries > +``librte.so.16.11`` instead of ``librte.so.``. > + > Examples of ABI Macro use > ------------------------- > > diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk > index 33a5f5a..1ffbf42 100644 > --- a/mk/rte.lib.mk > +++ b/mk/rte.lib.mk > @@ -40,12 +40,20 @@ EXTLIB_BUILD ?= n > # VPATH contains at least SRCDIR > VPATH += $(SRCDIR) > > +ifneq ($(CONFIG_RTE_MAJOR_ABI),) > +ifneq ($(LIBABIVER),) > +LIBABIVER := $(CONFIG_RTE_MAJOR_ABI) > +endif > +endif > + > ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y) > LIB := $(patsubst %.a,%.so.$(LIBABIVER),$(LIB)) > ifeq ($(EXTLIB_BUILD),n) > +ifeq ($(CONFIG_RTE_MAJOR_ABI),) > ifeq ($(CONFIG_RTE_NEXT_ABI),y) > LIB := $(LIB).1 > endif > +endif > CPU_LDFLAGS += --version-script=$(SRCDIR)/$(EXPORT_MAP) > endif > endif > @@ -156,11 +164,7 @@ $(RTE_OUTPUT)/lib/$(LIB): $(LIB) > @[ -d $(RTE_OUTPUT)/lib ] || mkdir -p $(RTE_OUTPUT)/lib > $(Q)cp -f $(LIB) $(RTE_OUTPUT)/lib > ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y) > -ifeq ($(CONFIG_RTE_NEXT_ABI)$(EXTLIB_BUILD),yn) > - $(Q)ln -s -f $< $(basename $(basename $@)) > -else > - $(Q)ln -s -f $< $(basename $@) > -endif > + $(Q)ln -s -f $< $(shell echo $@ | sed 's/\.so.*/.so/') > endif > > # > -- > 2.7.4 > Reviewed-by: Jan Blunck Tested-by: Jan Blunck