[CRIU] [PATCH] make: fix multithreded compilation

Pavel Emelyanov xemul at parallels.com
Tue Jan 20 05:53:15 PST 2015


On 01/19/2015 06:38 PM, Ruslan Kuprieiev wrote:
> Currently we run into lots of race conditions when building in
> multithreded mode.
> 
> Reported-by: Mr Jenkins
> Signed-off-by: Ruslan Kuprieiev <kupruser at gmail.com>
> ---
>  Makefile          | 4 +++-
>  protobuf/Makefile | 2 +-
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 39433fc..a896e33 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -148,7 +148,9 @@ ifeq ($(GCOV),1)
>  %.o $(PROGRAM): override CFLAGS += --coverage
>  endif
>  
> -all: config pie $(VERSION_HEADER) $(CRIU-LIB) $(PROGRAM) crit
> +all: config pie $(VERSION_HEADER) $(CRIU-LIB)
> +	$(Q) $(MAKE) $(PROGRAM)
> +	$(Q) $(MAKE) crit

Is this change really needed? AFAIU the problem is that some .proto
files depend on opts.proto and in case the former gets compiled
before the latter we're in trouble. And it doesn't (shouldn't) matter
whether we compile criu or crit first.

Cyrill?

>  
>  protobuf/%::
>  	$(Q) $(MAKE) $(build)=protobuf $@
> diff --git a/protobuf/Makefile b/protobuf/Makefile
> index 0c3196b..9c7a0bb 100644
> --- a/protobuf/Makefile
> +++ b/protobuf/Makefile
> @@ -89,7 +89,7 @@ $(obj)/%.proto.c.d: $(obj)/%.proto | $(obj)/%.proto.d
>  		-e 's/.*/$(subst .proto,.pb-c.c,$(subst /,\/,$<)):$(subst /,\/,$(obj))\/&/'	| \
>  		uniq > $@
>  
> -$(obj)/%.pb-c.c $(obj)/%.pb-c.h: $(obj)/%.proto $(obj)/%.proto.c.d
> +$(obj)/%.pb-c.c $(obj)/%.pb-c.h: $(obj)/%.proto $(obj)/%.proto.c.d $(obj)/opts.pb-c.c
>  	$(E) "  PBCC    " $@
>  	$(Q) protoc-c --proto_path=$(obj)/ --c_out=$(obj)/ $<
>  ifeq ($(SRCARCH),arm)
> 



More information about the CRIU mailing list