[CRIU] [PATCH 2/2] x86: ia32 -- Add needed bits to be compilable for x86-32

Pavel Emelyanov xemul at parallels.com
Tue Apr 14 06:55:57 PDT 2015


Would you split the patch, please? Suggestions are inline

> diff --git a/Makefile b/Makefile
> index 6e6efb290823..71398f73494a 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -51,6 +51,8 @@ ifeq ($(ARCH),i386)
>  	SRCARCH      := x86-32
>  	DEFINES      := -DCONFIG_X86_32
>  	VDSO         := y
> +	PROTOUFIX    := y
> +	export PROTOUFIX

Introduction of PROTOUFIX

>  endif
>  ifeq ($(ARCH),x86_64)
>  	SRCARCH      := x86
> @@ -58,6 +60,16 @@ ifeq ($(ARCH),x86_64)
>  	LDARCH       := i386:x86-64
>  	VDSO         := y
>  endif
> +ifeq ($(ARCH),ia32)
> +	SRCARCH      := x86
> +	DEFINES      := -DCONFIG_X86_32
> +	LDARCH       := i386
> +	ldflags-y    += -m elf_i386
> +	VDSO         := y
> +	USERCFLAGS   += -m32
> +	PROTOUFIX    := y
> +	export PROTOUFIX ldflags-y
> +endif
>  
>  ifeq ($(shell echo $(ARCH) | sed -e 's/arm.*/arm/'),arm)
>  	ARMV         := $(shell echo $(ARCH) | sed -nr 's/armv([[:digit:]]).*/\1/p; t; i7')
> @@ -78,6 +90,11 @@ ifeq ($(ARCH),aarch64)
>  	VDSO         := y
>  endif
>  
> +ifeq ($(SRCARCH),arm)
> +	PROTOUFIX    := y
> +	export PROTOUFIX
> +endif
> +
>  SRCARCH		?= $(ARCH)
>  LDARCH		?= $(SRCARCH)
>  
> @@ -197,7 +214,7 @@ $(SYSCALL-LIB) $(ARCH-LIB) $(PROGRAM-BUILTINS): config
>  
>  $(PROGRAM): $(SYSCALL-LIB) $(ARCH-LIB) $(PROGRAM-BUILTINS)
>  	$(E) "  LINK    " $@
> -	$(Q) $(CC) $(CFLAGS) $^ $(LIBS) $(LDFLAGS) $(GMONLDOPT) -rdynamic -o $@
> +	$(Q) $(CC) $(CFLAGS) $^ $(LIBS) $(GMONLDOPT) -rdynamic -o $@

Moving LDFLAGS from here to somewhere else.

>  
>  crit:
>  	$(Q) $(MAKE) -C pycriu all
> diff --git a/arch/x86/Makefile b/arch/x86/Makefile
> index 6f7eb132168d..35ad6d2db836 100644
> --- a/arch/x86/Makefile
> +++ b/arch/x86/Makefile
> @@ -29,7 +29,7 @@ syscalls-asm-y-asmflags	:= -Wstrict-prototypes -Wa,--noexecstack
>  endif
>  syscalls-asm-y-asmflags += -nostdlib -fomit-frame-pointer -I$(obj)
>  
> -ifeq ($(ARCH),i386)
> +ifneq ($(filter i386 ia32,$(ARCH)),)
>  syscalls-obj-y += syscalls/syscall32.o
>  $(obj)/syscalls/syscall32.o: $(obj)/$(SYS-CODES) $(obj)/$(SYS-PROTO)
>  endif
> diff --git a/arch/x86/crtools.c b/arch/x86/crtools.c
> index 02ce2e5bc2ce..f5bc371206c6 100644
> --- a/arch/x86/crtools.c
> +++ b/arch/x86/crtools.c
> @@ -361,9 +361,9 @@ static void show_rt_xsave_frame(struct xsave_struct *x)
>  		 (int)i387->fop, (int)i387->mxcsr, (int)i387->mxcsr_mask);
>  
>  	pr_debug("magic1:%x extended_size:%x xstate_bv:%lx xstate_size:%x\n",
> -		 fpx->magic1, fpx->extended_size, fpx->xstate_bv, fpx->xstate_size);
> +		 fpx->magic1, fpx->extended_size, (long)fpx->xstate_bv, fpx->xstate_size);

Type-casts (but better to use the PRIx64 formatting).

>  
> -	pr_debug("xstate_bv: %lx\n", xsave_hdr->xstate_bv);
> +	pr_debug("xstate_bv: %lx\n", (long)xsave_hdr->xstate_bv);
>  
>  	pr_debug("-----------------------\n");
>  }

-- Pavel



More information about the CRIU mailing list