From patchwork Tue Jun 23 11:38:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maciej Gajdzica X-Patchwork-Id: 5709 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id AC89CC844; Tue, 23 Jun 2015 13:41:43 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 4A20DC5BA for ; Tue, 23 Jun 2015 13:41:42 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 23 Jun 2015 04:41:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,665,1427785200"; d="scan'208";a="751677703" Received: from unknown (HELO stargo) ([10.217.248.233]) by orsmga002.jf.intel.com with SMTP; 23 Jun 2015 04:41:39 -0700 Received: by stargo (sSMTP sendmail emulation); Tue, 23 Jun 2015 13:38:16 +0200 From: Maciej Gajdzica To: dev@dpdk.org Date: Tue, 23 Jun 2015 13:38:14 +0200 Message-Id: <1435059494-6245-1-git-send-email-maciejx.t.gajdzica@intel.com> X-Mailer: git-send-email 1.9.1 Subject: [dpdk-dev] [PATCH 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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_ */