From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.tuxdriver.com (charlotte.tuxdriver.com [70.61.120.58]) by dpdk.org (Postfix) with ESMTP id CC610C4FA for ; Wed, 24 Jun 2015 19:42:34 +0200 (CEST) Received: from hmsreliant.think-freely.org ([2001:470:8:a08:7aac:c0ff:fec2:933b] helo=localhost) by smtp.tuxdriver.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.63) (envelope-from ) id 1Z7ogw-0001yY-R2; Wed, 24 Jun 2015 13:42:33 -0400 Date: Wed, 24 Jun 2015 13:42:24 -0400 From: Neil Horman To: Maciej Gajdzica Message-ID: <20150624174224.GA31530@hmsreliant.think-freely.org> References: <1435059494-6245-1-git-send-email-maciejx.t.gajdzica@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1435059494-6245-1-git-send-email-maciejx.t.gajdzica@intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Score: -2.9 (--) X-Spam-Status: No Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [dpdk-dev,1/1] compat: fixed versioning macros X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jun 2015 17:42:35 -0000 On Tue, Jun 23, 2015 at 01:38:14PM +0200, Maciej Gajdzica wrote: > Previous version of versioning macros didn't work properly. When > building dpdk as static library, external application couldn't use > versioned function. It happened, because versioning macros for static > library were empty. Now the same version of versioning macros is used > for both static and dynamic libraries. > > Signed-off-by: Maciej Gajdzica > > --- > lib/librte_compat/rte_compat.h | 25 +++++-------------------- > 1 file changed, 5 insertions(+), 20 deletions(-) > > diff --git a/lib/librte_compat/rte_compat.h b/lib/librte_compat/rte_compat.h > index fb0dc19..c5752c1 100644 > --- a/lib/librte_compat/rte_compat.h > +++ b/lib/librte_compat/rte_compat.h > @@ -32,8 +32,6 @@ > #define _RTE_COMPAT_H_ > #include > > -#ifdef RTE_BUILD_SHARED_LIB > - > /* > * Provides backwards compatibility when updating exported functions. > * When a symol is exported from a library to provide an API, it also provides a > @@ -59,12 +57,14 @@ > * 3) Add this macro immediately below the function > * VERSION_SYMBOL(foo, _v20, 2.0); > * > - * 4) Implement a new version of foo. > - * char foo(int value, int otherval) { ...} > + * 4) Implement a new version of foo with _v21 suffix. > + * char foo_v21(int value, int otherval) { ...} > * > * 5) Mark the newest version as the default version > - * BIND_DEFAULT_SYMBOL(foo, 2.1); > + * BIND_DEFAULT_SYMBOL(foo, _v21, 2.1); > * > + * 6) Header file should contain definitions of all three > + * functions (foo, foo_v20, foo_v21). > */ > > /* > @@ -96,19 +96,4 @@ > #define BIND_DEFAULT_SYMBOL(b, e, n) __asm__(".symver " RTE_STR(b) RTE_STR(e) ", "RTE_STR(b)"@@DPDK_"RTE_STR(n)) > #define __vsym __attribute__((used)) > > -#else > -/* > - * No symbol versioning in use > - */ > -#define VERSION_SYMBOL(b, e, v) > -#define __vsym > -#define BASE_SYMBOL(b, n) > -#define BIND_DEFAULT_SYMBOL(b, v) > - > -/* > - * RTE_BUILD_SHARED_LIB=n > - */ > -#endif > - > - > #endif /* _RTE_COMPAT_H_ */ NAK Sorry it took me a bit to get to this, but you don't want to remove th empty definitions from this header. The .symver directives aren't meaningful when doing a static build, and we don't want them to cause any odd compilation errors. Neil