[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] stubdom: foreignmemory: Fix build after 0dbb4be739c5





On 13/07/2021 10:27, Juergen Gross wrote:
On 13.07.21 11:20, Julien Grall wrote:
From: Julien Grall <jgrall@xxxxxxxxxx>

Commit 0dbb4be739c5 add the inclusion of xenctrl.h from private.h and
wreck the build in an interesting way:

In file included from xen/stubdom/include/xen/domctl.h:39:0,
                  from xen/tools/include/xenctrl.h:36,
                  from private.h:4,
                  from minios.c:29:
xen/include/public/memory.h:407:5: error: expected specifier-qualifier-list before ‘XEN_GUEST_HANDLE_64’
      XEN_GUEST_HANDLE_64(const_uint8) buffer;
      ^~~~~~~~~~~~~~~~~~~

This is happening because xenctrl.h defines __XEN_TOOLS__ and therefore
the public headers will start to expose the non-stable ABI. However,
xen.h has already been included by a mini-OS header before hand. So
there is a mismatch in the way the headers are included.

For now solve it in a very simple (and gross) way by including
xenctrl.h before the mini-os headers.

Fixes: 0dbb4be739c5 ("tools/libs/foreignmemory: Fix PAGE_SIZE redefinition error")
Signed-off-by: Julien Grall <jgrall@xxxxxxxxxx>

---

Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

I couldn't find a better way with would not result to revert the patch
(and break build on some system) or involve a longer rework of the
headers.

Just adding a "#define __XEN_TOOLS__" before the #include statements
doesn't work?
It works but if someone decides to the rework the header and drop __XEN_TOOLS__ we would still define in minios.c (we technically don't need it). So I find the solution a lot worse than what I wrote.


---
  tools/libs/foreignmemory/minios.c | 8 ++++++++
  1 file changed, 8 insertions(+)

diff --git a/tools/libs/foreignmemory/minios.c b/tools/libs/foreignmemory/minios.c
index c5453736d598..d7b3f0e1c823 100644
--- a/tools/libs/foreignmemory/minios.c
+++ b/tools/libs/foreignmemory/minios.c
@@ -17,6 +17,14 @@
   * Copyright 2007-2008 Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>.
   */
+/*
+ * xenctlr.h currently defines __XEN_TOOLS__ which affects what is

Typo, should be xenctrl.h

I will fix it.

--
Julien Grall



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.