[PATCH v2 0/5] mbuf: enable to be compiled with MSVC
Andre Muezerie
andremue at linux.microsoft.com
Wed Feb 19 02:39:53 CET 2025
When compiling with MSVC the error below shows up due to function
versioning:
../lib/net/rte_net_crc.c(418): error C2061: syntax error:
identifier '__attribute__'
MSVC allows alias function names to be exported, but the mechanism is
different than the one used by gcc. It was considered to enhance the logic
in the existing version.map files but that file is also passed to other
tools on Linux, making this challenging. A simpler approach is to have an
optional version.map file to be used only when Microsoft's linker is to be
used. This optional map file is only necessary for libraries that have
versioned code.
v2:
- updated versioning macros so that the latest mbuf/net code can compile
with MSVC. V1 did not have these changes because by the time that series
was sent out the versioning problem had not surfaced yet.
- for testing purposes, dpdk-test was build with msvc and crc_autotest
was run successfully. This test is known to call the versioned function
which raised the issue.
Andre Muezerie (5):
doc: update guide on versioning macros
buildtools: update map_to_win.py to use optional map file
eal: update versioning macros
net: update use of versioning macros
mbuf: enable to be compiled with MSVC
buildtools/map_to_win.py | 16 ++++++++++++++-
doc/guides/contributing/abi_versioning.rst | 6 ++++++
lib/eal/include/rte_function_versioning.h | 19 ++++++++++++++++++
lib/mbuf/meson.build | 6 ------
lib/net/rte_net_crc.c | 2 ++
lib/net/version_ms_linker.map | 23 ++++++++++++++++++++++
6 files changed, 65 insertions(+), 7 deletions(-)
create mode 100644 lib/net/version_ms_linker.map
--
2.48.1.vfs.0.0
More information about the dev
mailing list