From: "Christoph Egger" Subject: [PATCH] libxc: Include path fix Date: Tue, 24 Oct 2006 11:17:15 +0200 Message-ID: <200610241117.15674.Christoph.Egger@amd.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Boundary-00=_bodPF81mfGFYJGz" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --Boundary-00=_bodPF81mfGFYJGz Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline 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. --Boundary-00=_bodPF81mfGFYJGz Content-Type: text/x-diff; charset=us-ascii; name=tools_includepath.diff Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=tools_includepath.diff diff -r 29b02d929b7e tools/Rules.mk =2D-- a/tools/Rules.mk Mon Oct 23 14:42:52 2006 +0100 +++ b/tools/Rules.mk Tue Oct 24 11:05:16 2006 +0200 @@ -9,6 +9,7 @@ XEN_LIBXC =3D $(XEN_ROOT)/tools/l XEN_LIBXC =3D $(XEN_ROOT)/tools/libxc XEN_XENSTORE =3D $(XEN_ROOT)/tools/xenstore XEN_LIBXENSTAT =3D $(XEN_ROOT)/tools/xenstat/libxenstat/src +XEN_INCLUDE =3D $(XEN_ROOT)/xen/include =20 X11_LDPATH =3D -L/usr/X11R6/$(LIBDIR) =20 diff -r 29b02d929b7e tools/libxc/Makefile =2D-- a/tools/libxc/Makefile Mon Oct 23 14:42:52 2006 +0100 +++ b/tools/libxc/Makefile Tue Oct 24 11:05:16 2006 +0200 @@ -33,7 +33,7 @@ GUEST_SRCS-$(CONFIG_HVM) +=3D xc_hvm_build =20 CFLAGS +=3D -Werror CFLAGS +=3D -fno-strict-aliasing =2DCFLAGS +=3D $(INCLUDES) -I. +CFLAGS +=3D $(INCLUDES) -I. -I$(XEN_INCLUDE) =20 # Define this to make it possible to run valgrind on code linked with these # libraries. --Boundary-00=_bodPF81mfGFYJGz Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --Boundary-00=_bodPF81mfGFYJGz--