From: Neil Horman <nhorman@tuxdriver.com>
To: Maciej Gajdzica <maciejx.t.gajdzica@intel.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [dpdk-dev,1/1] compat: fixed versioning macros
Date: Wed, 24 Jun 2015 13:42:24 -0400 [thread overview]
Message-ID: <20150624174224.GA31530@hmsreliant.think-freely.org> (raw)
In-Reply-To: <1435059494-6245-1-git-send-email-maciejx.t.gajdzica@intel.com>
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 <maciejx.t.gajdzica@intel.com>
>
> ---
> 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 <rte_common.h>
>
> -#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
prev parent reply other threads:[~2015-06-24 17:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-23 11:38 [dpdk-dev] [PATCH 1/1] " Maciej Gajdzica
2015-06-24 17:42 ` Neil Horman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150624174224.GA31530@hmsreliant.think-freely.org \
--to=nhorman@tuxdriver.com \
--cc=dev@dpdk.org \
--cc=maciejx.t.gajdzica@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).