From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33117) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJwxr-0001SU-Ny for qemu-devel@nongnu.org; Wed, 11 Sep 2013 22:49:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VJwxl-0002LD-O3 for qemu-devel@nongnu.org; Wed, 11 Sep 2013 22:49:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:2211) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJwxl-0002L9-FB for qemu-devel@nongnu.org; Wed, 11 Sep 2013 22:48:57 -0400 Date: Thu, 12 Sep 2013 10:48:49 +0800 From: Fam Zheng Message-ID: <20130912024849.GH9134@T430s.nay.redhat.com> References: <1378906448-15834-1-git-send-email-famz@redhat.com> <1378906448-15834-4-git-send-email-famz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH v6 3/8] Makefile: introduce common-obj-m and block-obj-m for DSO Reply-To: famz@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Michael Tokarev , QEMU Developers , Stefan Hajnoczi , Paolo Bonzini , =?iso-8859-1?Q?Llu=EDs?= Vilanova , Richard Henderson On Wed, 09/11 21:01, Peter Maydell wrote: > On 11 September 2013 14:34, Fam Zheng wrote: > > Add necessary rules and flags for shared object generation. > > $(common-obj-m) will include $(block-obj-m), like $(common-obj-y) does > > for $(block-obj-y). The new rules introduced here are: > > > > 0) For all %.so compiling: > > > > QEMU_CFLAGS += -fPIC > > > > 1) %.o in $(common-obj-m) is compiled to %.o, then linked to %.so. > > > > 2) %.mo in $(common-obj-m) is the placeholder for %.so for pattern > > matching in Makefile. It's linked to "-shared" with all its dependencies > > (multiple *.o) as input. Which means the list of depended objects must > > be ruled out in each sub-Makefile.objs with an variable: > > > > foo.mo-objs := bar.o baz.o qux.o > > > > in the same style with foo.o-cflags and foo.o-libs. > > This spectacularly breaks compilation if you don't have libtool > (which is currently an entirely optional dependency). > > Test build/configure command, for x86-64 linux: > > rm -rf build/x86 && mkdir build/x86 && (cd build/x86 && LIBTOOL= > ../../configure --target-list=arm-softmmu --enable-debug --cc='ccache > gcc' --disable-smartcard-nss) && make -C build/x86 -j4 > > Fails like this: > > LINK qemu-ga > /usr/bin/ld.bfd.real: > /usr/lib/debug/usr/lib/x86_64-linux-gnu/Scrt1.o(.debug_info): > relocation 0 has invalid symbol index 10 > /usr/bin/ld.bfd.real: > /usr/lib/debug/usr/lib/x86_64-linux-gnu/Scrt1.o(.debug_info): > relocation 1 has invalid symbol index 11 > /usr/bin/ld.bfd.real: > /usr/lib/debug/usr/lib/x86_64-linux-gnu/Scrt1.o(.debug_info): > relocation 2 has invalid symbol index 2 > /usr/bin/ld.bfd.real: > /usr/lib/debug/usr/lib/x86_64-linux-gnu/Scrt1.o(.debug_info): > relocation 3 has invalid symbol index 2 > /usr/bin/ld.bfd.real: > /usr/lib/debug/usr/lib/x86_64-linux-gnu/Scrt1.o(.debug_info): > relocation 4 has invalid symbol index 10 > /usr/bin/ld.bfd.real: > /usr/lib/debug/usr/lib/x86_64-linux-gnu/Scrt1.o(.debug_info): > relocation 5 has invalid symbol index 12 > /usr/bin/ld.bfd.real: > /usr/lib/debug/usr/lib/x86_64-linux-gnu/Scrt1.o(.debug_info): > relocation 6 has invalid symbol index 12 > /usr/bin/ld.bfd.real: > /usr/lib/debug/usr/lib/x86_64-linux-gnu/Scrt1.o(.debug_info): > relocation 7 has invalid symbol index 12 > /usr/bin/ld.bfd.real: > /usr/lib/debug/usr/lib/x86_64-linux-gnu/Scrt1.o(.debug_info): > relocation 8 has invalid symbol index 2 > /usr/bin/ld.bfd.real: > /usr/lib/debug/usr/lib/x86_64-linux-gnu/Scrt1.o(.debug_info): > relocation 9 has invalid symbol index 2 > /usr/bin/ld.bfd.real: > /usr/lib/debug/usr/lib/x86_64-linux-gnu/Scrt1.o(.debug_info): > relocation 10 has invalid symbol index 11 > /usr/bin/ld.bfd.real: > /usr/lib/debug/usr/lib/x86_64-linux-gnu/Scrt1.o(.debug_info): > relocation 11 has invalid symbol index 12 > /usr/bin/ld.bfd.real: > /usr/lib/debug/usr/lib/x86_64-linux-gnu/Scrt1.o(.debug_info): > relocation 12 has invalid symbol index 12 > /usr/bin/ld.bfd.real: > /usr/lib/debug/usr/lib/x86_64-linux-gnu/Scrt1.o(.debug_info): > relocation 13 has invalid symbol index 12 > /usr/bin/ld.bfd.real: > /usr/lib/debug/usr/lib/x86_64-linux-gnu/Scrt1.o(.debug_info): > relocation 14 has invalid symbol index 12 > /usr/bin/ld.bfd.real: > /usr/lib/debug/usr/lib/x86_64-linux-gnu/Scrt1.o(.debug_info): > relocation 15 has invalid symbol index 12 > /usr/bin/ld.bfd.real: > /usr/lib/debug/usr/lib/x86_64-linux-gnu/Scrt1.o(.debug_info): > relocation 16 has invalid symbol index 12 > /usr/bin/ld.bfd.real: > /usr/lib/debug/usr/lib/x86_64-linux-gnu/Scrt1.o(.debug_info): > relocation 17 has invalid symbol index 12 > /usr/bin/ld.bfd.real: > /usr/lib/debug/usr/lib/x86_64-linux-gnu/Scrt1.o(.debug_info): > relocation 18 has invalid symbol index 12 > /usr/bin/ld.bfd.real: > /usr/lib/debug/usr/lib/x86_64-linux-gnu/Scrt1.o(.debug_info): > relocation 19 has invalid symbol index 12 > /usr/bin/ld.bfd.real: > /usr/lib/debug/usr/lib/x86_64-linux-gnu/Scrt1.o(.debug_info): > relocation 20 has invalid symbol index 20 > /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/Scrt1.o: > In function `_start': > (.text+0x20): undefined reference to `main' > collect2: ld returned 1 exit status > make: *** [qemu-ga] Error 1 > > > If we make libtool mandatory then (a) we need to make configure > bail out if it can't find it (b) we need to flag it up in the release notes > as a new mandatory dependency. > > I'd really prefer it if we could avoid it though; among other things > MacOSX doesn't ship with a GNU libtool. > It's a bug in patch 03 (missing comma, again), I'll fix it in next revision. Thanks for testing. Fam