qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: [PATCH] fix tool/libuser makefile race


From: Juan Quintela
Subject: [Qemu-devel] Re: [PATCH] fix tool/libuser makefile race
Date: Fri, 18 Dec 2009 17:16:04 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Paolo Bonzini <address@hidden> 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 <address@hidden>
>
> Signed-off-by: Paolo Bonzini <address@hidden>
> ---
>  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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]