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

Re: [Xen-devel] [PATCH] x86emul: fix test harness and fuzzer build dependencies



Jan Beulich writes ("[PATCH] x86emul: fix test harness and fuzzer build 
dependencies"):
> --- a/tools/fuzz/x86_instruction_emulator/Makefile
> +++ b/tools/fuzz/x86_instruction_emulator/Makefile
...
> +$(XEN_ROOT)/tools/include/xen/lib/x86/cpuid-autogen.h: FORCE
> +     $(MAKE) -C $(XEN_ROOT)/tools/include build

I think this introduces a `make -j' hazard ?  The problem is that this
branch of the Makefiles tree might enter tools/include while
another branch is also doing so, resulting in two simultaneous
executions in the same directory.

As I have written before:

  With recursive make, it is necessary for the overall structure of the
  makefiles to sequence things so that each directory is entered exactly
  once, before its dependent directories are entered.  (It is possible
  to violate this rule without creating races but it is tricky and
  inadvisable.)

>  .PHONY: xen-foreign
>  xen-foreign:
> @@ -27,10 +28,12 @@ ifeq ($(CONFIG_X86),y)
>       for f in $(filter-out %autogen.h,$(patsubst 
> $(XEN_ROOT)/xen/include/xen/lib/x86/%,%,Makefile $(wildcard 
> $(XEN_ROOT)/xen/include/xen/lib/x86/*.h))); do \
>               ln -sf $(XEN_ROOT)/xen/include/xen/lib/x86/$$f xen/lib/x86/$$f; 
> \
>       done
> -     $(MAKE) -C xen/lib/x86 all XEN_ROOT=$(XEN_ROOT)
>  endif
>       touch $@
>  
> +all-$(CONFIG_X86): xen/.dir
> +     $(MAKE) -C xen/lib/x86 all XEN_ROOT=$(XEN_ROOT)

And here we have a pre-existing instance of the same bug, I think ?

With recursive make you can't just
   $(MAKE) -C .../this
   $(MAKE) -C .../that
because of this race problem.  You need to sequence the subdirectories
correctly in the parent Makefiles so that by the time `here' is
entered, its dependency directories are already finished.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.