Commit a3e31595 authored by Dmitry Safonov's avatar Dmitry Safonov Committed by Andrei Vagin

criu/pie: drop second compat parasite

Let's try having one with two entries/exits.

travis-ci: success for Rectify 32-bit compatible C/R on x86
Signed-off-by: 's avatarDmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent 82382bea
...@@ -34,7 +34,7 @@ criu/include/syscall*.h ...@@ -34,7 +34,7 @@ criu/include/syscall*.h
soccr/config.h soccr/config.h
criu/include/version.h criu/include/version.h
criu/pie/restorer-blob.h criu/pie/restorer-blob.h
criu/pie/parasite-*-blob.h criu/pie/parasite-blob.h
criu/pie/pie.lds*.S criu/pie/pie.lds*.S
criu/protobuf-desc-gen.h criu/protobuf-desc-gen.h
lib/build/ lib/build/
......
...@@ -578,12 +578,7 @@ struct parasite_ctl *parasite_infect_seized(pid_t pid, struct pstree_item *item, ...@@ -578,12 +578,7 @@ struct parasite_ctl *parasite_infect_seized(pid_t pid, struct pstree_item *item,
ictx->log_fd = log_get_fd(); ictx->log_fd = log_get_fd();
if (compel_mode_native(ctl)) parasite_setup_c_header(ctl);
parasite_native_setup_c_header(ctl);
#ifdef CONFIG_COMPAT
else
parasite_compat_setup_c_header(ctl);
#endif
parasite_ensure_args_size(dump_pages_args_size(vma_area_list)); parasite_ensure_args_size(dump_pages_args_size(vma_area_list));
parasite_ensure_args_size(aio_rings_args_size(vma_area_list)); parasite_ensure_args_size(aio_rings_args_size(vma_area_list));
......
# native/compat target names are _only_ for parasite target += parasite restorer
# restorer is always native (64-bit)
parasite_target := native
ifeq ($(CONFIG_COMPAT),y) compel_lds := $(SRC_DIR)/compel/arch/$(ARCH)/scripts/compel-pack.lds.S
parasite_target += compat compel_std := $(SRC_DIR)/compel/plugins/std.built-in.o
endif parasite-obj-e += ./compel/plugins/std.built-in.o
restorer-obj-e += ./compel/plugins/std.built-in.o
compel_pack_lds-native := $(SRC_DIR)/compel/arch/$(ARCH)/scripts/compel-pack.lds.S
compel_pack_lds-compat := $(SRC_DIR)/compel/arch/$(ARCH)/scripts/compel-pack-compat.lds.S
compel_std-native := $(SRC_DIR)/compel/plugins/std.built-in.o
compel_std-compat := $(SRC_DIR)/compel/plugins/std-compat.built-in.o
native-obj-y += parasite.o parasite-obj-y += parasite.o
compat-obj-y += compat/parasite-compat.o restorer-obj-y += restorer.o
restorer-obj-y += ./$(ARCH_DIR)/restorer.o
restorer-obj-y += restorer.o
restorer-obj-y += ./$(ARCH_DIR)/restorer.o
ifeq ($(ARCH),x86) ifeq ($(ARCH),x86)
restorer-obj-e += ./compel/plugins/std.built-in.o
ifeq ($(CONFIG_COMPAT),y) ifeq ($(CONFIG_COMPAT),y)
restorer-obj-y += ./$(ARCH_DIR)/call32.o restorer-obj-y += ./$(ARCH_DIR)/call32.o
restorer-obj-y += ./$(ARCH_DIR)/sigaction_compat_pie.o restorer-obj-y += ./$(ARCH_DIR)/sigaction_compat_pie.o
endif endif
native-obj-e += ./compel/plugins/std.built-in.o
compat-obj-e += ./compel/plugins/std-compat.built-in.o
else
native-obj-e += ./compel/plugins/std.built-in.o
restorer-obj-e += ./compel/plugins/std.built-in.o
endif endif
target += $(parasite_target) restorer
# #
# We can't provide proper mount implementation # We can't provide proper mount implementation
# in parasite code -- it requires run-time rellocation # in parasite code -- it requires run-time rellocation
# applications, which is not the target of the # applications, which is not the target of the
# project. # project.
# #
CFLAGS := $(filter-out -pg $(CFLAGS-GCOV),$(CFLAGS)) CFLAGS := $(filter-out -pg $(CFLAGS-GCOV),$(CFLAGS))
CFLAGS := $(filter-out -DCONFIG_X86_64,$(CFLAGS)) CFLAGS += -iquote $(SRC_DIR)/criu/arch/$(ARCH)/include
CFLAGS += -iquote $(SRC_DIR)/criu/arch/$(ARCH)/include CFLAGS += -iquote $(SRC_DIR)/criu/include
CFLAGS += -iquote $(SRC_DIR)/criu/include CFLAGS += -iquote $(SRC_DIR)/include
CFLAGS += -iquote $(SRC_DIR)/include CFLAGS += -iquote $(SRC_DIR)
CFLAGS += -iquote $(SRC_DIR) CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 CFLAGS += -Wp,-U_FORTIFY_SOURCE -Wp,-D_FORTIFY_SOURCE=0
CFLAGS += -Wp,-U_FORTIFY_SOURCE -Wp,-D_FORTIFY_SOURCE=0
ccflags-y += -I compel/include/uapi
ccflags-y += -I compel/plugins/include/uapi
ccflags-y += -DCR_NOGLIBC
ccflags-y += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
ccflags-y += -Wp,-U_FORTIFY_SOURCE -Wp,-D_FORTIFY_SOURCE=0
ccflags-y += -I compel/include/uapi
ccflags-y += -I compel/plugins/include/uapi
ccflags-y += -DCR_NOGLIBC
ccflags-y += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
ifneq ($(filter-out clean mrproper,$(MAKECMDGOALS)),) ifneq ($(filter-out clean mrproper,$(MAKECMDGOALS)),)
NATIVE_CFLAGS := $(shell $(SRC_DIR)/compel/compel-host --arch=$(ARCH) cflags) CFLAGS += $(shell $(SRC_DIR)/compel/compel-host --arch=$(ARCH) cflags)
ifeq ($(ARCH),x86)
COMPAT_CFLAGS := $(shell $(SRC_DIR)/compel/compel-host --arch=ia32 cflags)
endif
endif endif
ifeq ($(ARCH),x86)
NATIVE_CFLAGS += -DCONFIG_X86_64
COMPAT_CFLAGS += -m32 -DCONFIG_X86_32
COMPAT_LDFLAGS += -m elf_i386
endif
CFLAGS_restorer.o += $(NATIVE_CFLAGS)
# $1 - object name
define obj-export-native-flags
CFLAGS_$(notdir $(1)) := $(NATIVE_CFLAGS)
endef
# $1 - object name
define obj-export-compat-flags
CFLAGS_$(notdir $(1)) := $(COMPAT_CFLAGS)
LDFLAGS_$(notdir $(1)) := $(COMPAT_LDFLAGS)
endef
$(eval $(call map,obj-export-native-flags,$(restorer-obj-y)))
$(eval $(call map,obj-export-native-flags,$(native-obj-y) native))
$(eval $(call map,obj-export-compat-flags,$(compat-obj-y) compat))
ifeq ($(SRCARCH),arm) ifeq ($(SRCARCH),arm)
ccflags-y += -marm ccflags-y += -marm
endif endif
asflags-y += -D__ASSEMBLY__ asflags-y += -D__ASSEMBLY__
BLOBS += $(obj)/restorer-blob.h
define gen-pields-blobs-var BLOBS += $(obj)/restorer-blob.h $(obj)/parasite-blob.h
BLOBS += $(obj)/parasite-$(1)-blob.h
endef
$(eval $(call map,gen-pields-blobs-var,$(parasite_target)))
.SECONDARY: .SECONDARY:
# for C files, we need "parasite-native" to be "parasite_native" target-name = $(patsubst criu/pie/%-blob.h,%,$(1))
target-name = $(patsubst criu/pie/%_blob.h,%,$(subst -,_,$(1)))
ifeq ($(strip $(V)),) ifeq ($(strip $(V)),)
piegen_stdout := >/dev/null piegen_stdout := >/dev/null
endif endif
$(obj)/restorer.built-in.o: $(compel_std-native) $(obj)/restorer.built-in.o: $(compel_std)
$(obj)/restorer.built-in.bin.o: $(obj)/restorer.built-in.o \ $(obj)/parasite.built-in.o: $(compel_std)
$(obj)/pie.lib.a $(compel_pack_lds-native) $(obj)/%.built-in.bin.o: $(obj)/%.built-in.o $(obj)/pie.lib.a $(compel_lds)
$(call msg-gen, $@) $(call msg-gen, $@)
$(Q) $(LD) -r -T $(compel_pack_lds-native) -o $@ $< $(obj)/pie.lib.a $(Q) $(LD) -r -T $(compel_lds) -o $@ $< $(obj)/pie.lib.a
# $1 - binary mode: native/compat
define gen-rule-built-in.bin.o
$(obj)/$(1).built-in.o: $(compel_std-$(1))
$(obj)/parasite-$(1).built-in.bin.o: $(obj)/$(1).built-in.o \
$(obj)/pie.lib.a $(compel_pack_lds-$(1))
$$(call msg-gen, $$@)
$(Q) $(LD) -r -T $(compel_pack_lds-$(1)) -o $$@ $$< $(obj)/pie.lib.a
endef
$(eval $(call map,gen-rule-built-in.bin.o,$(parasite_target)))
$(obj)/%-blob.h: $(obj)/%.built-in.bin.o $(SRC_DIR)/compel/compel-host $(obj)/%-blob.h: $(obj)/%.built-in.bin.o $(SRC_DIR)/compel/compel-host
$(call msg-gen, $@) $(call msg-gen, $@)
......
#include "parasite-native-blob.h"
#ifdef CONFIG_COMPAT
# include "parasite-compat-blob.h"
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment