From: Andre Muezerie <andremue@linux.microsoft.com>
To: andremue@linux.microsoft.com
Cc: dev@dpdk.org
Subject: [PATCH v3 4/6] devtools: check ms linker map files
Date: Thu, 20 Feb 2025 12:31:46 -0800 [thread overview]
Message-ID: <1740083508-6703-5-git-send-email-andremue@linux.microsoft.com> (raw)
In-Reply-To: <1740083508-6703-1-git-send-email-andremue@linux.microsoft.com>
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.
Script check-symbol-maps.sh was updated to check these optional files.
Signed-off-by: Andre Muezerie <andremue@linux.microsoft.com>
---
devtools/check-symbol-maps.sh | 49 +++++++++++++++++++++++++++++------
1 file changed, 41 insertions(+), 8 deletions(-)
diff --git a/devtools/check-symbol-maps.sh b/devtools/check-symbol-maps.sh
index 6121f78ec6..816d52eae0 100755
--- a/devtools/check-symbol-maps.sh
+++ b/devtools/check-symbol-maps.sh
@@ -21,6 +21,21 @@ find_orphan_symbols ()
symsrc=${sym#per_lcore_}
elif echo $sym | grep -q '^__rte_.*_trace_' ; then
symsrc=${sym#__}
+ elif echo $map | grep -Eq '_ms_linker.map$' ; then
+ if echo $sym | grep -q '=' ; then
+ symsrc=$(echo $sym | awk '
+ {
+ idx = index($0, "=")
+ if (idx > 0) {
+ # Use only what is on the left side of "="
+ s = substr($0, 0, idx-1)
+ print s
+ } else {
+ print $0
+ }
+ }
+ ')
+ fi
else
symsrc=$sym
fi
@@ -79,14 +94,32 @@ find_bad_format_maps ()
abi_version=$(cut -d'.' -f 1 ABI_VERSION)
next_abi_version=$((abi_version + 1))
for map in $@ ; do
- cat $map | awk '
- /^(DPDK_('$abi_version'|'$next_abi_version')|EXPERIMENTAL|INTERNAL) \{$/ { next; } # start of a section
- /^}( DPDK_'$abi_version')?;$/ { next; } # end of a section
- /^$/ { next; } # empty line
- /^\t(global:|local: \*;)$/ { next; } # qualifiers
- /^\t[a-zA-Z_0-9]*;( # WINDOWS_NO_EXPORT)?$/ { next; } # symbols
- /^\t# added in [0-9]*\.[0-9]*$/ { next; } # version comments
- { print $0; }' || echo $map
+ if echo $map | grep -Eq '_ms_linker.map$';
+ then
+ # ms linker maps are only used for Windows, so there's no reason for
+ # them to allow WINDOWS_NO_EXPORT.
+ # These .map files accept alias function names, like
+ # rte_net_crc_set_alg=rte_net_crc_set_alg_v26;
+ # Note that alias function names are not allowed in normal .map files.
+ cat $map | awk '
+ /^(DPDK_('$abi_version'|'$next_abi_version')|EXPERIMENTAL|INTERNAL) \{$/ { next; } # start of a section
+ /^}( DPDK_'$abi_version')?;$/ { next; } # end of a section
+ /^$/ { next; } # empty line
+ /^\t(global:|local: \*;)$/ { next; } # qualifiers
+ /^\t[a-zA-Z_0-9]*;$/ { next; } # symbols
+ /^\t[a-zA-Z_0-9]*=[a-zA-Z_0-9]*;$/ { next; } # symbols with aliases
+ /^\t# added in [0-9]*\.[0-9]*$/ { next; } # version comments
+ { print $0; }' || echo $map
+ else
+ cat $map | awk '
+ /^(DPDK_('$abi_version'|'$next_abi_version')|EXPERIMENTAL|INTERNAL) \{$/ { next; } # start of a section
+ /^}( DPDK_'$abi_version')?;$/ { next; } # end of a section
+ /^$/ { next; } # empty line
+ /^\t(global:|local: \*;)$/ { next; } # qualifiers
+ /^\t[a-zA-Z_0-9]*;( # WINDOWS_NO_EXPORT)?$/ { next; } # symbols
+ /^\t# added in [0-9]*\.[0-9]*$/ { next; } # version comments
+ { print $0; }' || echo $map
+ fi
done
}
--
2.48.1.vfs.0.0
next prev parent reply other threads:[~2025-02-20 20:32 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-10 21:51 [PATCH] mbuf: enable to be compiled with MSVC Andre Muezerie
2025-02-10 22:34 ` Stephen Hemminger
2025-02-11 2:19 ` Andre Muezerie
2025-02-12 14:23 ` Thomas Monjalon
2025-02-12 16:24 ` Thomas Monjalon
2025-02-19 1:39 ` [PATCH v2 0/5] " Andre Muezerie
2025-02-19 1:39 ` [PATCH v2 1/5] doc: update guide on versioning macros Andre Muezerie
2025-02-19 1:39 ` [PATCH v2 2/5] buildtools: update map_to_win.py to use optional map file Andre Muezerie
2025-02-19 1:39 ` [PATCH v2 3/5] eal: update versioning macros Andre Muezerie
2025-02-19 1:39 ` [PATCH v2 4/5] net: update use of " Andre Muezerie
2025-02-19 1:39 ` [PATCH v2 5/5] mbuf: enable to be compiled with MSVC Andre Muezerie
2025-02-20 20:31 ` [PATCH v3 0/6] " Andre Muezerie
2025-02-20 20:31 ` [PATCH v3 1/6] doc: update guide on versioning macros Andre Muezerie
2025-02-20 20:31 ` [PATCH v3 2/6] buildtools: update map_to_win.py to use optional map file Andre Muezerie
2025-02-20 20:31 ` [PATCH v3 3/6] eal: update versioning macros Andre Muezerie
2025-02-20 20:31 ` Andre Muezerie [this message]
2025-02-20 20:31 ` [PATCH v3 5/6] net: update use of " Andre Muezerie
2025-02-20 20:31 ` [PATCH v3 6/6] mbuf: enable to be compiled with MSVC Andre Muezerie
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=1740083508-6703-5-git-send-email-andremue@linux.microsoft.com \
--to=andremue@linux.microsoft.com \
--cc=dev@dpdk.org \
/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).