[CRIU] [PATCH] build: Fix criu depdendent parts linking

Cyrill Gorcunov gorcunov at openvz.org
Wed Feb 24 09:25:31 PST 2016


When link criu we make sure that all underlied
systems are up to day: images, syscalls, pie
part. Thus provide own targets for them and
link on a final pass.

This should fix the problem when some file
in images|syscalls|pie are changed but criu
itself is not rebuilt and relinked.

NB: Need to revisit the config/version/feature-test
generations too.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---

Guys give it a good test please. I'm mostly interested
the project the properly rebuild if any source file
is changed.

This is on top of [PATCH] build: criu -- Drop redundant phonies

 criu/Makefile | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/criu/Makefile b/criu/Makefile
index ea79183f0d3a..9d8bbde3d4b4 100644
--- a/criu/Makefile
+++ b/criu/Makefile
@@ -100,14 +100,16 @@ config: $(VERSION_HEADER)
 #
 # System calls library.
 SYSCALL-LIB		:= $(ARCH_DIR)/syscalls.built-in.o
-$(SYSCALL-LIB): config
+syscalls_lib: config
 	$(Q) $(MAKE) $(call build-as,Makefile.syscalls,$(ARCH_DIR)) all
+.PHONY: syscalls_lib
 
 #
 # Architecture dependant part.
 ARCH-LIB		:= $(ARCH_DIR)/crtools.built-in.o
-$(ARCH-LIB): config $(SYSCALL-LIB)
-	$(Q) $(MAKE) $(call build-as,Makefile,$(ARCH_DIR)) $@
+arch_lib: config syscalls_lib
+	$(Q) $(MAKE) $(call build-as,Makefile,$(ARCH_DIR)) all
+.PHONY: arch_lib
 
 #
 # piegen tool needed for PIE code.
@@ -123,7 +125,7 @@ endif
 
 #
 # PIE library code.
-pie/lib.a: $(ARCH-LIB) $(SYSCALL-LIB)
+pie/lib.a: arch_lib syscalls_lib
 	$(Q) $(MAKE) $(call build-as,Makefile.library,pie) all
 
 #
@@ -138,8 +140,7 @@ PROGRAM-BUILTINS	+= ../images/built-in.o
 PROGRAM-BUILTINS	+= built-in.o
 PROGRAM-BUILTINS	+= pie/lib.a
 PROGRAM-BUILTINS	+= $(SYSCALL-LIB)
-
-LIBS			+= arch/$(ARCH)/crtools.built-in.o
+PROGRAM-BUILTINS	+= $(ARCH-LIB)
 
 built-in.o: pie
 	$(Q) $(MAKE) $(call build-as,Makefile.crtools,.) all
-- 
2.5.0



More information about the CRIU mailing list