mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 14:25:49 +00:00
Build pie objects separately
This patch change the build chain to not use pie objects in the crtools executable. This done by building the shared source files twice: 1. for parasite/restorer as '<file>-pie-build.o' 2. for crtools as '<file>.o' Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com> Reviewed-by: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
committed by
Pavel Emelyanov
parent
61859d1176
commit
2f481f02fc
@@ -57,6 +57,11 @@ obj-y::
|
|||||||
Source code C file. Typically refered as *obj-y += 'some-file.o'*.
|
Source code C file. Typically refered as *obj-y += 'some-file.o'*.
|
||||||
This implies you have real 'some-file.c' in '$(obj)' directory.
|
This implies you have real 'some-file.c' in '$(obj)' directory.
|
||||||
|
|
||||||
|
obj-x::
|
||||||
|
Same as 'obj-y' but the output files have the suffix $(xsuffix).
|
||||||
|
This is used when building shared source file for both pie and crtools
|
||||||
|
The posfix '-x' came from word 'extra'.
|
||||||
|
|
||||||
obj-e::
|
obj-e::
|
||||||
Same as 'obj-y' but implies that source code file lays in directory
|
Same as 'obj-y' but implies that source code file lays in directory
|
||||||
other than '$(obj)'. The postfix '-e' came from word 'external'.
|
other than '$(obj)'. The postfix '-e' came from word 'external'.
|
||||||
|
8
Makefile
8
Makefile
@@ -225,8 +225,6 @@ $(piegen): pie/piegen/built-in.o
|
|||||||
.PHONY: pie/piegen
|
.PHONY: pie/piegen
|
||||||
endif
|
endif
|
||||||
|
|
||||||
pie/%:: $(ARCH_DIR) $(piegen)
|
|
||||||
$(Q) $(MAKE) $(build)=pie $@
|
|
||||||
pie: $(ARCH_DIR) $(piegen)
|
pie: $(ARCH_DIR) $(piegen)
|
||||||
$(Q) $(MAKE) $(build)=pie all
|
$(Q) $(MAKE) $(build)=pie all
|
||||||
|
|
||||||
@@ -240,12 +238,6 @@ lib/%:: $(VERSION_HEADER) config built-in.o
|
|||||||
lib: $(VERSION_HEADER) config built-in.o
|
lib: $(VERSION_HEADER) config built-in.o
|
||||||
$(Q) $(MAKE) $(build)=lib all
|
$(Q) $(MAKE) $(build)=lib all
|
||||||
|
|
||||||
ifeq ($(VDSO),y)
|
|
||||||
PROGRAM-BUILTINS += pie/util-vdso.o
|
|
||||||
endif
|
|
||||||
|
|
||||||
PROGRAM-BUILTINS += pie/util-fd.o
|
|
||||||
PROGRAM-BUILTINS += pie/util.o
|
|
||||||
PROGRAM-BUILTINS += protobuf/built-in.o
|
PROGRAM-BUILTINS += protobuf/built-in.o
|
||||||
PROGRAM-BUILTINS += built-in.o
|
PROGRAM-BUILTINS += built-in.o
|
||||||
|
|
||||||
|
@@ -67,6 +67,7 @@ obj-y += sigframe.o
|
|||||||
obj-y += lsm.o
|
obj-y += lsm.o
|
||||||
ifeq ($(VDSO),y)
|
ifeq ($(VDSO),y)
|
||||||
obj-y += vdso.o
|
obj-y += vdso.o
|
||||||
|
obj-y += pie/util-vdso.o
|
||||||
endif
|
endif
|
||||||
obj-y += cr-service.o
|
obj-y += cr-service.o
|
||||||
obj-y += sd-daemon.o
|
obj-y += sd-daemon.o
|
||||||
@@ -74,6 +75,8 @@ obj-y += plugin.o
|
|||||||
obj-y += cr-errno.o
|
obj-y += cr-errno.o
|
||||||
obj-y += pie/pie-relocs.o
|
obj-y += pie/pie-relocs.o
|
||||||
obj-y += seize.o
|
obj-y += seize.o
|
||||||
|
obj-y += pie/util-fd.o
|
||||||
|
obj-y += pie/util.o
|
||||||
|
|
||||||
ifneq ($(MAKECMDGOALS),clean)
|
ifneq ($(MAKECMDGOALS),clean)
|
||||||
incdeps := y
|
incdeps := y
|
||||||
|
@@ -1,12 +1,15 @@
|
|||||||
targets += parasite
|
targets += parasite
|
||||||
targets += restorer
|
targets += restorer
|
||||||
|
|
||||||
|
# used by obj-x to identify shared files built for parasite/restorer binaries
|
||||||
|
xsuffix := -pie-build
|
||||||
|
|
||||||
obj-y += log-simple.o
|
obj-y += log-simple.o
|
||||||
obj-y += util.o
|
obj-x += util.o
|
||||||
obj-y += util-fd.o
|
obj-x += util-fd.o
|
||||||
|
|
||||||
ifeq ($(VDSO),y)
|
ifeq ($(VDSO),y)
|
||||||
obj-y += util-vdso.o
|
obj-x += util-vdso.o
|
||||||
obj-y += parasite-vdso.o
|
obj-y += parasite-vdso.o
|
||||||
obj-e += $(ARCH_DIR)/vdso-pie.o
|
obj-e += $(ARCH_DIR)/vdso-pie.o
|
||||||
ifeq ($(SRCARCH),aarch64)
|
ifeq ($(SRCARCH),aarch64)
|
||||||
|
@@ -64,6 +64,18 @@ all-objs += $(obj-y)
|
|||||||
deps += $(obj-y:.o=.d)
|
deps += $(obj-y:.o=.d)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifneq ($(obj-x),)
|
||||||
|
obj-x := $(addprefix $(obj)/, $(obj-x))
|
||||||
|
obj-x := $(addsuffix $(xsuffix).o, $(obj-x:.o=))
|
||||||
|
$(foreach file, \
|
||||||
|
$(obj-x), \
|
||||||
|
$(eval \
|
||||||
|
$(call gen-target-c-bundle, \
|
||||||
|
$(file:$(xsuffix).o=),$(file:.o=))))
|
||||||
|
all-objs += $(obj-x)
|
||||||
|
deps += $(obj-x:.o=.d)
|
||||||
|
endif
|
||||||
|
|
||||||
ifneq ($(obj-e),)
|
ifneq ($(obj-e),)
|
||||||
$(foreach file, \
|
$(foreach file, \
|
||||||
$(obj-e), \
|
$(obj-e), \
|
||||||
|
Reference in New Issue
Block a user