All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] stubdom: foreignmemory: Fix build after 0dbb4be739c5
@ 2021-07-13  9:20 Julien Grall
  2021-07-13  9:25 ` Andrew Cooper
  2021-07-13  9:27 ` Juergen Gross
  0 siblings, 2 replies; 33+ messages in thread
From: Julien Grall @ 2021-07-13  9:20 UTC (permalink / raw)
  To: xen-devel
  Cc: julien, Julien Grall, Ian Jackson, Wei Liu, Juergen Gross, Andrew Cooper

From: Julien Grall <jgrall@amazon.com>

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@amazon.com>

---

Cc: Andrew Cooper <andrew.cooper3@citrix.com>

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.
---
 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@eu.citrix.com>.
  */
 
+/*
+ * xenctlr.h currently defines __XEN_TOOLS__ which affects what is
+ * exposed by Xen headers. As the define needs to be set consistently,
+ * we want to include xenctrl.h before the mini-os headers (they include
+ * public headers).
+ */
+#include <xenctrl.h>
+
 #include <mini-os/types.h>
 #include <mini-os/os.h>
 #include <mini-os/mm.h>
-- 
2.17.1



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

end of thread, other threads:[~2021-07-30  9:18 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-13  9:20 [PATCH] stubdom: foreignmemory: Fix build after 0dbb4be739c5 Julien Grall
2021-07-13  9:25 ` Andrew Cooper
2021-07-13  9:27 ` Juergen Gross
2021-07-13  9:31   ` Julien Grall
2021-07-13 10:35     ` Juergen Gross
2021-07-13  9:35   ` Andrew Cooper
2021-07-13 11:21     ` Julien Grall
2021-07-13 11:23       ` Andrew Cooper
2021-07-13 11:53         ` Julien Grall
2021-07-13 12:39           ` Andrew Cooper
2021-07-13 13:00             ` Julien Grall
2021-07-13 13:46               ` Costin Lupu
2021-07-13 14:00                 ` Juergen Gross
2021-07-13 14:14                   ` Jan Beulich
2021-07-13 14:19                     ` Julien Grall
2021-07-13 14:23                       ` Jan Beulich
2021-07-13 14:33                         ` Julien Grall
2021-07-13 15:52                           ` Jan Beulich
2021-07-13 16:15                             ` Julien Grall
2021-07-13 16:27                               ` Jan Beulich
2021-07-13 16:33                                 ` Julien Grall
2021-07-14  6:11                                   ` Jan Beulich
2021-07-14  8:51                                     ` Julien Grall
2021-07-13 14:23                       ` Juergen Gross
2021-07-13 14:28                         ` Jan Beulich
2021-07-13 14:33                           ` Juergen Gross
2021-07-13 14:38                         ` Julien Grall
2021-07-13 15:09                           ` Juergen Gross
2021-07-13 15:15                             ` Julien Grall
2021-07-13 15:20                               ` Juergen Gross
2021-07-16 18:28                                 ` Costin Lupu
2021-07-27 13:36                                   ` Andrew Cooper
2021-07-30  9:18                                     ` Costin Lupu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.