Skip to contentSkip to conversation

Move xenstore and libxc public headers to include subdir

PATCH In review Stefano Stabellini 3 participants 23 messages Aug 1, 2014 – Sep 24, 2014 Kbuild

lore
Share & tools
lore
#0 lore raw

v4 cover Move xenstore and libxc public headers to include subdir

Hi all,
this small patch series creates an "include" subdirectory under tools/libxc and another "include" subdirectory under tools/xenstore. Then it moves the libxc and xenstore public headers under their new subdirectories.

This way other Xen tools or external projects, such as QEMU, can add to their include paths only the subdirectories with the public headers.

The first patch is for xen-unstable and it is the one making the move. The second patch is for qemu-xen-traditional and makes the appropriate changes to qemu-xen-traditional's Makefiles.
They should be applied together.

The third and last patch is for xen-unstable and enables the QEMU build for ARM and ARMv8.

Changes in v4:
- rebased on a1ac4cf52e38386bac7ac3440c7da0099662ca5c.

Cheers,

Stefano

#1 lore raw

PATCH v4 1/3 Move xenstore and libxc public headers to include subdir

Also moves xc_dom.h to include as it is used often by other xen tools. Use the new include subdirectories to build Xen tools and qemu-xen.

Add the old libxc include path to the programs that need it to build, on a case by case basis and commeting that they shouldn't require internal libxc headers to build.

This patch should be applied at the same time at this patch for qemu-xen-traditional (also sent as part of this series):

http://marc.info/?l=xen-devel&m=140500949902568

Also moves xc_dom.h to include as it is used often by other xen tools. Use the new include subdirectories to build Xen tools and qemu-xen.

Add the old libxc include path to the programs that need it to build, on a case by case basis and commeting that they shouldn't require internal libxc headers to build.

---
 tools/Makefile                               |    6 +++---
 tools/Rules.mk                               |    6 +++---
 tools/blktap2/drivers/Makefile               |    2 ++
 tools/libxc/Makefile                         |    6 +++---
 tools/libxc/{ => include}/xc_dom.h           |    0
 tools/libxc/{ => include}/xenctrl.h          |    0
 tools/libxc/{ => include}/xenctrlosdep.h     |    0
 tools/libxc/{ => include}/xenguest.h         |    0
 tools/libxc/{ => include}/xentoollog.h       |    0
 tools/misc/Makefile                          |    2 ++
 tools/python/setup.py                        |    6 +++---
 tools/xcutils/Makefile                       |    3 ++-
 tools/xenpaging/Makefile                     |    3 ++-
 tools/xenstore/Makefile                      |    9 +++++----
 tools/xenstore/{ => include}/compat/xs.h     |    0
 tools/xenstore/{ => include}/compat/xs_lib.h |    0
 tools/xenstore/{ => include}/xenstore.h      |    0
 tools/xenstore/{ => include}/xenstore_lib.h  |    0
 18 files changed, 25 insertions(+), 18 deletions(-)
 rename tools/libxc/{ => include}/xc_dom.h (100%)
 rename tools/libxc/{ => include}/xenctrl.h (100%)
 rename tools/libxc/{ => include}/xenctrlosdep.h (100%)
 rename tools/libxc/{ => include}/xenguest.h (100%)
 rename tools/libxc/{ => include}/xentoollog.h (100%)
 rename tools/xenstore/{ => include}/compat/xs.h (100%)
 rename tools/xenstore/{ => include}/compat/xs_lib.h (100%)
 rename tools/xenstore/{ => include}/xenstore.h (100%)
 rename tools/xenstore/{ => include}/xenstore_lib.h (100%)
tools/Makefile +3 -3
index b6476c9..1130369 100644
@@ -192,9 +192,9 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
 		--includedir=$(PREFIX)/lib/xen/include \
 		--source-path=$$source \
 		--extra-cflags="-I$(XEN_ROOT)/tools/include \
-		-I$(XEN_ROOT)/tools/libxc \
-		-I$(XEN_ROOT)/tools/xenstore \
-		-I$(XEN_ROOT)/tools/xenstore/compat \
+		-I$(XEN_ROOT)/tools/libxc/include \
+		-I$(XEN_ROOT)/tools/xenstore/include \
+		-I$(XEN_ROOT)/tools/xenstore/compat/include \
 		$(EXTRA_CFLAGS_QEMU_XEN)" \
 		--extra-ldflags="-L$(XEN_ROOT)/tools/libxc \
 		-L$(XEN_ROOT)/tools/xenstore \
tools/Rules.mk +3 -3
index 0aa1e6b..4e07e82 100644
@@ -35,15 +35,15 @@ INSTALL_SHLIB = : install-shlib-unsupported-fail
 SYMLINK_SHLIB = : symlink-shlib-unsupported-fail
 endif
 
-CFLAGS_libxenctrl = -I$(XEN_LIBXC) $(CFLAGS_xeninclude)
+CFLAGS_libxenctrl = -I$(XEN_LIBXC)/include $(CFLAGS_xeninclude)
 LDLIBS_libxenctrl = $(XEN_LIBXC)/libxenctrl$(libextension)
 SHLIB_libxenctrl  = -Wl,-rpath-link=$(XEN_LIBXC)
 
-CFLAGS_libxenguest = -I$(XEN_LIBXC) $(CFLAGS_xeninclude)
+CFLAGS_libxenguest = -I$(XEN_LIBXC)/include $(CFLAGS_xeninclude)
 LDLIBS_libxenguest = $(XEN_LIBXC)/libxenguest$(libextension)
 SHLIB_libxenguest  = -Wl,-rpath-link=L$(XEN_LIBXC)
 
-CFLAGS_libxenstore = -I$(XEN_XENSTORE) $(CFLAGS_xeninclude)
+CFLAGS_libxenstore = -I$(XEN_XENSTORE)/include $(CFLAGS_xeninclude)
 LDLIBS_libxenstore = $(XEN_XENSTORE)/libxenstore$(libextension)
 SHLIB_libxenstore  = -Wl,-rpath-link=$(XEN_XENSTORE)
 
tools/blktap2/drivers/Makefile +2 -0
index 1129ca1..7df9bc4 100644
@@ -16,6 +16,8 @@ CFLAGS    += -I$(BLKTAP_ROOT)/include -I$(BLKTAP_ROOT)/drivers
 CFLAGS    += $(CFLAGS_libxenctrl)
 CFLAGS    += -D_GNU_SOURCE
 CFLAGS    += -DUSE_NFS_LOCKS
+# drivers/block-log.c incorrectly uses libxc internals
+CFLAGS    += -I$(XEN_ROOT)/tools/libxc
 
 ifeq ($(CONFIG_X86_64),y)
 CFLAGS            += -fPIC
tools/libxc/Makefile +3 -3
index 22eef8e..83fcd3c 100644
@@ -89,7 +89,7 @@ OSDEP_SRCS-y                 += xenctrl_osdep_ENOSYS.c
 -include $(XEN_TARGET_ARCH)/Makefile
 
 CFLAGS   += -Werror -Wmissing-prototypes
-CFLAGS   += -I. $(CFLAGS_xeninclude)
+CFLAGS   += -I. -I./include $(CFLAGS_xeninclude)
 
 # Needed for posix_fadvise64() in xc_linux.c
 CFLAGS-$(CONFIG_Linux) += -D_GNU_SOURCE
@@ -140,12 +140,12 @@ install: build
 	$(INSTALL_DATA) libxenctrl.a $(DESTDIR)$(LIBDIR)
 	$(SYMLINK_SHLIB) libxenctrl.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxenctrl.so.$(MAJOR)
 	$(SYMLINK_SHLIB) libxenctrl.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libxenctrl.so
-	$(INSTALL_DATA) xenctrl.h xenctrlosdep.h xentoollog.h $(DESTDIR)$(INCLUDEDIR)
+	$(INSTALL_DATA) include/xenctrl.h include/xenctrlosdep.h include/xentoollog.h $(DESTDIR)$(INCLUDEDIR)
 	$(INSTALL_SHLIB) libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)
 	$(INSTALL_DATA) libxenguest.a $(DESTDIR)$(LIBDIR)
 	$(SYMLINK_SHLIB) libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxenguest.so.$(MAJOR)
 	$(SYMLINK_SHLIB) libxenguest.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libxenguest.so
-	$(INSTALL_DATA) xenguest.h $(DESTDIR)$(INCLUDEDIR)
+	$(INSTALL_DATA) include/xenguest.h $(DESTDIR)$(INCLUDEDIR)
 
 .PHONY: TAGS
 TAGS:
tools/libxc/include/xc_dom.h renamed from tools/libxc/xc_dom.h +0 -0
similarity index 100%
rename from tools/libxc/xc_dom.h
rename to tools/libxc/include/xc_dom.h
tools/libxc/include/xenctrl.h renamed from tools/libxc/xenctrl.h +0 -0
similarity index 100%
rename from tools/libxc/xenctrl.h
rename to tools/libxc/include/xenctrl.h
tools/libxc/include/xenctrlosdep.h renamed from tools/libxc/xenctrlosdep.h +0 -0
similarity index 100%
rename from tools/libxc/xenctrlosdep.h
rename to tools/libxc/include/xenctrlosdep.h
tools/libxc/include/xenguest.h renamed from tools/libxc/xenguest.h +0 -0
similarity index 100%
rename from tools/libxc/xenguest.h
rename to tools/libxc/include/xenguest.h
tools/libxc/include/xentoollog.h renamed from tools/libxc/xentoollog.h +0 -0
similarity index 100%
rename from tools/libxc/xentoollog.h
rename to tools/libxc/include/xentoollog.h
tools/misc/Makefile +2 -0
index 69b1817..266fd16 100644
@@ -6,6 +6,8 @@ CFLAGS += -Werror
 CFLAGS += $(CFLAGS_libxenctrl)
 CFLAGS += $(CFLAGS_xeninclude)
 CFLAGS += $(CFLAGS_libxenstore)
+# xen-hptool.c and xen-mfndump.c incorrectly use libxc internals
+CFLAGS += -I$(XEN_ROOT)/tools/libxc
 
 HDRS     = $(wildcard *.h)
 
tools/python/setup.py +3 -3
index 17ebb4a..439c429 100644
@@ -13,7 +13,7 @@ PATH_XENSTORE = XEN_ROOT + "/tools/xenstore"
 
 xc = Extension("xc",
                extra_compile_args = extra_compile_args,
-               include_dirs       = [ PATH_XEN, PATH_LIBXC, "xen/lowlevel/xc" ],
+               include_dirs       = [ PATH_XEN, PATH_LIBXC + "/include", "xen/lowlevel/xc" ],
                library_dirs       = [ PATH_LIBXC ],
                libraries          = [ "xenctrl", "xenguest" ],
                depends            = [ PATH_LIBXC + "/libxenctrl.so", PATH_LIBXC + "/libxenguest.so" ],
@@ -21,7 +21,7 @@ xc = Extension("xc",
 
 xs = Extension("xs",
                extra_compile_args = extra_compile_args,
-               include_dirs       = [ PATH_XEN, PATH_XENSTORE, "xen/lowlevel/xs" ],
+               include_dirs       = [ PATH_XEN, PATH_XENSTORE + "/include", "xen/lowlevel/xs" ],
                library_dirs       = [ PATH_XENSTORE ],
                libraries          = [ "xenstore" ],
                depends            = [ PATH_XENSTORE + "/libxenstore.so" ],
@@ -29,7 +29,7 @@ xs = Extension("xs",
 
 xl = Extension("xl",
                extra_compile_args = extra_compile_args,
-               include_dirs       = [ PATH_XEN, PATH_LIBXL, PATH_LIBXC, "xen/lowlevel/xl" ],
+               include_dirs       = [ PATH_XEN, PATH_LIBXL, PATH_LIBXC + "/include", "xen/lowlevel/xl" ],
                library_dirs       = [ PATH_LIBXL ],
                libraries          = [ "xenlight" ],
                depends            = [ PATH_LIBXL + "/libxenlight.so" ],
tools/xcutils/Makefile +2 -1
index 98706bf..f71703d 100644
@@ -15,7 +15,8 @@ PROGRAMS = readnotes lsevtchn
 
 CFLAGS += -Werror
 
-CFLAGS_readnotes.o  := $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest)
+# incorrectly uses libxc internals
+CFLAGS_readnotes.o  := $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest) -I$(XEN_ROOT)/tools/libxc
 CFLAGS_lsevtchn.o   := $(CFLAGS_libxenctrl)
 
 .PHONY: all
tools/xenpaging/Makefile +2 -1
index 548d9dd..054562d 100644
@@ -1,7 +1,8 @@
 XEN_ROOT=$(CURDIR)/../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenstore) $(PTHREAD_CFLAGS)
+# xenpaging.c and file_ops.c incorrectly use libxc internals
+CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenstore) $(PTHREAD_CFLAGS) -I$(XEN_ROOT)/tools/libxc
 LDLIBS += $(LDLIBS_libxenctrl) $(LDLIBS_libxenstore) $(PTHREAD_LIBS)
 LDFLAGS += $(PTHREAD_LDFLAGS)
 
tools/xenstore/Makefile +5 -4
index 08460c8..d0ac949 100644
@@ -7,6 +7,7 @@ MINOR = 3
 CFLAGS += -Werror
 CFLAGS += -I.
 CFLAGS += -I$(XEN_ROOT)/tools/
+CFLAGS += -I./include
 CFLAGS += $(CFLAGS_libxenctrl)
 
 CLIENTS := xenstore-exists xenstore-list xenstore-read xenstore-rm xenstore-chmod
@@ -135,10 +136,10 @@ endif
 	ln -sf libxenstore.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxenstore.so.$(MAJOR)
 	ln -sf libxenstore.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libxenstore.so
 	$(INSTALL_DATA) libxenstore.a $(DESTDIR)$(LIBDIR)
-	$(INSTALL_DATA) xenstore.h $(DESTDIR)$(INCLUDEDIR)
-	$(INSTALL_DATA) xenstore_lib.h $(DESTDIR)$(INCLUDEDIR)
-	$(INSTALL_DATA) compat/xs.h $(DESTDIR)$(INCLUDEDIR)/xenstore-compat/xs.h
-	$(INSTALL_DATA) compat/xs_lib.h $(DESTDIR)$(INCLUDEDIR)/xenstore-compat/xs_lib.h
+	$(INSTALL_DATA) include/xenstore.h $(DESTDIR)$(INCLUDEDIR)
+	$(INSTALL_DATA) include/xenstore_lib.h $(DESTDIR)$(INCLUDEDIR)
+	$(INSTALL_DATA) include/compat/xs.h $(DESTDIR)$(INCLUDEDIR)/xenstore-compat/xs.h
+	$(INSTALL_DATA) include/compat/xs_lib.h $(DESTDIR)$(INCLUDEDIR)/xenstore-compat/xs_lib.h
 	ln -sf xenstore-compat/xs.h  $(DESTDIR)$(INCLUDEDIR)/xs.h
 	ln -sf xenstore-compat/xs_lib.h $(DESTDIR)$(INCLUDEDIR)/xs_lib.h
 
tools/xenstore/include/compat/xs.h renamed from tools/xenstore/compat/xs.h +0 -0
similarity index 100%
rename from tools/xenstore/compat/xs.h
rename to tools/xenstore/include/compat/xs.h
tools/xenstore/include/compat/xs_lib.h renamed from tools/xenstore/compat/xs_lib.h +0 -0
similarity index 100%
rename from tools/xenstore/compat/xs_lib.h
rename to tools/xenstore/include/compat/xs_lib.h
tools/xenstore/include/xenstore.h renamed from tools/xenstore/xenstore.h +0 -0
similarity index 100%
rename from tools/xenstore/xenstore.h
rename to tools/xenstore/include/xenstore.h
tools/xenstore/include/xenstore_lib.h renamed from tools/xenstore/xenstore_lib.h +0 -0
similarity index 100%
rename from tools/xenstore/xenstore_lib.h
rename to tools/xenstore/include/xenstore_lib.h
Signature · 1 line
1.7.10.4
#2 lore raw

Stefano Stabellini writes ("[Xen-devel] [PATCH v4 1/3] Move xenstore and libxc public headers to include subdir"):

Quoted 11 lines

Also moves xc_dom.h to include as it is used often by other xen tools. Use the new include subdirectories to build Xen tools and qemu-xen.

Add the old libxc include path to the programs that need it to build, on a case by case basis and commeting that they shouldn't require internal libxc headers to build.

This patch should be applied at the same time at this patch for qemu-xen-traditional (also sent as part of this series):

http://marc.info/?l=xen-devel&m=140500949902568

I still can't get this to apply with either git-am or git-apply. patch(1) doesn't do the renames, of course.

Can you push it to a git branch somewhere ?

Ian.

#3 lore raw
Quoted 11 lines · Ian Jackson

Stefano Stabellini writes ("[Xen-devel] [PATCH v4 1/3] Move xenstore and libxc public headers to include subdir"):

Quoted 10 lines

Also moves xc_dom.h to include as it is used often by other xen tools. Use the new include subdirectories to build Xen tools and qemu-xen.

Add the old libxc include path to the programs that need it to build, on a case by case basis and commeting that they shouldn't require internal libxc headers to build.

This patch should be applied at the same time at this patch for qemu-xen-traditional (also sent as part of this series):

Quoted 6 lines
Quoted 1 line

http://marc.info/?l=xen-devel&m=140500949902568

I still can't get this to apply with either git-am or git-apply. patch(1) doesn't do the renames, of course.

Can you push it to a git branch somewhere ?

certainly:

git://xenbits.xen.org/people/sstabellini/xen-unstable.git public_headers_v4

#4 lore raw

Stefano Stabellini writes ("Re: [Xen-devel] [PATCH v4 1/3] Move xenstore and libxc public headers to include subdir"):

Quoted 1 line

git://xenbits.xen.org/people/sstabellini/xen-unstable.git public_headers_v4

sed 's/@VERSION@/4.1/g' < META.in >META.new && mv -f META.new META
mkdir -p /u/iwj/work/xen.git/dist/install/usr/local/lib/ocaml/3.12.1
ocamlfind remove -destdir /u/iwj/work/xen.git/dist/install/usr/local/lib/ocaml/3.12.1 xenmmap
ocamlfind: [WARNING] No such directory: /u/iwj/work/xen.git/dist/install/usr/local/lib/ocaml/3.12.1/xenmmap
ocamlfind install -destdir /u/iwj/work/xen.git/dist/install/usr/local/lib/ocaml/3.12.1 -ldconf ignore xenmmap META xenmmap.cmi xenmmap.cma xenmmap.cmxa *.a *.so *.cmx Installed /u/iwj/work/xen.git/dist/install/usr/local/lib/ocaml/3.12.1/xenmmap/xenmmap.cmx
Installed /u/iwj/work/xen.git/dist/install/usr/local/lib/ocaml/3.12.1/xenmmap/dllxenmmap_stubs.so
Installed /u/iwj/work/xen.git/dist/install/usr/local/lib/ocaml/3.12.1/xenmmap/xenmmap.a
Installed /u/iwj/work/xen.git/dist/install/usr/local/lib/ocaml/3.12.1/xenmmap/libxenmmap_stubs.a
Installed /u/iwj/work/xen.git/dist/install/usr/local/lib/ocaml/3.12.1/xenmmap/xenmmap.cmxa
Installed /u/iwj/work/xen.git/dist/install/usr/local/lib/ocaml/3.12.1/xenmmap/xenmmap.cma
Installed /u/iwj/work/xen.git/dist/install/usr/local/lib/ocaml/3.12.1/xenmmap/xenmmap.cmi
Installed /u/iwj/work/xen.git/dist/install/usr/local/lib/ocaml/3.12.1/xenmmap/META
make[7]: Leaving directory `/u/iwj/work/xen.git/tools/ocaml/libs/mmap'
make[6]: Leaving directory `/u/iwj/work/xen.git/tools/ocaml/libs'
make[6]: Entering directory `/u/iwj/work/xen.git/tools/ocaml/libs'
make -C xentoollog install
make[6]: *** [subdir-install-xentoollog] Error 2
make[6]: Leaving directory `/u/iwj/work/xen.git/tools/ocaml/libs'
make[5]: *** [subdirs-install] Error 2
make[5]: Leaving directory `/u/iwj/work/xen.git/tools/ocaml/libs'
make[4]: *** [subdir-install-libs] Error 2
make[4]: Leaving directory `/u/iwj/work/xen.git/tools/ocaml'
make[3]: *** [subdirs-install] Error 2
make[3]: Leaving directory `/u/iwj/work/xen.git/tools/ocaml'
make[2]: *** [subdir-install-ocaml] Error 2
make[2]: Leaving directory `/u/iwj/work/xen.git/tools'
make[1]: *** [subdirs-install] Error 2
make[1]: Leaving directory `/u/iwj/work/xen.git/tools'
make: *** [install-tools] Error 2

#5 lore raw
Quoted 25 lines · Ian Jackson

Stefano Stabellini writes ("Re: [Xen-devel] [PATCH v4 1/3] Move xenstore and libxc public headers to include subdir"):

Quoted 1 line

git://xenbits.xen.org/people/sstabellini/xen-unstable.git public_headers_v4

sed 's/@VERSION@/4.1/g' < META.in >META.new && mv -f META.new META
mkdir -p /u/iwj/work/xen.git/dist/install/usr/local/lib/ocaml/3.12.1
ocamlfind remove -destdir /u/iwj/work/xen.git/dist/install/usr/local/lib/ocaml/3.12.1 xenmmap
ocamlfind: [WARNING] No such directory: /u/iwj/work/xen.git/dist/install/usr/local/lib/ocaml/3.12.1/xenmmap
ocamlfind install -destdir /u/iwj/work/xen.git/dist/install/usr/local/lib/ocaml/3.12.1 -ldconf ignore xenmmap META xenmmap.cmi xenmmap.cma xenmmap.cmxa *.a *.so *.cmx Installed /u/iwj/work/xen.git/dist/install/usr/local/lib/ocaml/3.12.1/xenmmap/xenmmap.cmx
Installed /u/iwj/work/xen.git/dist/install/usr/local/lib/ocaml/3.12.1/xenmmap/dllxenmmap_stubs.so
Installed /u/iwj/work/xen.git/dist/install/usr/local/lib/ocaml/3.12.1/xenmmap/xenmmap.a
Installed /u/iwj/work/xen.git/dist/install/usr/local/lib/ocaml/3.12.1/xenmmap/libxenmmap_stubs.a
Installed /u/iwj/work/xen.git/dist/install/usr/local/lib/ocaml/3.12.1/xenmmap/xenmmap.cmxa
Installed /u/iwj/work/xen.git/dist/install/usr/local/lib/ocaml/3.12.1/xenmmap/xenmmap.cma
Installed /u/iwj/work/xen.git/dist/install/usr/local/lib/ocaml/3.12.1/xenmmap/xenmmap.cmi
Installed /u/iwj/work/xen.git/dist/install/usr/local/lib/ocaml/3.12.1/xenmmap/META
make[7]: Leaving directory `/u/iwj/work/xen.git/tools/ocaml/libs/mmap'
make[6]: Leaving directory `/u/iwj/work/xen.git/tools/ocaml/libs'
make[6]: Entering directory `/u/iwj/work/xen.git/tools/ocaml/libs'
make -C xentoollog install
make[6]: *** [subdir-install-xentoollog] Error 2
make[6]: Leaving directory `/u/iwj/work/xen.git/tools/ocaml/libs'
make[5]: *** [subdirs-install] Error 2
make[5]: Leaving directory `/u/iwj/work/xen.git/tools/ocaml/libs'
make[4]: *** [subdir-install-libs] Error 2

Quoted 8 lines

make[4]: Leaving directory `/u/iwj/work/xen.git/tools/ocaml' make[3]: *** [subdirs-install] Error 2
make[3]: Leaving directory /u/iwj/work/xen.git/tools/ocaml' make[2]: *** [subdir-install-ocaml] Error 2 make[2]: Leaving directory /u/iwj/work/xen.git/tools' make[1]: *** [subdirs-install] Error 2
make[1]: Leaving directory `/u/iwj/work/xen.git/tools'
make: *** [install-tools] Error 2

I needed to make a couple of more libxc to libxc/include substitutions under tools/ocaml.
The appended patch should work.
I have also pushed:

git://xenbits.xen.org/people/sstabellini/xen-unstable.git public_headers_v5

---

Quoted 1 line

From 197699ff887967bf398b9b331c471eeebfa92d4c Mon Sep 17 00:00:00 2001

From: Stefano Stabellini <[email protected]>
Date: Thu, 10 Jul 2014 15:35:28 +0000
Subject: [PATCH v5] Move xenstore and libxc public headers to include subdir

Also moves xc_dom.h to include as it is used often by other xen tools. Use the new include subdirectories to build Xen tools and qemu-xen.

Add the old libxc include path to the programs that need it to build, on a case by case basis and commeting that they shouldn't require internal libxc headers to build.

---
Changes in v5:
- fix ocaml build.

---
 tools/Makefile                               |    6 +++---
 tools/Rules.mk                               |    6 +++---
 tools/blktap2/drivers/Makefile               |    2 ++
 tools/libxc/Makefile                         |    6 +++---
 tools/libxc/{ => include}/xc_dom.h           |    0
 tools/libxc/{ => include}/xenctrl.h          |    0
 tools/libxc/{ => include}/xenctrlosdep.h     |    0
 tools/libxc/{ => include}/xenguest.h         |    0
 tools/libxc/{ => include}/xentoollog.h       |    0
 tools/misc/Makefile                          |    2 ++
 tools/ocaml/libs/eventchn/xeneventchn.mli    |    2 +-
 tools/ocaml/libs/xentoollog/Makefile         |    2 +-
 tools/ocaml/libs/xentoollog/genlevels.py     |    2 +-
 tools/python/setup.py                        |    6 +++---
 tools/xcutils/Makefile                       |    3 ++-
 tools/xenpaging/Makefile                     |    3 ++-
 tools/xenstore/Makefile                      |    9 +++++----
 tools/xenstore/{ => include}/compat/xs.h     |    0
 tools/xenstore/{ => include}/compat/xs_lib.h |    0
 tools/xenstore/{ => include}/xenstore.h      |    0
 tools/xenstore/{ => include}/xenstore_lib.h  |    0
 21 files changed, 28 insertions(+), 21 deletions(-)
 rename tools/libxc/{ => include}/xc_dom.h (100%)
 rename tools/libxc/{ => include}/xenctrl.h (100%)
 rename tools/libxc/{ => include}/xenctrlosdep.h (100%)
 rename tools/libxc/{ => include}/xenguest.h (100%)
 rename tools/libxc/{ => include}/xentoollog.h (100%)
 rename tools/xenstore/{ => include}/compat/xs.h (100%)
 rename tools/xenstore/{ => include}/compat/xs_lib.h (100%)
 rename tools/xenstore/{ => include}/xenstore.h (100%)
 rename tools/xenstore/{ => include}/xenstore_lib.h (100%)
tools/Makefile +3 -3
index b6476c9..1130369 100644
@@ -192,9 +192,9 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
 		--includedir=$(PREFIX)/lib/xen/include \
 		--source-path=$$source \
 		--extra-cflags="-I$(XEN_ROOT)/tools/include \
-		-I$(XEN_ROOT)/tools/libxc \
-		-I$(XEN_ROOT)/tools/xenstore \
-		-I$(XEN_ROOT)/tools/xenstore/compat \
+		-I$(XEN_ROOT)/tools/libxc/include \
+		-I$(XEN_ROOT)/tools/xenstore/include \
+		-I$(XEN_ROOT)/tools/xenstore/compat/include \
 		$(EXTRA_CFLAGS_QEMU_XEN)" \
 		--extra-ldflags="-L$(XEN_ROOT)/tools/libxc \
 		-L$(XEN_ROOT)/tools/xenstore \
tools/Rules.mk +3 -3
index 0aa1e6b..4e07e82 100644
@@ -35,15 +35,15 @@ INSTALL_SHLIB = : install-shlib-unsupported-fail
 SYMLINK_SHLIB = : symlink-shlib-unsupported-fail
 endif
 
-CFLAGS_libxenctrl = -I$(XEN_LIBXC) $(CFLAGS_xeninclude)
+CFLAGS_libxenctrl = -I$(XEN_LIBXC)/include $(CFLAGS_xeninclude)
 LDLIBS_libxenctrl = $(XEN_LIBXC)/libxenctrl$(libextension)
 SHLIB_libxenctrl  = -Wl,-rpath-link=$(XEN_LIBXC)
 
-CFLAGS_libxenguest = -I$(XEN_LIBXC) $(CFLAGS_xeninclude)
+CFLAGS_libxenguest = -I$(XEN_LIBXC)/include $(CFLAGS_xeninclude)
 LDLIBS_libxenguest = $(XEN_LIBXC)/libxenguest$(libextension)
 SHLIB_libxenguest  = -Wl,-rpath-link=L$(XEN_LIBXC)
 
-CFLAGS_libxenstore = -I$(XEN_XENSTORE) $(CFLAGS_xeninclude)
+CFLAGS_libxenstore = -I$(XEN_XENSTORE)/include $(CFLAGS_xeninclude)
 LDLIBS_libxenstore = $(XEN_XENSTORE)/libxenstore$(libextension)
 SHLIB_libxenstore  = -Wl,-rpath-link=$(XEN_XENSTORE)
 
tools/blktap2/drivers/Makefile +2 -0
index 1129ca1..7df9bc4 100644
@@ -16,6 +16,8 @@ CFLAGS    += -I$(BLKTAP_ROOT)/include -I$(BLKTAP_ROOT)/drivers
 CFLAGS    += $(CFLAGS_libxenctrl)
 CFLAGS    += -D_GNU_SOURCE
 CFLAGS    += -DUSE_NFS_LOCKS
+# drivers/block-log.c incorrectly uses libxc internals
+CFLAGS    += -I$(XEN_ROOT)/tools/libxc
 
 ifeq ($(CONFIG_X86_64),y)
 CFLAGS            += -fPIC
tools/libxc/Makefile +3 -3
index 22eef8e..83fcd3c 100644
@@ -89,7 +89,7 @@ OSDEP_SRCS-y                 += xenctrl_osdep_ENOSYS.c
 -include $(XEN_TARGET_ARCH)/Makefile
 
 CFLAGS   += -Werror -Wmissing-prototypes
-CFLAGS   += -I. $(CFLAGS_xeninclude)
+CFLAGS   += -I. -I./include $(CFLAGS_xeninclude)
 
 # Needed for posix_fadvise64() in xc_linux.c
 CFLAGS-$(CONFIG_Linux) += -D_GNU_SOURCE
@@ -140,12 +140,12 @@ install: build
 	$(INSTALL_DATA) libxenctrl.a $(DESTDIR)$(LIBDIR)
 	$(SYMLINK_SHLIB) libxenctrl.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxenctrl.so.$(MAJOR)
 	$(SYMLINK_SHLIB) libxenctrl.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libxenctrl.so
-	$(INSTALL_DATA) xenctrl.h xenctrlosdep.h xentoollog.h $(DESTDIR)$(INCLUDEDIR)
+	$(INSTALL_DATA) include/xenctrl.h include/xenctrlosdep.h include/xentoollog.h $(DESTDIR)$(INCLUDEDIR)
 	$(INSTALL_SHLIB) libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)
 	$(INSTALL_DATA) libxenguest.a $(DESTDIR)$(LIBDIR)
 	$(SYMLINK_SHLIB) libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxenguest.so.$(MAJOR)
 	$(SYMLINK_SHLIB) libxenguest.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libxenguest.so
-	$(INSTALL_DATA) xenguest.h $(DESTDIR)$(INCLUDEDIR)
+	$(INSTALL_DATA) include/xenguest.h $(DESTDIR)$(INCLUDEDIR)
 
 .PHONY: TAGS
 TAGS:
tools/libxc/include/xc_dom.h renamed from tools/libxc/xc_dom.h +0 -0
similarity index 100%
rename from tools/libxc/xc_dom.h
rename to tools/libxc/include/xc_dom.h
tools/libxc/include/xenctrl.h renamed from tools/libxc/xenctrl.h +0 -0
similarity index 100%
rename from tools/libxc/xenctrl.h
rename to tools/libxc/include/xenctrl.h
tools/libxc/include/xenctrlosdep.h renamed from tools/libxc/xenctrlosdep.h +0 -0
similarity index 100%
rename from tools/libxc/xenctrlosdep.h
rename to tools/libxc/include/xenctrlosdep.h
tools/libxc/include/xenguest.h renamed from tools/libxc/xenguest.h +0 -0
similarity index 100%
rename from tools/libxc/xenguest.h
rename to tools/libxc/include/xenguest.h
tools/libxc/include/xentoollog.h renamed from tools/libxc/xentoollog.h +0 -0
similarity index 100%
rename from tools/libxc/xentoollog.h
rename to tools/libxc/include/xentoollog.h
tools/misc/Makefile +2 -0
index 69b1817..266fd16 100644
@@ -6,6 +6,8 @@ CFLAGS += -Werror
 CFLAGS += $(CFLAGS_libxenctrl)
 CFLAGS += $(CFLAGS_xeninclude)
 CFLAGS += $(CFLAGS_libxenstore)
+# xen-hptool.c and xen-mfndump.c incorrectly use libxc internals
+CFLAGS += -I$(XEN_ROOT)/tools/libxc
 
 HDRS     = $(wildcard *.h)
 
tools/ocaml/libs/eventchn/xeneventchn.mli +1 -1
index e4e02a4..e180145 100644
@@ -14,7 +14,7 @@
  * GNU Lesser General Public License for more details.
  *)
 
-(** Event channel bindings: see tools/libxc/xenctrl.h *)
+(** Event channel bindings: see tools/libxc/include/xenctrl.h *)
 
 type handle
 (** An initialised event channel interface. *)
tools/ocaml/libs/xentoollog/Makefile +1 -1
index 471b428..f2134b8 100644
@@ -48,7 +48,7 @@ xentoollog.mli: xentoollog.mli.in _xtl_levels.mli.in
 
 libs: $(LIBS)
 
-_xtl_levels.ml.in _xtl_levels.mli.in _xtl_levels.inc: genlevels.py $(XEN_ROOT)/tools/libxc/xentoollog.h
+_xtl_levels.ml.in _xtl_levels.mli.in _xtl_levels.inc: genlevels.py $(XEN_ROOT)/tools/libxc/include/xentoollog.h
 	$(PYTHON) genlevels.py _xtl_levels.mli.in _xtl_levels.ml.in _xtl_levels.inc
 
 .PHONY: install
tools/ocaml/libs/xentoollog/genlevels.py +1 -1
index 6b42f21..65d334f 100755
@@ -3,7 +3,7 @@
 import sys
 
 def read_levels():
-	f = open('../../../libxc/xentoollog.h', 'r')
+	f = open('../../../libxc/include/xentoollog.h', 'r')
 
 	levels = []
 	record = False
tools/python/setup.py +3 -3
index 17ebb4a..439c429 100644
@@ -13,7 +13,7 @@ PATH_XENSTORE = XEN_ROOT + "/tools/xenstore"
 
 xc = Extension("xc",
                extra_compile_args = extra_compile_args,
-               include_dirs       = [ PATH_XEN, PATH_LIBXC, "xen/lowlevel/xc" ],
+               include_dirs       = [ PATH_XEN, PATH_LIBXC + "/include", "xen/lowlevel/xc" ],
                library_dirs       = [ PATH_LIBXC ],
                libraries          = [ "xenctrl", "xenguest" ],
                depends            = [ PATH_LIBXC + "/libxenctrl.so", PATH_LIBXC + "/libxenguest.so" ],
@@ -21,7 +21,7 @@ xc = Extension("xc",
 
 xs = Extension("xs",
                extra_compile_args = extra_compile_args,
-               include_dirs       = [ PATH_XEN, PATH_XENSTORE, "xen/lowlevel/xs" ],
+               include_dirs       = [ PATH_XEN, PATH_XENSTORE + "/include", "xen/lowlevel/xs" ],
                library_dirs       = [ PATH_XENSTORE ],
                libraries          = [ "xenstore" ],
                depends            = [ PATH_XENSTORE + "/libxenstore.so" ],
@@ -29,7 +29,7 @@ xs = Extension("xs",
 
 xl = Extension("xl",
                extra_compile_args = extra_compile_args,
-               include_dirs       = [ PATH_XEN, PATH_LIBXL, PATH_LIBXC, "xen/lowlevel/xl" ],
+               include_dirs       = [ PATH_XEN, PATH_LIBXL, PATH_LIBXC + "/include", "xen/lowlevel/xl" ],
                library_dirs       = [ PATH_LIBXL ],
                libraries          = [ "xenlight" ],
                depends            = [ PATH_LIBXL + "/libxenlight.so" ],
tools/xcutils/Makefile +2 -1
index 98706bf..f71703d 100644
@@ -15,7 +15,8 @@ PROGRAMS = readnotes lsevtchn
 
 CFLAGS += -Werror
 
-CFLAGS_readnotes.o  := $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest)
+# incorrectly uses libxc internals
+CFLAGS_readnotes.o  := $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest) -I$(XEN_ROOT)/tools/libxc
 CFLAGS_lsevtchn.o   := $(CFLAGS_libxenctrl)
 
 .PHONY: all
tools/xenpaging/Makefile +2 -1
index 548d9dd..054562d 100644
@@ -1,7 +1,8 @@
 XEN_ROOT=$(CURDIR)/../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenstore) $(PTHREAD_CFLAGS)
+# xenpaging.c and file_ops.c incorrectly use libxc internals
+CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenstore) $(PTHREAD_CFLAGS) -I$(XEN_ROOT)/tools/libxc
 LDLIBS += $(LDLIBS_libxenctrl) $(LDLIBS_libxenstore) $(PTHREAD_LIBS)
 LDFLAGS += $(PTHREAD_LDFLAGS)
 
tools/xenstore/Makefile +5 -4
index 08460c8..d0ac949 100644
@@ -7,6 +7,7 @@ MINOR = 3
 CFLAGS += -Werror
 CFLAGS += -I.
 CFLAGS += -I$(XEN_ROOT)/tools/
+CFLAGS += -I./include
 CFLAGS += $(CFLAGS_libxenctrl)
 
 CLIENTS := xenstore-exists xenstore-list xenstore-read xenstore-rm xenstore-chmod
@@ -135,10 +136,10 @@ endif
 	ln -sf libxenstore.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxenstore.so.$(MAJOR)
 	ln -sf libxenstore.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libxenstore.so
 	$(INSTALL_DATA) libxenstore.a $(DESTDIR)$(LIBDIR)
-	$(INSTALL_DATA) xenstore.h $(DESTDIR)$(INCLUDEDIR)
-	$(INSTALL_DATA) xenstore_lib.h $(DESTDIR)$(INCLUDEDIR)
-	$(INSTALL_DATA) compat/xs.h $(DESTDIR)$(INCLUDEDIR)/xenstore-compat/xs.h
-	$(INSTALL_DATA) compat/xs_lib.h $(DESTDIR)$(INCLUDEDIR)/xenstore-compat/xs_lib.h
+	$(INSTALL_DATA) include/xenstore.h $(DESTDIR)$(INCLUDEDIR)
+	$(INSTALL_DATA) include/xenstore_lib.h $(DESTDIR)$(INCLUDEDIR)
+	$(INSTALL_DATA) include/compat/xs.h $(DESTDIR)$(INCLUDEDIR)/xenstore-compat/xs.h
+	$(INSTALL_DATA) include/compat/xs_lib.h $(DESTDIR)$(INCLUDEDIR)/xenstore-compat/xs_lib.h
 	ln -sf xenstore-compat/xs.h  $(DESTDIR)$(INCLUDEDIR)/xs.h
 	ln -sf xenstore-compat/xs_lib.h $(DESTDIR)$(INCLUDEDIR)/xs_lib.h
 
tools/xenstore/include/compat/xs.h renamed from tools/xenstore/compat/xs.h +0 -0
similarity index 100%
rename from tools/xenstore/compat/xs.h
rename to tools/xenstore/include/compat/xs.h
tools/xenstore/include/compat/xs_lib.h renamed from tools/xenstore/compat/xs_lib.h +0 -0
similarity index 100%
rename from tools/xenstore/compat/xs_lib.h
rename to tools/xenstore/include/compat/xs_lib.h
tools/xenstore/include/xenstore.h renamed from tools/xenstore/xenstore.h +0 -0
similarity index 100%
rename from tools/xenstore/xenstore.h
rename to tools/xenstore/include/xenstore.h
tools/xenstore/include/xenstore_lib.h renamed from tools/xenstore/xenstore_lib.h +0 -0
similarity index 100%
rename from tools/xenstore/xenstore_lib.h
rename to tools/xenstore/include/xenstore_lib.h
Signature · 1 line
1.7.10.4
#6 lore raw

Stefano Stabellini writes ("Re: [Xen-devel] [PATCH v4 1/3] Move xenstore and libxc public headers to include subdir"):

Quoted 6 lines

I needed to make a couple of more libxc to libxc/include substitutions under tools/ocaml.
The appended patch should work.
I have also pushed:

git://xenbits.xen.org/people/sstabellini/xen-unstable.git public_headers_v5

It seems that the 32-bit stubdom build is still broken:

In file included from xc_core.c:64:0:
xg_private.h:30:21: fatal error: xenctrl.h: No such file or directory

Ian.

#7 lore raw
Quoted 6 lines · Ian Jackson

Stefano Stabellini writes ("Re: [Xen-devel] [PATCH v4 1/3] Move xenstore and libxc public headers to include subdir"):

Quoted 5 lines

I needed to make a couple of more libxc to libxc/include substitutions under tools/ocaml.
The appended patch should work.
I have also pushed:

Quoted 6 lines
Quoted 1 line

git://xenbits.xen.org/people/sstabellini/xen-unstable.git public_headers_v5

It seems that the 32-bit stubdom build is still broken:

In file included from xc_core.c:64:0:
xg_private.h:30:21: fatal error: xenctrl.h: No such file or directory

Somehow I missed this email until today.

I modified the stubdom and mini-os Makefiles (below is the incremental diff):

extras/mini-os/Config.mk +1 -1
index d61877b..4852443 100644
@@ -46,7 +46,7 @@ DEF_CPPFLAGS += -D__MINIOS__
 ifeq ($(libc),y)
 DEF_CPPFLAGS += -DHAVE_LIBC
 DEF_CPPFLAGS += -isystem $(MINI-OS_ROOT)/include/posix
-DEF_CPPFLAGS += -isystem $(XEN_ROOT)/tools/xenstore
+DEF_CPPFLAGS += -isystem $(XEN_ROOT)/tools/xenstore/include
 endif
 
 ifneq ($(LWIPDIR),)
stubdom/Makefile +2 -0
index 6bea68b..ffebc0d 100644
@@ -306,12 +306,14 @@ mk-headers-$(XEN_TARGET_ARCH): $(IOEMU_LINKFARM_TARGET)
 	mkdir -p libxc-$(XEN_TARGET_ARCH)
 	[ -h libxc-$(XEN_TARGET_ARCH)/Makefile ] || ( cd libxc-$(XEN_TARGET_ARCH) && \
 	  ln -sf $(XEN_ROOT)/tools/libxc/*.h . && \
+	  ln -sf $(XEN_ROOT)/tools/libxc/include/*.h . && \
 	  ln -sf $(XEN_ROOT)/tools/libxc/*.c . && \
 	  ln -sf $(XEN_ROOT)/tools/libxc/Makefile . )
 	mkdir -p xenstore
 	[ -h xenstore/Makefile ] || ( cd xenstore && \
 	  ln -sf $(XEN_ROOT)/tools/xenstore/*.c . && \
 	  ln -sf $(XEN_ROOT)/tools/xenstore/*.h . && \
+	  ln -sf $(XEN_ROOT)/tools/xenstore/include/*.h . && \
 	  ln -sf $(XEN_ROOT)/tools/xenstore/Makefile . )
 	$(MAKE) DESTDIR= -C $(MINI_OS) links
 	touch mk-headers-$(XEN_TARGET_ARCH)
stubdom/grub/Makefile +1 -1
index 6bd2c4c..934cc4c 100644
@@ -5,7 +5,7 @@ vpath %.c ../grub-upstream
 
 BOOT=$(OBJ_DIR)/boot-$(XEN_TARGET_ARCH).o
 
-DEF_CPPFLAGS += -I$(XEN_ROOT)/tools/libxc -I$(XEN_ROOT)/tools/include -I.
+DEF_CPPFLAGS += -I$(XEN_ROOT)/tools/libxc/include -I$(XEN_ROOT)/tools/include -I.
 DEF_CPPFLAGS += -I../grub-upstream/stage1
 DEF_CPPFLAGS += -I../grub-upstream/stage2
 DEF_CPPFLAGS += -I../grub-upstream/netboot

I have also pushed everything:

git://xenbits.xen.org/people/sstabellini/xen-unstable.git public_headers_v6

#8 lore raw

Stefano Stabellini writes ("Re: [Xen-devel] [PATCH v4 1/3] Move xenstore and libxc public headers to include subdir"):

Quoted 3 lines

I have also pushed everything:

git://xenbits.xen.org/people/sstabellini/xen-unstable.git public_headers_v6

I rebased this (onto e01fa4e223fc077e18936d890dbd4813c3e7c9b1) and git was a bit grumbly and said it had to do a 3-way merge. After I did that, my build still failed - see below. The runes I use are:

git-clean -xdff && cp ../.config .
(./configure && make -j4 && echo ok.) 2>&1 | tee ../log
and my .config is:
CONFIG_QEMU=/u/iwj/work/1/qemu-iwj.git QEMU_UPSTREAM_URL=/u/iwj/work/1/qemu-upstream-unstable.git OVMF_UPSTREAM_URL=/u/iwj/work/1/ovmf.git

Thanks,
Ian.

make[3]: Entering directory `/u/iwj/work/xen.git/tools/qemu-xen-traditional-dir' /u/iwj/work/1/qemu-iwj.git/xen-hooks.mak:63: === pciutils-dev package not found - missing /usr/include/pci /u/iwj/work/1/qemu-iwj.git/xen-hooks.mak:64: === PCI passthrough capability has been disabled

  CC    qemu-nbd.o
  CC    qemu-tool.o
  CC    osdep.o
  CC    cutils.o
In file included from ./config-host.h:20:0,
                 from /u/iwj/work/1/qemu-iwj.git/osdep.c:25:
/u/iwj/work/1/qemu-iwj.git/xen-config-host.h:19:21: fatal error: xenctrl.h: No such file or directory
compilation terminated.
In file included from ./config-host.h:20:0,
                 from /u/iwj/work/1/qemu-iwj.git/qemu-common.h:33,
                 from /u/iwj/work/1/qemu-iwj.git/qemu-nbd.c:20:

/u/iwj/work/1/qemu-iwj.git/xen-config-host.h:19:21: fatal error: xenctrl.h: No such file or directory compilation terminated.
make[3]: *** [osdep.o] Error 1
make[3]: *** Waiting for unfinished jobs....
In file included from ./config-host.h:20:0,

                 from /u/iwj/work/1/qemu-iwj.git/qemu-common.h:33,
                 from /u/iwj/work/1/qemu-iwj.git/qemu-tool.c:14:
/u/iwj/work/1/qemu-iwj.git/xen-config-host.h:19:21: fatal error: xenctrl.h: No such file or directory
compilation terminated.
In file included from ./config-host.h:20:0,
                 from /u/iwj/work/1/qemu-iwj.git/qemu-common.h:33,
                 from /u/iwj/work/1/qemu-iwj.git/cutils.c:24:

/u/iwj/work/1/qemu-iwj.git/xen-config-host.h:19:21: fatal error: xenctrl.h: No such file or directory compilation terminated.
make[3]: *** [qemu-nbd.o] Error 1
make[3]: *** [qemu-tool.o] Error 1
make[3]: *** [cutils.o] Error 1
make[3]: Leaving directory `/u/iwj/work/xen.git/tools/qemu-xen-traditional-dir' make[2]: *** [subdir-install-qemu-xen-traditional-dir] Error 2
make[2]: Leaving directory `/u/iwj/work/xen.git/tools'
make[1]: *** [subdirs-install] Error 2
make[1]: Leaving directory `/u/iwj/work/xen.git/tools'
make: *** [install-tools] Error 2

#9 lore raw
Quoted 8 lines · Ian Jackson

Stefano Stabellini writes ("Re: [Xen-devel] [PATCH v4 1/3] Move xenstore and libxc public headers to include subdir"):

Quoted 3 lines

I have also pushed everything:

git://xenbits.xen.org/people/sstabellini/xen-unstable.git public_headers_v6

I rebased this (onto e01fa4e223fc077e18936d890dbd4813c3e7c9b1) and git was a bit grumbly and said it had to do a 3-way merge. After I did that, my build still failed - see below.

Looks like you've not applied the associated qemu-trad.git change to qemu-iwj.git, patch #2 in this series. As noted in the coverletter they should be applied together (with the corresponding Config.mk change folded in here)

Quoted 49 lines

The runes I use are:

git-clean -xdff && cp ../.config .
(./configure && make -j4 && echo ok.) 2>&1 | tee ../log
and my .config is:
CONFIG_QEMU=/u/iwj/work/1/qemu-iwj.git QEMU_UPSTREAM_URL=/u/iwj/work/1/qemu-upstream-unstable.git OVMF_UPSTREAM_URL=/u/iwj/work/1/ovmf.git

Thanks,
Ian.

make[3]: Entering directory `/u/iwj/work/xen.git/tools/qemu-xen-traditional-dir' /u/iwj/work/1/qemu-iwj.git/xen-hooks.mak:63: === pciutils-dev package not found - missing /usr/include/pci /u/iwj/work/1/qemu-iwj.git/xen-hooks.mak:64: === PCI passthrough capability has been disabled

  CC    qemu-nbd.o
  CC    qemu-tool.o
  CC    osdep.o
  CC    cutils.o
In file included from ./config-host.h:20:0,
                 from /u/iwj/work/1/qemu-iwj.git/osdep.c:25:
/u/iwj/work/1/qemu-iwj.git/xen-config-host.h:19:21: fatal error: xenctrl.h: No such file or directory
compilation terminated.
In file included from ./config-host.h:20:0,
                 from /u/iwj/work/1/qemu-iwj.git/qemu-common.h:33,
                 from /u/iwj/work/1/qemu-iwj.git/qemu-nbd.c:20:

/u/iwj/work/1/qemu-iwj.git/xen-config-host.h:19:21: fatal error: xenctrl.h: No such file or directory compilation terminated.
make[3]: *** [osdep.o] Error 1
make[3]: *** Waiting for unfinished jobs....
In file included from ./config-host.h:20:0,

                 from /u/iwj/work/1/qemu-iwj.git/qemu-common.h:33,
                 from /u/iwj/work/1/qemu-iwj.git/qemu-tool.c:14:
/u/iwj/work/1/qemu-iwj.git/xen-config-host.h:19:21: fatal error: xenctrl.h: No such file or directory
compilation terminated.
In file included from ./config-host.h:20:0,
                 from /u/iwj/work/1/qemu-iwj.git/qemu-common.h:33,
                 from /u/iwj/work/1/qemu-iwj.git/cutils.c:24:

/u/iwj/work/1/qemu-iwj.git/xen-config-host.h:19:21: fatal error: xenctrl.h: No such file or directory compilation terminated.
make[3]: *** [qemu-nbd.o] Error 1
make[3]: *** [qemu-tool.o] Error 1
make[3]: *** [cutils.o] Error 1
make[3]: Leaving directory `/u/iwj/work/xen.git/tools/qemu-xen-traditional-dir' make[2]: *** [subdir-install-qemu-xen-traditional-dir] Error 2
make[2]: Leaving directory `/u/iwj/work/xen.git/tools'
make[1]: *** [subdirs-install] Error 2
make[1]: Leaving directory `/u/iwj/work/xen.git/tools'
make: *** [install-tools] Error 2

#10 lore raw

Ian Campbell writes ("Re: [Xen-devel] [PATCH v4 1/3] Move xenstore and libxc public headers to include subdir"):

Quoted 4 lines

Looks like you've not applied the associated qemu-trad.git change to qemu-iwj.git, patch #2 in this series. As noted in the coverletter they should be applied together (with the corresponding Config.mk change folded in here)

You were right. I have now applied 1/3 and 2/3 together. (That is, I have applied 2/3 to qemu trad, and amended 1/3 to contain also a Config.mk update to mention the new qemu commit.)

I'm about to push 3/3.

Thanks,
Ian.

#11 lore raw
Quoted 11 lines · Ian Jackson

Ian Campbell writes ("Re: [Xen-devel] [PATCH v4 1/3] Move xenstore and libxc public headers to include subdir"):

Quoted 4 lines

Looks like you've not applied the associated qemu-trad.git change to qemu-iwj.git, patch #2 in this series. As noted in the coverletter they should be applied together (with the corresponding Config.mk change folded in here)

You were right. I have now applied 1/3 and 2/3 together. (That is, I have applied 2/3 to qemu trad, and amended 1/3 to contain also a Config.mk update to mention the new qemu commit.)

I'm about to push 3/3.

Thanks!

#12 lore raw

PATCH v4 2/3 qemu-xen-trad: -I tools/libxc/include and tools/xenstore/include

In reply to Stefano Stabellini

The public libxc and xenstore headers have been moved to tools/libxc/include and tools/xenstore/include respectively: change the Makefiles accordingly.

---
 Makefile      |    4 ++--
 xen-hooks.mak |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
Makefile +2 -2
index 37c7066..c1900ca 100644
@@ -46,9 +46,9 @@ $(filter %-user,$(SUBDIR_RULES)): libqemu_user.a
 
 recurse-all: $(SUBDIR_RULES)
 
-CPPFLAGS += -I$(XEN_ROOT)/tools/libxc
+CPPFLAGS += -I$(XEN_ROOT)/tools/libxc/include
 CPPFLAGS += -I$(XEN_ROOT)/tools/blktap/lib
-CPPFLAGS += -I$(XEN_ROOT)/tools/xenstore
+CPPFLAGS += -I$(XEN_ROOT)/tools/xenstore/include
 CPPFLAGS += -I$(XEN_ROOT)/tools/include
 
 tapdisk-ioemu: tapdisk-ioemu.c cutils.c block.c block-raw.c block-cow.c block-qcow.c aes.c block-vmdk.c block-cloop.c block-dmg.c block-bochs.c block-vpc.c block-vvfat.c block-qcow2.c hw/xen_blktap.c osdep.c
xen-hooks.mak +2 -2
index 58d61c9..9263892 100644
@@ -1,5 +1,5 @@
-CPPFLAGS+= -I$(XEN_ROOT)/tools/libxc
-CPPFLAGS+= -I$(XEN_ROOT)/tools/xenstore
+CPPFLAGS+= -I$(XEN_ROOT)/tools/libxc/include
+CPPFLAGS+= -I$(XEN_ROOT)/tools/xenstore/include
 CPPFLAGS+= -I$(XEN_ROOT)/tools/include
 
 SSE2 := $(call cc-option,-msse2,)
Signature · 1 line
1.7.10.4
#13 lore raw

PATCH v4 3/3 enable QEMU for ARM builds

In reply to Stefano Stabellini

Build qemu-xen on ARM and ARM64: it is used to provide the PV backends, disk and framebuffer in particular.

Ideally we would also modify the configure options to only build what is
necessary: a machine just for PV backends. However that is a work in progress and not yet available in QEMU (see
http://marc.info/?l=qemu-devel&m=139082425718379&w=2). So we just build the usual i386 target, even though no i386 emulation is going to be done by qemu-xen on ARM.

tools/configure +2 -0
index a4aa8f1..ae60824 100755
@@ -3876,6 +3876,8 @@ else
     case "$host_cpu" in
         i[3456]86|x86_64)
            qemu_xen=y;;
+        arm*|aarch64)
+           qemu_xen=y;;
         *) qemu_xen=n;;
     esac
 
tools/configure.ac +2 -0
index 629d6a0..c595233 100644
@@ -132,6 +132,8 @@ AC_ARG_WITH([system-qemu],
     case "$host_cpu" in
         i[[3456]]86|x86_64)
            qemu_xen=y;;
+        arm*|aarch64)
+           qemu_xen=y;;
         *) qemu_xen=n;;
     esac
 ])
Acked-by on v4 3/3
#14 lore raw

Re: [PATCH v4 3/3] enable QEMU for ARM builds

Quoted 11 lines · Stefano Stabellini

Build qemu-xen on ARM and ARM64: it is used to provide the PV backends, disk and framebuffer in particular.

Ideally we would also modify the configure options to only build what is
necessary: a machine just for PV backends. However that is a work in progress and not yet available in QEMU (see
http://marc.info/?l=qemu-devel&m=139082425718379&w=2). So we just build the usual i386 target, even though no i386 emulation is going to be done by qemu-xen on ARM.

#15 lore raw

Re: [PATCH v4 3/3] enable QEMU for ARM builds

In reply to Stefano Stabellini
Quoted 11 lines · Stefano Stabellini

Build qemu-xen on ARM and ARM64: it is used to provide the PV backends, disk and framebuffer in particular.

Ideally we would also modify the configure options to only build what is
necessary: a machine just for PV backends. However that is a work in progress and not yet available in QEMU (see
http://marc.info/?l=qemu-devel&m=139082425718379&w=2). So we just build the usual i386 target, even though no i386 emulation is going to be done by qemu-xen on ARM.

This doesn't build for arm64:

        if test -d git://xenbits.xen.org/qemu-upstream-unstable.git ; then \
                        source=git://xenbits.xen.org/qemu-upstream-unstable.git; \
                else \
                        source=.; \
                fi; \
                cd qemu-xen-dir; \
                $source/configure --enable-xen --target-list=i386-softmmu \
                        --enable-debug --enable-trace-backend=stderr \
                        --prefix=/usr/local/lib/xen \
                        --libdir=/usr/local/lib/xen/lib \
                        --includedir=/usr/local/lib/xen/include \
                        --source-path=$source \
                        --extra-cflags="-I/local/scratch/ianc/devel/committer-arm64.git/tools/../tools/include \
                        -I/local/scratch/ianc/devel/committer-arm64.git/tools/../tools/libxc/include \
                        -I/local/scratch/ianc/devel/committer-arm64.git/tools/../tools/xenstore/include \
                        -I/local/scratch/ianc/devel/committer-arm64.git/tools/../tools/xenstore/compat/include \
                        " \
                        --extra-ldflags="-L/local/scratch/ianc/devel/committer-arm64.git/tools/../tools/libxc \
                        -L/local/scratch/ianc/devel/committer-arm64.git/tools/../tools/xenstore \
                        -Wl,-rpath=/usr/local/lib/xen/lib" \
                        --bindir=/usr/local/lib/xen/bin \
                        --datadir=/usr/local/share/qemu-xen \
                        --localstatedir=/var \
                        --disable-kvm \
                        --disable-docs \
                        --disable-guest-agent \
                        --python=python \
                         \
                        --cpu=arm64 --cross-prefix=aarch64-linux-gnu- --interp-prefix=/usr/aarch64-linux-gnu/sys-root; \
                make all
        
        ERROR: Unsupported CPU = arm64, try --enable-tcg-interpreter
        
        make[3]: Entering directory `/local/scratch/ianc/devel/committer-arm64.git/tools/qemu-xen-dir-remote'
        make[3]: *** No rule to make target `/qemu-options.hx', needed by `qemu-options.def'.  Stop.

I think upstream calls arm64 aarch64, or maybe our qemu isn't new enough yet?

Since osstest doesn't yet include arm64 we aren't going to block staging->master over this but we should still fix. Either by removing aarch64 from the configure test or by making it actually build (by adjusting --cpu=?).

Ian.

#16 lore raw

Re: [PATCH v4 3/3] enable QEMU for ARM builds

Quoted 50 lines · Ian Campbell
Quoted 11 lines · Stefano Stabellini

Build qemu-xen on ARM and ARM64: it is used to provide the PV backends, disk and framebuffer in particular.

Ideally we would also modify the configure options to only build what is
necessary: a machine just for PV backends. However that is a work in progress and not yet available in QEMU (see
http://marc.info/?l=qemu-devel&m=139082425718379&w=2). So we just build the usual i386 target, even though no i386 emulation is going to be done by qemu-xen on ARM.

This doesn't build for arm64:

        if test -d git://xenbits.xen.org/qemu-upstream-unstable.git ; then \
                        source=git://xenbits.xen.org/qemu-upstream-unstable.git; \
                else \
                        source=.; \
                fi; \
                cd qemu-xen-dir; \
                $source/configure --enable-xen --target-list=i386-softmmu \
                        --enable-debug --enable-trace-backend=stderr \
                        --prefix=/usr/local/lib/xen \
                        --libdir=/usr/local/lib/xen/lib \
                        --includedir=/usr/local/lib/xen/include \
                        --source-path=$source \
                        --extra-cflags="-I/local/scratch/ianc/devel/committer-arm64.git/tools/../tools/include \
                        -I/local/scratch/ianc/devel/committer-arm64.git/tools/../tools/libxc/include \
                        -I/local/scratch/ianc/devel/committer-arm64.git/tools/../tools/xenstore/include \
                        -I/local/scratch/ianc/devel/committer-arm64.git/tools/../tools/xenstore/compat/include \
                        " \
                        --extra-ldflags="-L/local/scratch/ianc/devel/committer-arm64.git/tools/../tools/libxc \
                        -L/local/scratch/ianc/devel/committer-arm64.git/tools/../tools/xenstore \
                        -Wl,-rpath=/usr/local/lib/xen/lib" \
                        --bindir=/usr/local/lib/xen/bin \
                        --datadir=/usr/local/share/qemu-xen \
                        --localstatedir=/var \
                        --disable-kvm \
                        --disable-docs \
                        --disable-guest-agent \
                        --python=python \
                         \
                        --cpu=arm64 --cross-prefix=aarch64-linux-gnu- --interp-prefix=/usr/aarch64-linux-gnu/sys-root; \
                make all
        
        ERROR: Unsupported CPU = arm64, try --enable-tcg-interpreter
        
        make[3]: Entering directory `/local/scratch/ianc/devel/committer-arm64.git/tools/qemu-xen-dir-remote'
        make[3]: *** No rule to make target `/qemu-options.hx', needed by `qemu-options.def'.  Stop.
Quoted 6 lines

I think upstream calls arm64 aarch64, or maybe our qemu isn't new enough yet?

Since osstest doesn't yet include arm64 we aren't going to block staging->master over this but we should still fix. Either by removing aarch64 from the configure test or by making it actually build (by adjusting --cpu=?).

Does the following fix the issue for you?

config/arm32.mk +3 -0
index aa79d22..5f056bd 100644
@@ -18,3 +18,6 @@ HAS_NS16550 := y
 LDFLAGS_DIRECT += -EL
 
 CONFIG_LOAD_ADDRESS ?= 0x80000000
+
+#QEMU CPU arch
+IOEMU_CPU_ARCH ?= arm
config/arm64.mk +3 -0
index 15b57a4..f42ffe0 100644
@@ -13,3 +13,6 @@ HAS_NS16550 := y
 LDFLAGS_DIRECT += -EL
 
 CONFIG_LOAD_ADDRESS ?= 0x80000000
+
+#QEMU CPU arch
+IOEMU_CPU_ARCH ?= aarch64
config/x86_32.mk +3 -0
index 7f76b25..0da63ed 100644
@@ -12,3 +12,6 @@ CFLAGS += -m32 -march=i686
 LDFLAGS_DIRECT_OpenBSD = _obsd
 LDFLAGS_DIRECT_FreeBSD = _fbsd
 LDFLAGS_DIRECT += -melf_i386$(LDFLAGS_DIRECT_$(XEN_OS))
+
+#QEMU CPU arch
+IOEMU_CPU_ARCH ?= i386
config/x86_64.mk +3 -0
index 11104bd..f5c32a2 100644
@@ -25,3 +25,6 @@ else
 LDFLAGS_DIRECT += -melf_x86_64
 endif
 endif
+
+#QEMU CPU arch
+IOEMU_CPU_ARCH ?= x86_64
tools/Makefile +1 -1
index 1130369..57eaa17 100644
@@ -106,7 +106,7 @@ distclean: subdirs-distclean
 		config.cache autom4te.cache
 
 ifneq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ARCH))
-IOEMU_CONFIGURE_CROSS ?= --cpu=$(XEN_TARGET_ARCH) \
+IOEMU_CONFIGURE_CROSS ?= --cpu=$(IOEMU_CPU_ARCH) \
 			 --cross-prefix=$(CROSS_COMPILE) \
 			 --interp-prefix=$(CROSS_SYS_ROOT)
 endif
#17 lore raw

Re: [PATCH v4 3/3] enable QEMU for ARM builds

Quoted 1 line · Stefano Stabellini

Does the following fix the issue for you?

I needed some new build-deps (pixman) but then it appeared to, yes.

I'm in favour of moving the --cpu out from under the IOEMU_CONFIGURE_CROSS and into the normal configure rune. It should be harmless for native builds and will ensure that cross builds don't regress again. Maybe that is more complex with the qemu-trad side of things?

Quoted 58 lines
config/arm32.mk +3 -0
index aa79d22..5f056bd 100644
@@ -18,3 +18,6 @@ HAS_NS16550 := y
 LDFLAGS_DIRECT += -EL
 
 CONFIG_LOAD_ADDRESS ?= 0x80000000
+
+#QEMU CPU arch
+IOEMU_CPU_ARCH ?= arm
config/arm64.mk +3 -0
index 15b57a4..f42ffe0 100644
@@ -13,3 +13,6 @@ HAS_NS16550 := y
 LDFLAGS_DIRECT += -EL
 
 CONFIG_LOAD_ADDRESS ?= 0x80000000
+
+#QEMU CPU arch
+IOEMU_CPU_ARCH ?= aarch64
config/x86_32.mk +3 -0
index 7f76b25..0da63ed 100644
@@ -12,3 +12,6 @@ CFLAGS += -m32 -march=i686
 LDFLAGS_DIRECT_OpenBSD = _obsd
 LDFLAGS_DIRECT_FreeBSD = _fbsd
 LDFLAGS_DIRECT += -melf_i386$(LDFLAGS_DIRECT_$(XEN_OS))
+
+#QEMU CPU arch
+IOEMU_CPU_ARCH ?= i386
config/x86_64.mk +3 -0
index 11104bd..f5c32a2 100644
@@ -25,3 +25,6 @@ else
 LDFLAGS_DIRECT += -melf_x86_64
 endif
 endif
+
+#QEMU CPU arch
+IOEMU_CPU_ARCH ?= x86_64
tools/Makefile +1 -1
index 1130369..57eaa17 100644
@@ -106,7 +106,7 @@ distclean: subdirs-distclean
 		config.cache autom4te.cache
 
 ifneq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ARCH))
-IOEMU_CONFIGURE_CROSS ?= --cpu=$(XEN_TARGET_ARCH) \
+IOEMU_CONFIGURE_CROSS ?= --cpu=$(IOEMU_CPU_ARCH) \
 			 --cross-prefix=$(CROSS_COMPILE) \
 			 --interp-prefix=$(CROSS_SYS_ROOT)
 endif
#18 lore raw

Re: [PATCH v4 3/3] enable QEMU for ARM builds

Quoted 10 lines · Ian Campbell
Quoted 1 line · Stefano Stabellini

Does the following fix the issue for you?

I needed some new build-deps (pixman) but then it appeared to, yes.

I'm in favour of moving the --cpu out from under the IOEMU_CONFIGURE_CROSS and into the normal configure rune. It should be harmless for native builds and will ensure that cross builds don't regress again. Maybe that is more complex with the qemu-trad side of things?

I don't think so: qemu-trad is not used on arm or arm64. I think that the x86_32 tools build on x86_64 still has some other issues but this should be an improvement.

---
Fix QEMU cross-compile build

Introduce the per-arch IOEMU_CPU_ARCH variable.
Always pass --configure=IOEMU_CPU_ARCH to QEMU's configure script.

config/arm32.mk +3 -0
index aa79d22..5f056bd 100644
@@ -18,3 +18,6 @@ HAS_NS16550 := y
 LDFLAGS_DIRECT += -EL
 
 CONFIG_LOAD_ADDRESS ?= 0x80000000
+
+#QEMU CPU arch
+IOEMU_CPU_ARCH ?= arm
config/arm64.mk +3 -0
index 15b57a4..f42ffe0 100644
@@ -13,3 +13,6 @@ HAS_NS16550 := y
 LDFLAGS_DIRECT += -EL
 
 CONFIG_LOAD_ADDRESS ?= 0x80000000
+
+#QEMU CPU arch
+IOEMU_CPU_ARCH ?= aarch64
config/x86_32.mk +3 -0
index 7f76b25..0da63ed 100644
@@ -12,3 +12,6 @@ CFLAGS += -m32 -march=i686
 LDFLAGS_DIRECT_OpenBSD = _obsd
 LDFLAGS_DIRECT_FreeBSD = _fbsd
 LDFLAGS_DIRECT += -melf_i386$(LDFLAGS_DIRECT_$(XEN_OS))
+
+#QEMU CPU arch
+IOEMU_CPU_ARCH ?= i386
config/x86_64.mk +3 -0
index 11104bd..f5c32a2 100644
@@ -25,3 +25,6 @@ else
 LDFLAGS_DIRECT += -melf_x86_64
 endif
 endif
+
+#QEMU CPU arch
+IOEMU_CPU_ARCH ?= x86_64
tools/Makefile +4 -3
index 1130369..7b00a70 100644
@@ -106,8 +106,7 @@ distclean: subdirs-distclean
 		config.cache autom4te.cache
 
 ifneq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ARCH))
-IOEMU_CONFIGURE_CROSS ?= --cpu=$(XEN_TARGET_ARCH) \
-			 --cross-prefix=$(CROSS_COMPILE) \
+IOEMU_CONFIGURE_CROSS ?= --cross-prefix=$(CROSS_COMPILE) \
 			 --interp-prefix=$(CROSS_SYS_ROOT)
 endif
 
@@ -146,7 +145,7 @@ subdir-all-qemu-xen-traditional-dir: qemu-xen-traditional-dir-find
 	set -e; \
 		$(buildmakevars2shellvars); \
 		cd qemu-xen-traditional-dir; \
-		$(QEMU_ROOT)/xen-setup $(IOEMU_CONFIGURE_CROSS); \
+		$(QEMU_ROOT)/xen-setup --cpu=$(IOEMU_CPU_ARCH) $(IOEMU_CONFIGURE_CROSS); \
 		$(MAKE) all
 
 subdir-install-qemu-xen-traditional-dir: qemu-xen-traditional-dir-find
@@ -155,6 +154,7 @@ subdir-install-qemu-xen-traditional-dir: qemu-xen-traditional-dir-find
 		cd qemu-xen-traditional-dir; \
 		$(QEMU_ROOT)/xen-setup \
 		--extra-cflags="$(EXTRA_CFLAGS_QEMU_TRADITIONAL)" \
+		--cpu=$(IOEMU_CPU_ARCH) \
 		$(IOEMU_CONFIGURE_CROSS); \
 		$(MAKE) install
 
@@ -207,6 +207,7 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
 		--disable-guest-agent \
 		--python=$(PYTHON) \
 		$(CONFIG_QEMUU_EXTRA_ARGS) \
+		--cpu=$(IOEMU_CPU_ARCH) \
 		$(IOEMU_CONFIGURE_CROSS); \
 	$(MAKE) all
Acked-by
#19 lore raw

Re: [PATCH v4 3/3] enable QEMU for ARM builds

Quoted 12 lines · Stefano Stabellini
Quoted 10 lines · Ian Campbell
Quoted 1 line · Stefano Stabellini

Does the following fix the issue for you?

I needed some new build-deps (pixman) but then it appeared to, yes.

I'm in favour of moving the --cpu out from under the IOEMU_CONFIGURE_CROSS and into the normal configure rune. It should be harmless for native builds and will ensure that cross builds don't regress again. Maybe that is more complex with the qemu-trad side of things?

Quoted 3 lines

I don't think so: qemu-trad is not used on arm or arm64. I think that the x86_32 tools build on x86_64 still has some other issues but this should be an improvement.

I wasn't sure if qemu-trad even had --cpu, seem it does?

Quoted 7 lines

---
Fix QEMU cross-compile build

Introduce the per-arch IOEMU_CPU_ARCH variable.
Always pass --configure=IOEMU_CPU_ARCH to QEMU's configure script.

Although the comments in config/*.mk are a bit redundant (would you like me to drop as I apply?)

Quoted 84 lines
config/arm32.mk +3 -0
index aa79d22..5f056bd 100644
@@ -18,3 +18,6 @@ HAS_NS16550 := y
 LDFLAGS_DIRECT += -EL
 
 CONFIG_LOAD_ADDRESS ?= 0x80000000
+
+#QEMU CPU arch
+IOEMU_CPU_ARCH ?= arm
config/arm64.mk +3 -0
index 15b57a4..f42ffe0 100644
@@ -13,3 +13,6 @@ HAS_NS16550 := y
 LDFLAGS_DIRECT += -EL
 
 CONFIG_LOAD_ADDRESS ?= 0x80000000
+
+#QEMU CPU arch
+IOEMU_CPU_ARCH ?= aarch64
config/x86_32.mk +3 -0
index 7f76b25..0da63ed 100644
@@ -12,3 +12,6 @@ CFLAGS += -m32 -march=i686
 LDFLAGS_DIRECT_OpenBSD = _obsd
 LDFLAGS_DIRECT_FreeBSD = _fbsd
 LDFLAGS_DIRECT += -melf_i386$(LDFLAGS_DIRECT_$(XEN_OS))
+
+#QEMU CPU arch
+IOEMU_CPU_ARCH ?= i386
config/x86_64.mk +3 -0
index 11104bd..f5c32a2 100644
@@ -25,3 +25,6 @@ else
 LDFLAGS_DIRECT += -melf_x86_64
 endif
 endif
+
+#QEMU CPU arch
+IOEMU_CPU_ARCH ?= x86_64
tools/Makefile +4 -3
index 1130369..7b00a70 100644
@@ -106,8 +106,7 @@ distclean: subdirs-distclean
 		config.cache autom4te.cache
 
 ifneq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ARCH))
-IOEMU_CONFIGURE_CROSS ?= --cpu=$(XEN_TARGET_ARCH) \
-			 --cross-prefix=$(CROSS_COMPILE) \
+IOEMU_CONFIGURE_CROSS ?= --cross-prefix=$(CROSS_COMPILE) \
 			 --interp-prefix=$(CROSS_SYS_ROOT)
 endif
 
@@ -146,7 +145,7 @@ subdir-all-qemu-xen-traditional-dir: qemu-xen-traditional-dir-find
 	set -e; \
 		$(buildmakevars2shellvars); \
 		cd qemu-xen-traditional-dir; \
-		$(QEMU_ROOT)/xen-setup $(IOEMU_CONFIGURE_CROSS); \
+		$(QEMU_ROOT)/xen-setup --cpu=$(IOEMU_CPU_ARCH) $(IOEMU_CONFIGURE_CROSS); \
 		$(MAKE) all
 
 subdir-install-qemu-xen-traditional-dir: qemu-xen-traditional-dir-find
@@ -155,6 +154,7 @@ subdir-install-qemu-xen-traditional-dir: qemu-xen-traditional-dir-find
 		cd qemu-xen-traditional-dir; \
 		$(QEMU_ROOT)/xen-setup \
 		--extra-cflags="$(EXTRA_CFLAGS_QEMU_TRADITIONAL)" \
+		--cpu=$(IOEMU_CPU_ARCH) \
 		$(IOEMU_CONFIGURE_CROSS); \
 		$(MAKE) install
 
@@ -207,6 +207,7 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
 		--disable-guest-agent \
 		--python=$(PYTHON) \
 		$(CONFIG_QEMUU_EXTRA_ARGS) \
+		--cpu=$(IOEMU_CPU_ARCH) \
 		$(IOEMU_CONFIGURE_CROSS); \
 	$(MAKE) all
 
#20 lore raw

Re: [PATCH v4 3/3] enable QEMU for ARM builds

Quoted 25 lines · Ian Campbell
Quoted 12 lines · Stefano Stabellini
Quoted 10 lines · Ian Campbell
Quoted 1 line · Stefano Stabellini

Does the following fix the issue for you?

I needed some new build-deps (pixman) but then it appeared to, yes.

I'm in favour of moving the --cpu out from under the IOEMU_CONFIGURE_CROSS and into the normal configure rune. It should be harmless for native builds and will ensure that cross builds don't regress again. Maybe that is more complex with the qemu-trad side of things?

Quoted 3 lines

I don't think so: qemu-trad is not used on arm or arm64. I think that the x86_32 tools build on x86_64 still has some other issues but this should be an improvement.

I wasn't sure if qemu-trad even had --cpu, seem it does?

Quoted 6 lines

---
Fix QEMU cross-compile build

Introduce the per-arch IOEMU_CPU_ARCH variable.
Always pass --configure=IOEMU_CPU_ARCH to QEMU's configure script.

Quoted 6 lines
Quoted 1 line

Although the comments in config/*.mk are a bit redundant (would you like me to drop as I apply?)

Sure. Also please test as my cross-compiling environments are limited.

Quoted 85 lines
Quoted 83 lines
config/arm32.mk +3 -0
index aa79d22..5f056bd 100644
@@ -18,3 +18,6 @@ HAS_NS16550 := y
 LDFLAGS_DIRECT += -EL
 
 CONFIG_LOAD_ADDRESS ?= 0x80000000
+
+#QEMU CPU arch
+IOEMU_CPU_ARCH ?= arm
config/arm64.mk +3 -0
index 15b57a4..f42ffe0 100644
@@ -13,3 +13,6 @@ HAS_NS16550 := y
 LDFLAGS_DIRECT += -EL
 
 CONFIG_LOAD_ADDRESS ?= 0x80000000
+
+#QEMU CPU arch
+IOEMU_CPU_ARCH ?= aarch64
config/x86_32.mk +3 -0
index 7f76b25..0da63ed 100644
@@ -12,3 +12,6 @@ CFLAGS += -m32 -march=i686
 LDFLAGS_DIRECT_OpenBSD = _obsd
 LDFLAGS_DIRECT_FreeBSD = _fbsd
 LDFLAGS_DIRECT += -melf_i386$(LDFLAGS_DIRECT_$(XEN_OS))
+
+#QEMU CPU arch
+IOEMU_CPU_ARCH ?= i386
config/x86_64.mk +3 -0
index 11104bd..f5c32a2 100644
@@ -25,3 +25,6 @@ else
 LDFLAGS_DIRECT += -melf_x86_64
 endif
 endif
+
+#QEMU CPU arch
+IOEMU_CPU_ARCH ?= x86_64
tools/Makefile +4 -3
index 1130369..7b00a70 100644
@@ -106,8 +106,7 @@ distclean: subdirs-distclean
 		config.cache autom4te.cache
 
 ifneq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ARCH))
-IOEMU_CONFIGURE_CROSS ?= --cpu=$(XEN_TARGET_ARCH) \
-			 --cross-prefix=$(CROSS_COMPILE) \
+IOEMU_CONFIGURE_CROSS ?= --cross-prefix=$(CROSS_COMPILE) \
 			 --interp-prefix=$(CROSS_SYS_ROOT)
 endif
 
@@ -146,7 +145,7 @@ subdir-all-qemu-xen-traditional-dir: qemu-xen-traditional-dir-find
 	set -e; \
 		$(buildmakevars2shellvars); \
 		cd qemu-xen-traditional-dir; \
-		$(QEMU_ROOT)/xen-setup $(IOEMU_CONFIGURE_CROSS); \
+		$(QEMU_ROOT)/xen-setup --cpu=$(IOEMU_CPU_ARCH) $(IOEMU_CONFIGURE_CROSS); \
 		$(MAKE) all
 
 subdir-install-qemu-xen-traditional-dir: qemu-xen-traditional-dir-find
@@ -155,6 +154,7 @@ subdir-install-qemu-xen-traditional-dir: qemu-xen-traditional-dir-find
 		cd qemu-xen-traditional-dir; \
 		$(QEMU_ROOT)/xen-setup \
 		--extra-cflags="$(EXTRA_CFLAGS_QEMU_TRADITIONAL)" \
+		--cpu=$(IOEMU_CPU_ARCH) \
 		$(IOEMU_CONFIGURE_CROSS); \
 		$(MAKE) install
 
@@ -207,6 +207,7 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
 		--disable-guest-agent \
 		--python=$(PYTHON) \
 		$(CONFIG_QEMUU_EXTRA_ARGS) \
+		--cpu=$(IOEMU_CPU_ARCH) \
 		$(IOEMU_CONFIGURE_CROSS); \
 	$(MAKE) all
 
#21 lore raw

Re: [PATCH v4 3/3] enable QEMU for ARM builds

Quoted 26 lines · Stefano Stabellini
Quoted 25 lines · Ian Campbell
Quoted 12 lines · Stefano Stabellini
Quoted 10 lines · Ian Campbell
Quoted 1 line · Stefano Stabellini

Does the following fix the issue for you?

I needed some new build-deps (pixman) but then it appeared to, yes.

I'm in favour of moving the --cpu out from under the IOEMU_CONFIGURE_CROSS and into the normal configure rune. It should be harmless for native builds and will ensure that cross builds don't regress again. Maybe that is more complex with the qemu-trad side of things?

Quoted 3 lines

I don't think so: qemu-trad is not used on arm or arm64. I think that the x86_32 tools build on x86_64 still has some other issues but this should be an improvement.

I wasn't sure if qemu-trad even had --cpu, seem it does?

Quoted 6 lines

---
Fix QEMU cross-compile build

Introduce the per-arch IOEMU_CPU_ARCH variable.
Always pass --configure=IOEMU_CPU_ARCH to QEMU's configure script.

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

Although the comments in config/*.mk are a bit redundant (would you like me to drop as I apply?)

Sure.

ok, will look tomorrow.

Quoted 1 line

Also please test as my cross-compiling environments are limited.

My standard precommit builds are native apart from arm64 which is cross. I reckon that will do.

Ian.

#22 lore raw

Re: [PATCH v4 3/3] enable QEMU for ARM builds

Quoted 34 lines · Ian Campbell
Quoted 33 lines · Stefano Stabellini
Quoted 31 lines · Ian Campbell
Quoted 12 lines · Stefano Stabellini
Quoted 10 lines · Ian Campbell
Quoted 1 line · Stefano Stabellini

Does the following fix the issue for you?

I needed some new build-deps (pixman) but then it appeared to, yes.

I'm in favour of moving the --cpu out from under the IOEMU_CONFIGURE_CROSS and into the normal configure rune. It should be harmless for native builds and will ensure that cross builds don't regress again. Maybe that is more complex with the qemu-trad side of things?

Quoted 3 lines

I don't think so: qemu-trad is not used on arm or arm64. I think that the x86_32 tools build on x86_64 still has some other issues but this should be an improvement.

I wasn't sure if qemu-trad even had --cpu, seem it does?

Quoted 7 lines

---
Fix QEMU cross-compile build

Introduce the per-arch IOEMU_CPU_ARCH variable.
Always pass --configure=IOEMU_CPU_ARCH to QEMU's configure script.

Although the comments in config/*.mk are a bit redundant (would you like me to drop as I apply?)

Quoted 8 lines
Quoted 1 line

Sure.

ok, will look tomorrow.

Quoted 1 line

Also please test as my cross-compiling environments are limited.

My standard precommit builds are native apart from arm64 which is cross. I reckon that will do.

These all passed, so I've pushed. Thanks!