[CRIU] [PATCH] make: fix multithreded compilation

Ruslan Kuprieiev kupruser at gmail.com
Mon Jan 19 07:38:16 PST 2015


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
 
 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)
-- 
2.1.0



More information about the CRIU mailing list