Skip to contentSkip to conversation

qemu build: disable C++ optional code

PATCH In review Stefano Stabellini 2 participants 4 messages Jul 7, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qemu build: disable C++ optional code

Disable C++ optimizations for the intruction emulators: we don't need them and they can cause build issues with Xen.

tools/Makefile +1 -0
index f4aa200..da20f5a 100644
@@ -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); \
#1 lore raw
Quoted 2 lines · Stefano Stabellini

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.

Quoted 16 lines
tools/Makefile +1 -0
index f4aa200..da20f5a 100644
@@ -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); \
#2 lore raw
Quoted 6 lines · Ian Campbell
Quoted 2 lines · Stefano Stabellini

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.

Quoted 3 lines

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.

Quoted 17 lines
Quoted 15 lines
tools/Makefile +1 -0
index f4aa200..da20f5a 100644
@@ -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); \
#3 lore raw
Quoted 5 lines · Stefano Stabellini
Quoted 4 lines · Ian Campbell
Quoted 2 lines · Stefano Stabellini

Disable C++ optimizations for the intruction emulators: we don't need them and they can cause build issues with Xen.

Quoted 7 lines
Quoted 2 lines

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.

Quoted 10 lines
Quoted 3 lines

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

(quoted diff) +0 -3
-I$(XEN_ROOT)/tools/include
-I$(XEN_ROOT)/tools/libxc
-I$(XEN_ROOT)/tools/xenstore
Quoted 4 lines

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.