From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NJXNp-0000ND-0Q for qemu-devel@nongnu.org; Sat, 12 Dec 2009 14:12:01 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NJXNk-0000Kf-9F for qemu-devel@nongnu.org; Sat, 12 Dec 2009 14:12:00 -0500 Received: from [199.232.76.173] (port=52293 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NJXNk-0000Ka-2m for qemu-devel@nongnu.org; Sat, 12 Dec 2009 14:11:56 -0500 Received: from fmmailgate03.web.de ([217.72.192.234]:56857) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NJXNj-0001zZ-OY for qemu-devel@nongnu.org; Sat, 12 Dec 2009 14:11:56 -0500 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Sat, 12 Dec 2009 20:10:57 +0100 Message-Id: <1260645057-19819-4-git-send-email-andreas.faerber@web.de> In-Reply-To: <1260645057-19819-3-git-send-email-andreas.faerber@web.de> References: <1260645057-19819-1-git-send-email-andreas.faerber@web.de> <1260645057-19819-2-git-send-email-andreas.faerber@web.de> <1260645057-19819-3-git-send-email-andreas.faerber@web.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: andreas.faerber@web.de Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 3/3] Workaround --whole-archive on Solaris List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Andreas=20F=C3=A4rber?= , Palle Lyckegaard From: Andreas F=C3=A4rber On OpenSolaris, neither --whole-archive nor -z allextract appear to work as expected, causing runtime errors. For example: qemu: could not open disk image [...] Fix this by extracting archives and linking their object files individual= ly. libqemu_common.a contains object files from different subdirectories, leading to name clashes, e.g., nbd.o vs. block/nbd.o. Archive a renamed copy of the affected files instead, this avoids duplicating %.c -> %.o compilation rules. Two dashes are used for the cop= y to avoid name clashes between, e.g., block-qcow.c and block/qcow.c. Contain this behavior to Solaris to avoid speed regressions on Linux. Signed-off-by: Andreas F=C3=A4rber Cc: Palle Lyckegaard Cc: Ben Taylor --- Makefile | 14 ++++++++++++++ rules.mak | 4 ++++ 2 files changed, 18 insertions(+), 0 deletions(-) diff --git a/Makefile b/Makefile index a662d96..cb57c61 100644 --- a/Makefile +++ b/Makefile @@ -102,7 +102,14 @@ block-nested-$(CONFIG_WIN32) +=3D raw-win32.o block-nested-$(CONFIG_POSIX) +=3D raw-posix.o block-nested-$(CONFIG_CURL) +=3D curl.o =20 +ifneq ($(CONFIG_SOLARIS),y) block-obj-y +=3D $(addprefix block/, $(block-nested-y)) +else +block-obj-y +=3D $(addprefix block--, $(block-nested-y)) + +block--%.o: block/%.o + $(call quiet-command,cp $< $@," CP $(TARGET_DIR)$@") +endif =20 net-obj-y =3D net.o net-nested-y =3D queue.o checksum.o util.o @@ -116,7 +123,14 @@ net-nested-$(CONFIG_SOLARIS) +=3D tap-solaris.o net-nested-$(CONFIG_AIX) +=3D tap-aix.o net-nested-$(CONFIG_SLIRP) +=3D slirp.o net-nested-$(CONFIG_VDE) +=3D vde.o +ifneq ($(CONFIG_SOLARIS),y) net-obj-y +=3D $(addprefix net/, $(net-nested-y)) +else +net-obj-y +=3D $(addprefix net--, $(net-nested-y)) + +net--%.o: net/%.o + $(call quiet-command,cp $< $@," CP $(TARGET_DIR)$@") +endif =20 ###################################################################### # libqemu_common.a: Target independent part of system emulation. The diff --git a/rules.mak b/rules.mak index 5d9f684..d0e3a2d 100644 --- a/rules.mak +++ b/rules.mak @@ -23,7 +23,11 @@ QEMU_DGFLAGS +=3D -MMD -MP -MT $@ %.o: %.m $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c = -o $@ $<," OBJC $(TARGET_DIR)$@") =20 +ifeq ($(CONFIG_SOLARIS),y) +LINK =3D $(call quiet-command,{ rm -rf .tmpobjs;mkdir .tmpobjs$(foreach = arlib,$(ARLIBS),;(mkdir .tmpobjs/$(notdir $(arlib));cd .tmpobjs/$(notdir = $(arlib)) && ar x ../../$(arlib)));$(CC) $(QEMU_CFLAGS) $(CFLAGS) $(LDFLA= GS) -o $@ $(1) $(foreach arlib,$(ARLIBS),$(foreach obj,$(shell $(AR) t $(= arlib)),.tmpobjs/$(notdir $(arlib))/$(obj))) $(LIBS);}," LINK $(TARGET_= DIR)$@") +else LINK =3D $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(CFLAGS) $(LDFLAGS) = -o $@ $(1) $(ARLIBS_BEGIN) $(ARLIBS) $(ARLIBS_END) $(LIBS)," LINK $(TAR= GET_DIR)$@") +endif =20 %$(EXESUF): %.o $(call LINK,$^) --=20 1.6.5.3