Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NLfVs-0006Ue-2x for qemu-devel@nongnu.org; Fri, 18 Dec 2009 11:17:08 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NLfVm-0006Qu-7s for qemu-devel@nongnu.org; Fri, 18 Dec 2009 11:17:06 -0500 Received: from [199.232.76.173] (port=47703 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NLfVl-0006QV-K0 for qemu-devel@nongnu.org; Fri, 18 Dec 2009 11:17:01 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33979) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NLfVk-0002ro-Ux for qemu-devel@nongnu.org; Fri, 18 Dec 2009 11:17:01 -0500 From: Juan Quintela In-Reply-To: <1261132832-7688-1-git-send-email-pbonzini@redhat.com> (Paolo Bonzini's message of "Fri, 18 Dec 2009 11:40:32 +0100") References: <1261132832-7688-1-git-send-email-pbonzini@redhat.com> Date: Fri, 18 Dec 2009 17:16:04 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: [Qemu-devel] Re: [PATCH] fix tool/libuser makefile race List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org 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. 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? Later, Juan.