[CRIU] [PATCH 08/15] criu/pie: generate native.lib.a

Dmitry Safonov dsafonov at virtuozzo.com
Mon Apr 11 05:19:22 PDT 2016


First pie library to use for compiling native pie.

Signed-off-by: Dmitry Safonov <dsafonov at virtuozzo.com>
---
 criu/Makefile             |  6 +++---
 criu/pie/Makefile         |  4 ++--
 criu/pie/Makefile.library | 24 +++++++++++++-----------
 3 files changed, 18 insertions(+), 16 deletions(-)

diff --git a/criu/Makefile b/criu/Makefile
index 7c68f801252e..9d61aa9ad6a2 100644
--- a/criu/Makefile
+++ b/criu/Makefile
@@ -150,12 +150,12 @@ arch_lib: syscalls_lib
 
 #
 # PIE library code.
-pie/lib.a: arch_lib
+pie/native.lib.a: arch_lib
 	$(Q) $(MAKE) $(call build-as,Makefile.library,pie) all
 
 #
 # PIE code blobs themseves.
-pie: pie/lib.a
+pie: pie/native.lib.a
 	$(Q) $(MAKE) $(build)=pie all
 .PHONY: pie
 
@@ -163,7 +163,7 @@ pie: pie/lib.a
 # CRIU executable
 PROGRAM-BUILTINS	+= ../images/built-in.o
 PROGRAM-BUILTINS	+= built-in.o
-PROGRAM-BUILTINS	+= pie/lib.a
+PROGRAM-BUILTINS	+= pie/native.lib.a
 
 built-in.o: pie
 	$(Q) $(MAKE) $(call build-as,Makefile.crtools,.) all
diff --git a/criu/pie/Makefile b/criu/pie/Makefile
index 41997e276690..0bd03900424a 100644
--- a/criu/pie/Makefile
+++ b/criu/pie/Makefile
@@ -71,9 +71,9 @@ ifeq ($(strip $(V)),)
         piegen_stdout := >/dev/null
 endif
 
-$(obj)/%.built-in.bin.o: $(obj)/%.built-in.o $(obj)/lib.a $(obj)/$(PIELDS)
+$(obj)/%.built-in.bin.o: $(obj)/%.built-in.o $(obj)/native.lib.a $(obj)/$(PIELDS)
 	$(call msg-gen, $@)
-	$(Q) $(LD) -r -T $(obj)/$(PIELDS) -o $@ $< $(obj)/lib.a
+	$(Q) $(LD) -r -T $(obj)/$(PIELDS) -o $@ $< $(obj)/native.lib.a
 
 $(obj)/%-blob.h: $(obj)/%.built-in.bin.o $(obj)/$(PIELDS) $(SRC_DIR)/compel/compel
 	$(call msg-gen, $@)
diff --git a/criu/pie/Makefile.library b/criu/pie/Makefile.library
index e1a6acccf3b8..947bcb5f6df0 100644
--- a/criu/pie/Makefile.library
+++ b/criu/pie/Makefile.library
@@ -1,25 +1,27 @@
-lib-y			+= log-simple.o
-lib-y			+= util-fd.o
-lib-y			+= util.o
+target				:= native
+
+$(target)-lib-uniq		+= log-simple.o
+$(target)-lib-uniq		+= util-fd.o
+$(target)-lib-uniq		+= util.o
 
 ifeq ($(VDSO),y)
-        lib-y		+= util-vdso.o
-        lib-y		+= parasite-vdso.o
-        lib-y		+= ./$(ARCH_DIR)/vdso-pie.o
+        $(target)-lib-uniq	+= util-vdso.o
+        $(target)-lib-uniq	+= parasite-vdso.o
+        $(target)-lib-uniq	+= ./$(ARCH_DIR)/vdso-pie.o
 
         ifeq ($(SRCARCH),aarch64)
-                lib-y	+= ./$(ARCH_DIR)/intraprocedure.o
+                $(target)-lib-y	+= ./$(ARCH_DIR)/intraprocedure.o
         endif
 
         ifeq ($(SRCARCH),ppc64)
-                lib-y	+= ./$(ARCH_DIR)/vdso-trampoline.o
+                $(target)-lib-y	+= ./$(ARCH_DIR)/vdso-trampoline.o
         endif
 endif
 
 ifeq ($(SRCARCH),ppc64)
-        lib-y		+= ./$(ARCH_DIR)/memcpy_power7.o
-        lib-y		+= ./$(ARCH_DIR)/memcmp_64.o
-        lib-y		+= ./$(ARCH_DIR)/misc.o
+        $(target)-lib-y	+= ./$(ARCH_DIR)/memcpy_power7.o
+        $(target)-lib-y	+= ./$(ARCH_DIR)/memcmp_64.o
+        $(target)-lib-y	+= ./$(ARCH_DIR)/misc.o
 endif
 
 #
-- 
2.8.0



More information about the CRIU mailing list