Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NLi3z-0002Vz-Ez for qemu-devel@nongnu.org; Fri, 18 Dec 2009 14:00:31 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NLi3u-0002Pu-9P for qemu-devel@nongnu.org; Fri, 18 Dec 2009 14:00:30 -0500 Received: from [199.232.76.173] (port=47208 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NLi3t-0002PZ-UY for qemu-devel@nongnu.org; Fri, 18 Dec 2009 14:00:25 -0500 Received: from fmmailgate02.web.de ([217.72.192.227]:40917) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NLi3s-0002aM-Vt for qemu-devel@nongnu.org; Fri, 18 Dec 2009 14:00:25 -0500 Message-Id: <354EB756-80DD-47C4-9D7D-683A2E34B042@web.de> From: =?ISO-8859-1?Q?Andreas_F=E4rber?= In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: [Qemu-devel] Re: [PATCH] fix tool/libuser makefile race Date: Fri, 18 Dec 2009 19:59:59 +0100 References: <1261132832-7688-1-git-send-email-pbonzini@redhat.com> Sender: andreas.faerber@web.de List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: Paolo Bonzini , qemu-devel@nongnu.org Hey, Am 18.12.2009 um 17:16 schrieb Juan Quintela: > Paolo Bonzini wrote: >> I just had this race happen on me while building qemu. The >> problematic >> file in my case was cutils.o. I'm using GNU make's order-only >> dependencies to avoid that "make recurse-all" builds the tools as >> well. >> >> Signed-off-by: Paolo Bonzini >> >> Signed-off-by: Paolo Bonzini >> --- >> Makefile | 5 ++++- >> 1 files changed, 4 insertions(+), 1 deletions(-) >> >> diff --git a/Makefile b/Makefile >> index d555bb2..373a861 100644 >> --- a/Makefile >> +++ b/Makefile >> @@ -79,7 +79,10 @@ romsubdir-%: >> >> ALL_SUBDIRS=$(TARGET_DIRS) $(patsubst %,pc-bios/%, $(ROMS)) >> >> -recurse-all: $(SUBDIR_RULES) $(ROMSUBDIR_RULES) >> +# Some files are shared between the tools and the emulators. So >> there >> +# can be a race when the main makefile starts building xyz.o, while >> +# the recursive make sees a partially built xyz.o and ar(1) fails. >> +recurse-all: $(SUBDIR_RULES) $(ROMSUBDIR_RULES) | $(TOOLS) >> >> ####################################################################### >> # QObject > > I still don't understand why that is needed :( (make mysteries). > > All shared stuff between $(TOOLS) and $(SUBDIR_RULES) are made from > the > same Makefile invocation. I don't see where the recursive make can > build a file that is also built by the normal Makefile. Think of my porposed Makefile patch! > And if we have one file that is build in both places, that is the bug > that we have to fix. > > Notice that cutils.o (from Makefile) is built in the root dir, and > cutils.o (from Makefile.user) is built into libuser/ directory. > > I am confused how one can interfer with the other. > > VPATH vs vpath problems? libuser builds some .o files from .c files in $(SRC_PATH). They end up in libuser. For those that were built already in .., the .o files are taken from there instead. Andreas > > Later, Juan. > >