On 11 September 2013 14:34, Fam Zheng <f...@redhat.com> 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. -- PMM