diff mbox

[Xen-devel] qemu build: disable C++ optional code

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

Commit Message

Stefano Stabellini July 7, 2014, 11:47 a.m. UTC
Disable C++ optimizations for the intruction emulators: we don't need
them and they can cause build issues with Xen.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

Comments

Ian Campbell July 7, 2014, 12:16 p.m. UTC | #1
On Mon, 2014-07-07 at 12:47 +0100, Stefano Stabellini wrote:
> Disable C++ optimizations for the intruction emulators: we don't need
> them and they can cause build issues with Xen.

This doesn't help distros who want to use their existing qemu packages
with Xen though, or in general people who prefer their own qemu to ours.

What sort of build issues do we see? Is this to do with
xen/include/public not being C++ safe or is it code issues within the
Xen parts or qemu?

Ian.

> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> 
> 
> diff --git a/tools/Makefile b/tools/Makefile
> index f4aa200..da20f5a 100644
> --- a/tools/Makefile
> +++ b/tools/Makefile
> @@ -201,6 +201,7 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
>  		--disable-kvm \
>  		--disable-docs \
>  		--disable-guest-agent \
> +		--cxx=none \
>  		--python=$(PYTHON) \
>  		$(CONFIG_QEMUU_EXTRA_ARGS) \
>  		$(IOEMU_CONFIGURE_CROSS); \
Stefano Stabellini July 7, 2014, 2:24 p.m. UTC | #2
On Mon, 7 Jul 2014, Ian Campbell wrote:
> On Mon, 2014-07-07 at 12:47 +0100, Stefano Stabellini wrote:
> > Disable C++ optimizations for the intruction emulators: we don't need
> > them and they can cause build issues with Xen.
> 
> This doesn't help distros who want to use their existing qemu packages
> with Xen though, or in general people who prefer their own qemu to ours.

That is true, however if you are going to compile QEMU to use it as Xen
device model and nothing else, you might as well disable things you
don't need, such KVM support and C++ optimization.
That's why I sent the patch.


> What sort of build issues do we see? Is this to do with
> xen/include/public not being C++ safe or is it code issues within the
> Xen parts or qemu?

The problem is that we use --extra-cflags to pass

-I$(XEN_ROOT)/tools/include
-I$(XEN_ROOT)/tools/libxc
-I$(XEN_ROOT)/tools/xenstore

tools/utils contains an header file named utils.h, same name as
disas/libvixl/utils.h in QEMU. Files under disas/libvixl #include
"utils.h" picking up the wrong one. For some reason, I have only seen
this build problem on ARM so far.



> > Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > 
> > 
> > diff --git a/tools/Makefile b/tools/Makefile
> > index f4aa200..da20f5a 100644
> > --- a/tools/Makefile
> > +++ b/tools/Makefile
> > @@ -201,6 +201,7 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
> >  		--disable-kvm \
> >  		--disable-docs \
> >  		--disable-guest-agent \
> > +		--cxx=none \
> >  		--python=$(PYTHON) \
> >  		$(CONFIG_QEMUU_EXTRA_ARGS) \
> >  		$(IOEMU_CONFIGURE_CROSS); \
> 
>
Ian Campbell July 7, 2014, 2:32 p.m. UTC | #3
On Mon, 2014-07-07 at 15:24 +0100, Stefano Stabellini wrote:
> On Mon, 7 Jul 2014, Ian Campbell wrote:
> > On Mon, 2014-07-07 at 12:47 +0100, Stefano Stabellini wrote:
> > > Disable C++ optimizations for the intruction emulators: we don't need
> > > them and they can cause build issues with Xen.
> > 
> > This doesn't help distros who want to use their existing qemu packages
> > with Xen though, or in general people who prefer their own qemu to ours.
> 
> That is true, however if you are going to compile QEMU to use it as Xen
> device model and nothing else, you might as well disable things you
> don't need, such KVM support and C++ optimization.
> That's why I sent the patch.

I think we'd be better off not deliberately hiding too many of these
problems from our automated tests though, since plenty of people are
going to want to build a full featured qemu to use with Xen and in other
configurations.

> > What sort of build issues do we see? Is this to do with
> > xen/include/public not being C++ safe or is it code issues within the
> > Xen parts or qemu?
> 
> The problem is that we use --extra-cflags to pass
> 
> -I$(XEN_ROOT)/tools/include
> -I$(XEN_ROOT)/tools/libxc
> -I$(XEN_ROOT)/tools/xenstore
> 
> tools/utils contains an header file named utils.h, same name as
> disas/libvixl/utils.h in QEMU. Files under disas/libvixl #include
> "utils.h" picking up the wrong one. For some reason, I have only seen
> this build problem on ARM so far.

So this only affects builds of Qemu when done from within the Xen
buildsystem? If you do "make install" on Xen and then try and build qemu
against the installed headers this doesn't happen?

It sounds like qemu's --extra-cflags is prepending things to $CFLAGS,
which seems a bit backwards to me.

Ian.
diff mbox

Patch

diff --git a/tools/Makefile b/tools/Makefile
index f4aa200..da20f5a 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -201,6 +201,7 @@  subdir-all-qemu-xen-dir: qemu-xen-dir-find
 		--disable-kvm \
 		--disable-docs \
 		--disable-guest-agent \
+		--cxx=none \
 		--python=$(PYTHON) \
 		$(CONFIG_QEMUU_EXTRA_ARGS) \
 		$(IOEMU_CONFIGURE_CROSS); \