patch 'eal/windows: fix build with recent MinGW' has been queued to stable release 22.11.4

Xueming Li xuemingl at nvidia.com
Mon Dec 11 11:12:10 CET 2023


Hi,

FYI, your patch has been queued to stable release 22.11.4

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 12/13/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=22.11-staging&id=364faab59ac86473cbbc5d8ec1a242ea6cf6664b

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 364faab59ac86473cbbc5d8ec1a242ea6cf6664b Mon Sep 17 00:00:00 2001
From: Gregory Etelson <getelson at nvidia.com>
Date: Tue, 14 Nov 2023 19:05:29 +0200
Subject: [PATCH] eal/windows: fix build with recent MinGW
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit c6221c664e52a94baf259a29ea73645496502af1 ]

Windows compilation with cross-mingw on Fedora 39 failed
because MEM_REPLACE_PLACEHOLDER and MEM_RESERVE_PLACEHOLDER were
already defined in the compiler environment:

eal_memory.c:77: error: "MEM_REPLACE_PLACEHOLDER" redefined
/usr/x86_64-w64-mingw32/sys-root/mingw/include/winnt.h:5710: note:
this is the location of the previous definition

eal_memory.c:78: error: "MEM_RESERVE_PLACEHOLDER" redefined
/usr/x86_64-w64-mingw32/sys-root/mingw/include/winnt.h:5715: note:
this is the location of the previous definition

The patch masks MEM_REPLACE_PLACEHOLDER and MEM_RESERVE_PLACEHOLDER
macros if they were pre-defined by compiler.

The patch also masks MEM_COALESCE_PLACEHOLDERS and
MEM_PRESERVE_PLACEHOLDER to prevent similar errors.

Fixes: 2a5d547a4a9b ("eal/windows: implement basic memory management")

Signed-off-by: Gregory Etelson <getelson at nvidia.com>
Acked-by: Tyler Retzlaff <roretzla at linux.microsoft.com>
Acked-by: Dmitry Kozlyuk <dmitry.kozliuk at gmail.com>
Acked-by: Thomas Monjalon <thomas at monjalon.net>
---
 lib/eal/windows/eal_memory.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/lib/eal/windows/eal_memory.c b/lib/eal/windows/eal_memory.c
index 215d768e2c..31410a41fd 100644
--- a/lib/eal/windows/eal_memory.c
+++ b/lib/eal/windows/eal_memory.c
@@ -72,10 +72,18 @@ static VirtualAlloc2_type VirtualAlloc2_ptr;
 
 #ifdef RTE_TOOLCHAIN_GCC
 
+#ifndef MEM_COALESCE_PLACEHOLDERS
 #define MEM_COALESCE_PLACEHOLDERS 0x00000001
+#endif
+#ifndef MEM_PRESERVE_PLACEHOLDER
 #define MEM_PRESERVE_PLACEHOLDER  0x00000002
+#endif
+#ifndef MEM_REPLACE_PLACEHOLDER
 #define MEM_REPLACE_PLACEHOLDER   0x00004000
+#endif
+#ifndef MEM_RESERVE_PLACEHOLDER
 #define MEM_RESERVE_PLACEHOLDER   0x00040000
+#endif
 
 int
 eal_mem_win32api_init(void)
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-12-11 17:56:26.485848200 +0800
+++ 0105-eal-windows-fix-build-with-recent-MinGW.patch	2023-12-11 17:56:23.217652300 +0800
@@ -1 +1 @@
-From c6221c664e52a94baf259a29ea73645496502af1 Mon Sep 17 00:00:00 2001
+From 364faab59ac86473cbbc5d8ec1a242ea6cf6664b Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit c6221c664e52a94baf259a29ea73645496502af1 ]
@@ -25 +27,0 @@
-Cc: stable at dpdk.org


More information about the stable mailing list