From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48737) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAXgn-0002G5-Cq for qemu-devel@nongnu.org; Mon, 03 Feb 2014 23:32:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WAXge-0006Ef-J3 for qemu-devel@nongnu.org; Mon, 03 Feb 2014 23:32:49 -0500 Received: from mail-qc0-x230.google.com ([2607:f8b0:400d:c01::230]:48164) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAXge-0006EY-EL for qemu-devel@nongnu.org; Mon, 03 Feb 2014 23:32:40 -0500 Received: by mail-qc0-f176.google.com with SMTP id e16so12621629qcx.21 for ; Mon, 03 Feb 2014 20:32:40 -0800 (PST) Sender: Paolo Bonzini Message-ID: <52F06D63.8090003@redhat.com> Date: Tue, 04 Feb 2014 05:32:35 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <52CAEF54.7030901@suse.de> <52CB17D1.2060400@redhat.com> <20140107123417.GG10654@zion.uk.xensource.com> <52CC01F6.6050502@redhat.com> <20140121182745.GA23328@zion.uk.xensource.com> <52DF9B76.8060807@redhat.com> <20140122160940.GC24675@zion.uk.xensource.com> <52E0DCDD.60405@redhat.com> <20140123135440.GF24675@zion.uk.xensource.com> <20140123162329.GG24675@zion.uk.xensource.com> In-Reply-To: <20140123162329.GG24675@zion.uk.xensource.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Xen-devel] Project idea: make QEMU more flexible List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wei Liu Cc: Peter Maydell , Stefano Stabellini , QEMU Developers , "xen-devel@lists.xen.org" , Frediano Ziglio , Anthony Liguori , =?ISO-8859-1?Q?Andreas_F=E4rber?= Il 23/01/2014 17:23, Wei Liu ha scritto: > On Thu, Jan 23, 2014 at 01:54:40PM +0000, Wei Liu wrote: >> On Thu, Jan 23, 2014 at 10:11:57AM +0100, Paolo Bonzini wrote: >>> Il 22/01/2014 17:09, Wei Liu ha scritto: >>>> On Wed, Jan 22, 2014 at 11:20:38AM +0100, Paolo Bonzini wrote: >>>>> Il 21/01/2014 19:27, Wei Liu ha scritto: >>>>>>>> >>>>>>>> Googling "disable tcg" would have provided an answer, but the patches >>>>>>>> were old enough to be basically useless. I'll refresh the current >>>>>>>> version in the next few days. Currently I am (or try to be) on >>>>>>>> vacation, so I cannot really say when, but I'll do my best. :) >>>>>>>> >>>>>> Hi Paolo, any update? >>>>> >>>>> Oops, sorry, I thought I had sent that out. It's in the disable-tcg >>>>> branch on my github repository. >>>>> >>>> >>>> Unfortunately your branch didn't work when I enabled TCG support. If I >>>> use "--disable-tcg" with configure then it works fine. >>> >>> Branch fixed. >>> >> >> Yes, it's fixed for the case I reported. Thanks. >> >> But it is now broken with following rune: >> ./configure --enable-kvm --disable-tcg --target-list=i386-softmmu >> --disable-xen --enable-debug >> >> LINK i386-softmmu/qemu-system-i386 >> cpus.o: In function `cpu_signal': >> /local/scratch/qemu/cpus.c:569: undefined reference to `exit_request' >> cpus.o: In function `tcg_cpu_exec': >> /local/scratch/qemu/cpus.c:1257: undefined reference to `cpu_x86_exec' >> cpus.o: In function `tcg_exec_all': >> /local/scratch/qemu/cpus.c:1282: undefined reference to `exit_request' >> /local/scratch/qemu/cpus.c:1299: undefined reference to `exit_request' >> exec.o: In function `tlb_reset_dirty_range_all': >> /local/scratch/qemu/exec.c:736: undefined reference to >> `cpu_tlb_reset_dirty_all' >> collect2: error: ld returned 1 exit status >> make[1]: *** [qemu-system-i386] Error 1 >> make: *** [subdir-i386-softmmu] Error 2 >> >> --enable-debug is the one to blame. Without that it links successfully. >> >> Wei. >> > > Finally I figured out what was wrong. Your patch series was relying on > compiler to aggresively optimize away unused code. > > So when --enable-debug is set, compiler won't optimize away the dead > code, hence those undefine references. With any optimization option -O > you series compiles successfully. > > Feel free to integrate my patch below, or fix those errors in the way > you see appropriate. Thanks! I added stubs for all three undefined symbols in tcg-stub.c. Another way to fix it would be -ffunction-sections/-Wl,--gc-sections (which shaves 200k more out of the .text section), but that breaks glibc static linking. Paolo