From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: [PATCH] qemu-kvm: Fix non-PCI target build Date: Wed, 23 Feb 2011 09:28:53 +0100 Message-ID: <4D64C545.3020205@siemens.com> References: <4D63EF01.5040203@redhat.com> <20110223074948.GA7608@pcnci.linuxbox.cz> <4D64BFD1.2020602@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Nikola Ciprich , kvm@vger.kernel.org, Avi Kivity , Marcelo Tosatti To: klondike Return-path: Received: from goliath.siemens.de ([192.35.17.28]:25931 "EHLO goliath.siemens.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754783Ab1BWI3R (ORCPT ); Wed, 23 Feb 2011 03:29:17 -0500 In-Reply-To: <4D64BFD1.2020602@gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: On 2011-02-23 09:05, klondike wrote: > El 23/02/11 08:49, Nikola Ciprich escribi=F3: >> Hello Avi, > Hi, >> when trying to compile(link) various targets, I get: >> LINK sparc-softmmu/qemu-system-sparc >> pci-stub.o: In function `do_pci_info_print': >> /usr/src/redhat/BUILD/qemu-kvm-0.14.0/hw/pci-stub.c:36: multiple def= inition of `do_pci_info_print' >> pci.o:/usr/src/redhat/BUILD/qemu-kvm-0.14.0/hw/pci.c:1398: first def= ined here >> /usr/bin/ld: Warning: size of symbol `do_pci_info_print' changed fro= m 147 in pci.o to 50 in pci-stub.o >> pci-stub.o: In function `do_pci_info': >> /usr/src/redhat/BUILD/qemu-kvm-0.14.0/hw/pci-stub.c:31: multiple def= inition of `do_pci_info' >> pci.o:/usr/src/redhat/BUILD/qemu-kvm-0.14.0/hw/pci.c:1560: first def= ined here >> /usr/bin/ld: Warning: size of symbol `do_pci_info' changed from 150 = in pci.o to 50 in pci-stub.o >> pci.o: In function `pci_update_mappings': >> pci.c:(.text+0xa91): undefined reference to `pci_bridge_get_base' >> pci.c:(.text+0xaa5): undefined reference to `pci_bridge_get_limit' >> pci.c:(.text+0xb7b): undefined reference to `pci_bridge_get_base' >> pci.c:(.text+0xb8e): undefined reference to `pci_bridge_get_limit' >> pci.o: In function `pci_get_devices_list': >> pci.c:(.text+0x2024): undefined reference to `pci_bridge_get_limit' >> pci.c:(.text+0x2036): undefined reference to `pci_bridge_get_base' >> pci.c:(.text+0x2043): undefined reference to `pci_bridge_get_limit' >> pci.c:(.text+0x2050): undefined reference to `pci_bridge_get_base' >> pci.c:(.text+0x2060): undefined reference to `pci_bridge_get_limit' >> pci.c:(.text+0x2070): undefined reference to `pci_bridge_get_base' >> collect2: ld returned 1 exit status >> make[1]: *** [qemu-system-sparc] Error 1 >> make: *** [subdir-sparc-softmmu] Error 2 > I hit this problem too and after a long night I tracked it back to so= me > odd merge, this patch solved the issue for me. This unfortunately breaks the build with device assignment enabled. Patch below is required. Generally, I would recommend to avoid using the qemu-kvm tree for anything else than x86 with kvm support. Other use cases ought to work but are rarely tested. Better pick upstream qemu in this case until we reduced the diffs between both trees to a much smaller amount. qemu-kvm-0.15 may become a milestone in this regard. Jan ----------8<---------- Replace obsolete qemu-kvm.h with kvm.h in pci.c and build that module just like upstream does. This fixes non-x86 targets which have no PCI support. Signed-off-by: Jan Kiszka --- Makefile.objs | 2 +- Makefile.target | 2 +- hw/pci.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile.objs b/Makefile.objs index f5702eb..3ec7121 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -170,7 +170,7 @@ hw-obj-y =3D hw-obj-y +=3D loader.o hw-obj-$(CONFIG_VIRTIO) +=3D virtio.o virtio-console.o hw-obj-y +=3D fw_cfg.o -hw-obj-$(CONFIG_PCI) +=3D pci_bridge.o +hw-obj-$(CONFIG_PCI) +=3D pci.o pci_bridge.o hw-obj-$(CONFIG_PCI) +=3D msix.o msi.o hw-obj-$(CONFIG_PCI) +=3D pci_host.o pcie_host.o hw-obj-$(CONFIG_PCI) +=3D ioh3420.o xio3130_upstream.o xio3130_downstr= eam.o diff --git a/Makefile.target b/Makefile.target index 6e9a024..23367eb 100644 --- a/Makefile.target +++ b/Makefile.target @@ -195,7 +195,7 @@ endif #CONFIG_BSD_USER # System emulator target ifdef CONFIG_SOFTMMU =20 -obj-y =3D arch_init.o cpus.o monitor.o pci.o machine.o gdbstub.o vl.o = balloon.o +obj-y =3D arch_init.o cpus.o monitor.o machine.o gdbstub.o vl.o balloo= n.o # virtio has to be here due to weird dependency between PCI and virtio= -net. # need to fix this properly obj-$(CONFIG_NO_PCI) +=3D pci-stub.o diff --git a/hw/pci.c b/hw/pci.c index 0c44939..1f6cebe 100644 --- a/hw/pci.c +++ b/hw/pci.c @@ -29,8 +29,8 @@ #include "net.h" #include "sysemu.h" #include "loader.h" -#include "qemu-kvm.h" #include "hw/pc.h" +#include "kvm.h" #include "device-assignment.h" #include "qemu-objects.h" #include "range.h" --=20 1.7.1