libxc: Include path fix
PATCH 1/1 libxc: Include path fix
Hi!
There's a include path mistake when trying to build tools/libxc on OpenBSD:
gcc -O2 -fomit-frame-pointer -m32 -march=i686 -DNDEBUG -std=gnu99 -Wall
-Wstrict-prototypes -Wno-unused-value -D__XEN_TOOLS__ -Werror
-fno-strict-aliasing -I. -Wp,-MD,.xc_core.o.d -c -o xc_core.o xc_core.c In file included from xc_private.h:18,
from xg_private.h:16,
from xc_core.c:1:xen/privcmd.h:36:23: asm/types.h: No such file or directory
gcc tries to use /usr/include/asm/types.h, which only exists on Linux (and therefore works on Linux).
The attached patch tells gcc to use $(XEN_ROOT)/xen/include/asm/types.h. I think, this was originally intended, right?
ATTENTION: The patch uncovers several header issues:
gcc -O2 -fomit-frame-pointer -m32 -march=i686 -DNDEBUG -std=gnu99 -Wall
-Wstrict-prototypes -Wno-unused-value -D__XEN_TOOLS__ -Werror
-fno-strict-aliasing -I. -I../../xen/include -Wp,-MD,.xc_core.o.d -c -o xc_core.o xc_core.c
In file included from ../../xen/include/xen/config.h:10,
from ../../xen/include/asm/types.h:6,
from xen/privcmd.h:36,
from xc_private.h:18,
from xg_private.h:16,
from xc_core.c:1:
../../xen/include/asm/config.h:278:1: "HYPERVISOR_VIRT_START" redefined
In file included from xen/xen.h:15,
from xenctrl.h:19,
from xg_private.h:14,
from xc_core.c:1:
xen/arch-x86_32.h:107:1: this is the location of the previous definition
In file included from ../../xen/include/xen/config.h:37,
from ../../xen/include/asm/types.h:6,
from xen/privcmd.h:36,
from xc_private.h:18,
from xg_private.h:16,
from xc_core.c:1:
../../xen/include/xen/compiler.h:35:1: "offsetof" redefined
In file included from xenctrl.h:17,
from xg_private.h:14,
from xc_core.c:1:
/usr/include/stddef.h:75:1: this is the location of the previous definition
In file included from xen/privcmd.h:36,
from xc_private.h:18,
from xg_private.h:16,
from xc_core.c:1:../../xen/include/asm/types.h:43: error: conflicting types for paddr_t' /usr/include/sys/types.h:124: error: previous declaration of paddr_t' ../../xen/include/asm/types.h:53: warning: redefinition of size_t' /usr/include/sys/types.h:178: warning: size_t' previously declared here gmake[1]: *** [xc_core.o] Error 1
gmake[1]: Leaving directory `/usr/src/xen-unstable-openbsd.hg/tools/libxc'
gmake: *** [build] Error 2
The patch should NOT go into -unstable, until the header issues have been fixed. I post this patch just in case there's someone else having build troubles with libxc.
tools/Rules.mk +1 -0
@@ -9,6 +9,7 @@ XEN_LIBXC = $(XEN_ROOT)/tools/l XEN_LIBXC = $(XEN_ROOT)/tools/libxc XEN_XENSTORE = $(XEN_ROOT)/tools/xenstore XEN_LIBXENSTAT = $(XEN_ROOT)/tools/xenstat/libxenstat/src +XEN_INCLUDE = $(XEN_ROOT)/xen/include X11_LDPATH = -L/usr/X11R6/$(LIBDIR)
tools/libxc/Makefile +1 -1
@@ -33,7 +33,7 @@ GUEST_SRCS-$(CONFIG_HVM) += xc_hvm_build CFLAGS += -Werror CFLAGS += -fno-strict-aliasing -CFLAGS += $(INCLUDES) -I. +CFLAGS += $(INCLUDES) -I. -I$(XEN_INCLUDE) # Define this to make it possible to run valgrind on code linked with these # libraries.
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Quoted 2 lines · Christoph Egger
There's a include path mistake when trying to build
tools/libxcon OpenBSD:
Include directory <xen/sys/...> is supposed to contain OS-specific headers. Using the Linux ones on OpenBSD is not guaranteed to work very well! Using xen/include/asm/types.h is *not* the right fix, as you're list of further build problems indicates.
I assume your eventual aim here is to target a dom0 OpenBSD kernel (in which case it should provide its own privcmd.h and evtchn.h)? Otherwise, I don't really see the point of trying to build the user-space tools on OpenBSD when they are actually going to run on Linux.
-- Keir