From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:49422) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwV9S-0007Eu-OQ for qemu-devel@nongnu.org; Thu, 25 Aug 2011 04:19:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QwV9R-0006Zl-QU for qemu-devel@nongnu.org; Thu, 25 Aug 2011 04:19:02 -0400 Received: from mtagate7.uk.ibm.com ([194.196.100.167]:42854) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwV9R-0006Zb-J1 for qemu-devel@nongnu.org; Thu, 25 Aug 2011 04:19:01 -0400 Received: from d06nrmr1307.portsmouth.uk.ibm.com (d06nrmr1307.portsmouth.uk.ibm.com [9.149.38.129]) by mtagate7.uk.ibm.com (8.13.1/8.13.1) with ESMTP id p7P8Ixlb006573 for ; Thu, 25 Aug 2011 08:18:59 GMT Received: from d06av07.portsmouth.uk.ibm.com (d06av07.portsmouth.uk.ibm.com [9.149.37.248]) by d06nrmr1307.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p7P8Iwph2224338 for ; Thu, 25 Aug 2011 09:18:58 +0100 Received: from d06av07.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av07.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p7P8Iv1r014693 for ; Thu, 25 Aug 2011 02:18:58 -0600 From: Stefan Hajnoczi Date: Thu, 25 Aug 2011 09:18:52 +0100 Message-Id: <1314260332-10534-1-git-send-email-stefanha@linux.vnet.ibm.com> In-Reply-To: <20110824195317.14304.63305.stgit@ginnungagap.bsc.es> References: <20110824195317.14304.63305.stgit@ginnungagap.bsc.es> Subject: [Qemu-devel] [PATCH] build: sort objects to remove duplicates for link List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?q?Llu=C3=ADs=20Vilanova?= Cc: qemu-devel@nongnu.org, Stefan Hajnoczi Avoid duplicate object files during the link. There are legitimate cases where a link command-line would include duplicate object files because two independent subsystems both depend on common infrastructure. Use GNU make's $(sort) function to remove duplicate object files from the link command-line. Signed-off-by: Stefan Hajnoczi --- Your patch seems fine but we need to avoid duplicate object files during the link phase. Otherwise we run into linker warnings because qemu-timer-common.o is linked multiple times. Please include this patch and resend the two together with this patch as 1/2 and yours as 2/2. rules.mak | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/rules.mak b/rules.mak index 884d421..04a9198 100644 --- a/rules.mak +++ b/rules.mak @@ -31,7 +31,7 @@ endif %.o: %.m $(call quiet-command,$(CC) $(QEMU_INCLUDES) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," OBJC $(TARGET_DIR)$@") -LINK = $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $(1) $(LIBS)," LINK $(TARGET_DIR)$@") +LINK = $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $(sort $(1)) $(LIBS)," LINK $(TARGET_DIR)$@") %$(EXESUF): %.o $(call LINK,$^) -- 1.7.5.4