[CRIU] About BE support

Adrian Reber adrian at lisas.de
Thu Jul 19 09:35:48 MSK 2018


On Thu, Jul 19, 2018 at 06:25:26AM +0000, Lei, Maohui wrote:
> > CRIU supports s390x which is big endian only. Have a look at that
> > architecture inside CRIU.
> 
> Thank you for your reply. Is s390 can be build by cross-compile? I mean, can it be compiled criu for s390 on an x86-64 host?

No idea if it can be cross-compiled. I only used it natively.

If you look at CRIU's travis setup you can see, that it is compiled for
s390x every time using QEMU. Maybe that would help you:

https://travis-ci.org/checkpoint-restore/criu/jobs/405653898

> Because I debugged part of source code of criu, and I found that the common function __handle_elf(void *mem, size_t size) doesn't support BE.
> I tried to compile criu for a arm-32BE target by cross compile, this common function will output error message as follows. The reason is that there is no endian check of "mem" and handle when read data from this address. So even for s390, I think the same error also exists.
> 
> -------------------------------------
> | Error (compel/src/lib/handle-elf-host.c:165): Unsupported header detected
> | Header
> | ------------
> |       type 0x200 machine 0x2800 version 0x1000000
> | criu/pie/Makefile:50: recipe for target 'criu/pie/restorer-blob.h' failed
> | make[2]: *** [criu/pie/restorer-blob.h] Error 255
> | make[2]: *** Waiting for unfinished jobs....
> | Error (compel/src/lib/handle-elf-host.c:165): Unsupported header detected
> | Header
> | ------------
> |       type 0x200 machine 0x2800 version 0x1000000
> | criu/pie/Makefile:50: recipe for target 'criu/pie/parasite-blob.h' failed
> | make[2]: *** [criu/pie/parasite-blob.h] Error 255
> -------------------------------------

I did not look at it but I assume cross compilation is not happening
that often, especially for s390x. So it could be that there are bugs in
the endianess detection and setting if cross compiling.

		Adrian


More information about the CRIU mailing list