DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] eal/windows: fix mingw build
@ 2023-11-22 16:32 Bruce Richardson
  2023-11-22 16:36 ` David Marchand
  0 siblings, 1 reply; 3+ messages in thread
From: Bruce Richardson @ 2023-11-22 16:32 UTC (permalink / raw)
  To: dev
  Cc: Tyler Retzlaff, Bruce Richardson, dmitry.kozliuk, stable,
	Narcisa Ana Maria Vasile, Dmitry Malloy, Pallavi Kadam

When compiling with mingw on Ubuntu 23.10, I get the following compiler
error:

../../lib/eal/windows/eal_memory.c:77: error: "MEM_REPLACE_PLACEHOLDER" redefined [-Werror]
   77 | #define MEM_REPLACE_PLACEHOLDER   0x00004000
      |
In file included from /usr/share/mingw-w64/include/minwindef.h:163,
                 from /usr/share/mingw-w64/include/windef.h:9,
                 from /usr/share/mingw-w64/include/windows.h:69,
                 from ../../lib/eal/windows/include/rte_windows.h:32,
                 from ../../lib/eal/windows/include/rte_os_shim.h:9,
                 from ../../lib/eal/common/eal_internal_cfg.h:14,
                 from ../../lib/eal/windows/eal_memory.c:11:
/usr/share/mingw-w64/include/winnt.h:5710: note: this is the location of the previous definition
 5710 | #define MEM_REPLACE_PLACEHOLDER 0x4000

and a similar error for MEM_RESERVE_PLACEHOLDER. These errors can be
fixed by wrapping the two defines in #ifndef .. #endif blocks.

Fixes: 2a5d547a4a9b ("eal/windows: implement basic memory management")
Cc: dmitry.kozliuk@gmail.com
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 lib/eal/windows/eal_memory.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/eal/windows/eal_memory.c b/lib/eal/windows/eal_memory.c
index 215d768e2c..64598745de 100644
--- a/lib/eal/windows/eal_memory.c
+++ b/lib/eal/windows/eal_memory.c
@@ -74,8 +74,13 @@ static VirtualAlloc2_type VirtualAlloc2_ptr;
 
 #define MEM_COALESCE_PLACEHOLDERS 0x00000001
 #define MEM_PRESERVE_PLACEHOLDER  0x00000002
+
+#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.40.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] eal/windows: fix mingw build
  2023-11-22 16:32 [PATCH] eal/windows: fix mingw build Bruce Richardson
@ 2023-11-22 16:36 ` David Marchand
  2023-11-22 16:41   ` Bruce Richardson
  0 siblings, 1 reply; 3+ messages in thread
From: David Marchand @ 2023-11-22 16:36 UTC (permalink / raw)
  To: Bruce Richardson
  Cc: dev, Tyler Retzlaff, dmitry.kozliuk, stable,
	Narcisa Ana Maria Vasile, Dmitry Malloy, Pallavi Kadam

On Wed, Nov 22, 2023 at 5:32 PM Bruce Richardson
<bruce.richardson@intel.com> wrote:
>
> When compiling with mingw on Ubuntu 23.10, I get the following compiler
> error:
>
> ../../lib/eal/windows/eal_memory.c:77: error: "MEM_REPLACE_PLACEHOLDER" redefined [-Werror]
>    77 | #define MEM_REPLACE_PLACEHOLDER   0x00004000
>       |
> In file included from /usr/share/mingw-w64/include/minwindef.h:163,
>                  from /usr/share/mingw-w64/include/windef.h:9,
>                  from /usr/share/mingw-w64/include/windows.h:69,
>                  from ../../lib/eal/windows/include/rte_windows.h:32,
>                  from ../../lib/eal/windows/include/rte_os_shim.h:9,
>                  from ../../lib/eal/common/eal_internal_cfg.h:14,
>                  from ../../lib/eal/windows/eal_memory.c:11:
> /usr/share/mingw-w64/include/winnt.h:5710: note: this is the location of the previous definition
>  5710 | #define MEM_REPLACE_PLACEHOLDER 0x4000
>
> and a similar error for MEM_RESERVE_PLACEHOLDER. These errors can be
> fixed by wrapping the two defines in #ifndef .. #endif blocks.
>
> Fixes: 2a5d547a4a9b ("eal/windows: implement basic memory management")
> Cc: dmitry.kozliuk@gmail.com
> Cc: stable@dpdk.org
>
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>

Probably a duplicate of
https://patchwork.dpdk.org/project/dpdk/patch/20231114170529.176665-1-getelson@nvidia.com/

-- 
David Marchand


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] eal/windows: fix mingw build
  2023-11-22 16:36 ` David Marchand
@ 2023-11-22 16:41   ` Bruce Richardson
  0 siblings, 0 replies; 3+ messages in thread
From: Bruce Richardson @ 2023-11-22 16:41 UTC (permalink / raw)
  To: David Marchand
  Cc: dev, Tyler Retzlaff, dmitry.kozliuk, stable,
	Narcisa Ana Maria Vasile, Dmitry Malloy, Pallavi Kadam

On Wed, Nov 22, 2023 at 05:36:44PM +0100, David Marchand wrote:
> On Wed, Nov 22, 2023 at 5:32 PM Bruce Richardson
> <bruce.richardson@intel.com> wrote:
> >
> > When compiling with mingw on Ubuntu 23.10, I get the following compiler
> > error:
> >
> > ../../lib/eal/windows/eal_memory.c:77: error: "MEM_REPLACE_PLACEHOLDER" redefined [-Werror]
> >    77 | #define MEM_REPLACE_PLACEHOLDER   0x00004000
> >       |
> > In file included from /usr/share/mingw-w64/include/minwindef.h:163,
> >                  from /usr/share/mingw-w64/include/windef.h:9,
> >                  from /usr/share/mingw-w64/include/windows.h:69,
> >                  from ../../lib/eal/windows/include/rte_windows.h:32,
> >                  from ../../lib/eal/windows/include/rte_os_shim.h:9,
> >                  from ../../lib/eal/common/eal_internal_cfg.h:14,
> >                  from ../../lib/eal/windows/eal_memory.c:11:
> > /usr/share/mingw-w64/include/winnt.h:5710: note: this is the location of the previous definition
> >  5710 | #define MEM_REPLACE_PLACEHOLDER 0x4000
> >
> > and a similar error for MEM_RESERVE_PLACEHOLDER. These errors can be
> > fixed by wrapping the two defines in #ifndef .. #endif blocks.
> >
> > Fixes: 2a5d547a4a9b ("eal/windows: implement basic memory management")
> > Cc: dmitry.kozliuk@gmail.com
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> 
> Probably a duplicate of
> https://patchwork.dpdk.org/project/dpdk/patch/20231114170529.176665-1-getelson@nvidia.com/
>

Yep, duplicate. I'll reject my patch in patchwork. Hopefully the patch
above will be merged soon to make this issue go away! :-)

/Bruce

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-11-22 16:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-22 16:32 [PATCH] eal/windows: fix mingw build Bruce Richardson
2023-11-22 16:36 ` David Marchand
2023-11-22 16:41   ` Bruce Richardson

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).