From: Andre Muezerie <andremue@linux.microsoft.com>
To: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Cc: dev@dpdk.org, Andre Muezerie <andremue@linux.microsoft.com>
Subject: [PATCH] buildtools: remove invalid option for Microsoft linker
Date: Tue, 11 Mar 2025 18:53:08 -0700 [thread overview]
Message-ID: <1741744388-2290-1-git-send-email-andremue@linux.microsoft.com> (raw)
When compiling "drivers" directory with MSVC the errors below popped up:
drivers/rte_mempool_stack.pmd.c(1): error C2143: syntax error:
missing ')' before '('
drivers/rte_mempool_stack.pmd.c(1): error C2059: syntax error: ')'
drivers/rte_mempool_stack.pmd.c(1): error C2059: syntax error: ')'
drivers/rte_mempool_stack.pmd.c(1): error C2143: syntax error:
missing ')' before 'const'
drivers/rte_mempool_stack.pmd.c(1): error C2091: function returns function
The fix is to use common macros compatible with MSVC.
Signed-off-by: Andre Muezerie <andremue@linux.microsoft.com>
---
buildtools/pmdinfogen.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/buildtools/pmdinfogen.py b/buildtools/pmdinfogen.py
index dfb89500c0..116f05e7a8 100755
--- a/buildtools/pmdinfogen.py
+++ b/buildtools/pmdinfogen.py
@@ -192,7 +192,7 @@ def dump(self, file):
dumped = json.dumps(self.__dict__)
escaped = dumped.replace('"', '\\"')
print(
- 'const char %s_pmd_info[] __attribute__((used)) = "PMD_INFO_STRING= %s";'
+ 'const char %s_pmd_info[] __rte_used = "PMD_INFO_STRING= %s";'
% (self.name, escaped),
file=file,
)
@@ -252,7 +252,8 @@ def open_output(path):
def write_header(output):
output.write(
- "static __attribute__((unused)) const char *generator = \"%s\";\n" % sys.argv[0]
+ "#include <rte_common.h>\n"
+ "static __rte_unused const char *generator = \"%s\";\n" % sys.argv[0]
)
--
2.48.1.vfs.0.1
next reply other threads:[~2025-03-12 1:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-12 1:53 Andre Muezerie [this message]
2025-03-12 10:29 ` Bruce Richardson
2025-03-12 11:53 ` David Marchand
2025-03-12 19:38 ` 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=1741744388-2290-1-git-send-email-andremue@linux.microsoft.com \
--to=andremue@linux.microsoft.com \
--cc=dev@dpdk.org \
--cc=dmitry.kozliuk@gmail.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).