diff mbox

[Xen-devel,v4,3/3] enable QEMU for ARM builds

Message ID alpine.DEB.2.02.1409231556000.15268@kaball.uk.xensource.com
State New
Headers show

Commit Message

Stefano Stabellini Sept. 23, 2014, 2:56 p.m. UTC
On Tue, 23 Sep 2014, Ian Campbell wrote:
> On Fri, 2014-08-01 at 16:32 +0100, Stefano Stabellini wrote:
> > 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.
> > 
> > Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> 
> 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=?).

Does the following fix the issue for you?

Comments

Ian Campbell Sept. 23, 2014, 3:21 p.m. UTC | #1
On Tue, 2014-09-23 at 15:56 +0100, Stefano Stabellini wrote:
> 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?


> 
> diff --git a/config/arm32.mk b/config/arm32.mk
> index aa79d22..5f056bd 100644
> --- a/config/arm32.mk
> +++ b/config/arm32.mk
> @@ -18,3 +18,6 @@ HAS_NS16550 := y
>  LDFLAGS_DIRECT += -EL
>  
>  CONFIG_LOAD_ADDRESS ?= 0x80000000
> +
> +#QEMU CPU arch
> +IOEMU_CPU_ARCH ?= arm
> diff --git a/config/arm64.mk b/config/arm64.mk
> index 15b57a4..f42ffe0 100644
> --- a/config/arm64.mk
> +++ b/config/arm64.mk
> @@ -13,3 +13,6 @@ HAS_NS16550 := y
>  LDFLAGS_DIRECT += -EL
>  
>  CONFIG_LOAD_ADDRESS ?= 0x80000000
> +
> +#QEMU CPU arch
> +IOEMU_CPU_ARCH ?= aarch64
> diff --git a/config/x86_32.mk b/config/x86_32.mk
> index 7f76b25..0da63ed 100644
> --- a/config/x86_32.mk
> +++ b/config/x86_32.mk
> @@ -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
> diff --git a/config/x86_64.mk b/config/x86_64.mk
> index 11104bd..f5c32a2 100644
> --- a/config/x86_64.mk
> +++ b/config/x86_64.mk
> @@ -25,3 +25,6 @@ else
>  LDFLAGS_DIRECT += -melf_x86_64
>  endif
>  endif
> +
> +#QEMU CPU arch
> +IOEMU_CPU_ARCH ?= x86_64
> diff --git a/tools/Makefile b/tools/Makefile
> index 1130369..57eaa17 100644
> --- a/tools/Makefile
> +++ b/tools/Makefile
> @@ -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
diff mbox

Patch

diff --git a/config/arm32.mk b/config/arm32.mk
index aa79d22..5f056bd 100644
--- a/config/arm32.mk
+++ b/config/arm32.mk
@@ -18,3 +18,6 @@  HAS_NS16550 := y
 LDFLAGS_DIRECT += -EL
 
 CONFIG_LOAD_ADDRESS ?= 0x80000000
+
+#QEMU CPU arch
+IOEMU_CPU_ARCH ?= arm
diff --git a/config/arm64.mk b/config/arm64.mk
index 15b57a4..f42ffe0 100644
--- a/config/arm64.mk
+++ b/config/arm64.mk
@@ -13,3 +13,6 @@  HAS_NS16550 := y
 LDFLAGS_DIRECT += -EL
 
 CONFIG_LOAD_ADDRESS ?= 0x80000000
+
+#QEMU CPU arch
+IOEMU_CPU_ARCH ?= aarch64
diff --git a/config/x86_32.mk b/config/x86_32.mk
index 7f76b25..0da63ed 100644
--- a/config/x86_32.mk
+++ b/config/x86_32.mk
@@ -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
diff --git a/config/x86_64.mk b/config/x86_64.mk
index 11104bd..f5c32a2 100644
--- a/config/x86_64.mk
+++ b/config/x86_64.mk
@@ -25,3 +25,6 @@  else
 LDFLAGS_DIRECT += -melf_x86_64
 endif
 endif
+
+#QEMU CPU arch
+IOEMU_CPU_ARCH ?= x86_64
diff --git a/tools/Makefile b/tools/Makefile
index 1130369..57eaa17 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -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