On Thu, Mar 06, 2025 at 01:50:20PM +0100, David Marchand wrote:
> For versioning symbols:
> - MSVC uses pragmas on the symbol,
> - GNU linker uses special asm directives,
> 
> To accommodate both GNU linker and MSVC linker, introduce new macros for
> exporting and versioning symbols that will surround the whole function.
> 
> This has the advantage of hiding all the ugly details in the macros.
> Now versioning a symbol is just a call to a single macro:
> - RTE_VERSION_SYMBOL (resp. RTE_VERSION_EXPERIMENTAL_SYMBOL), for
>   keeping an old implementation code under a versioned function (resp.
>   experimental function),
> - RTE_DEFAULT_SYMBOL, for declaring the new default versioned function,
>   and handling the static link special case, instead of
>   BIND_DEFAULT_SYMBOL + MAP_STATIC_SYMBOL,
> 
> Documentation has been updated though it needs some polishing.
> The experimental macro has not been tested.
> 
> Signed-off-by: David Marchand <david.march...@redhat.com>
> ---
> Changes since RFC v1:
> - renamed and prefixed macros,
> - reindented in prevision of second patch,
> 
> ---
>  doc/guides/contributing/abi_versioning.rst | 130 ++++-----------------
>  lib/eal/include/rte_function_versioning.h  |  27 +++++
>  lib/net/rte_net_crc.c                      |  30 ++---
>  3 files changed, 57 insertions(+), 130 deletions(-)
> 

I like the proposal. Having a single macro able to handle different linkers
is clearly a good step forward.

Acked-by: Andre Muezerie <andre...@linux.microsoft.com>

Reply via email to