[CRIU] ✗ travis-ci: failure for Add architecture support for s390x (rev2)

Michael Holzheu holzheu at linux.vnet.ibm.com
Fri Jun 30 12:02:01 MSK 2017


Am Fri, 30 Jun 2017 10:04:07 +0300
schrieb Pavel Emelyanov <xemul at virtuozzo.com>:

> On 06/30/2017 01:28 AM, Patchwork wrote:
> > == Series Details ==
> > 
> > Series: Add architecture support for s390x (rev2)
> > URL   : https://patchwork.criu.org/series/1699/
> > State : failure
> > 
> > == Logs ==
> > 
> > For more details see: https://travis-ci.org/criupatchwork/criu/builds/248550894?utm_source=github_status&utm_medium=notification
> 
> Micael, this set somehow broke compilation on other platforms. 
> In particular on aarch64 the error is:
> 
>      GEN      compel/arch/aarch64/plugins/std/syscalls/syscalls.S
>      DEP      compel/arch/aarch64/plugins/std/syscalls/syscalls.d
>    gcc: error: unrecognized command line option '-msoft-float'
> 
> This is likely due to the patch #2:
> 
>    +ifeq ($(filter s390x,$(ARCH)),)
>    +CFLAGS += -msoft-float
>    +HOSTCFLAGS += -msoft-float
>    +endif
> 
> should this rather be ifNeq?

It should be "ifeq ($(ARCH),s390)". We did not see this problem because we only
built and tested on x86.

The following patch fixes the problem:

---
[PATCH] Fix ARCH check for -msoft-float in Makefiles

Signed-off-by: Michael Holzheu <holzheu at linux.vnet.ibm.com>
---
 compel/Makefile         | 2 +-
 compel/plugins/Makefile | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/compel/Makefile b/compel/Makefile
index ebe006d..0bc2324 100644
--- a/compel/Makefile
+++ b/compel/Makefile
@@ -37,7 +37,7 @@ endif
 # We assume that compel code does not change floating point registers.
 # On s390 gcc uses fprs to cache gprs. Therefore disable floating point
 # with -msoft-float.
-ifeq ($(filter s390x,$(ARCH)),)
+ifeq ($(ARCH),s390)
 CFLAGS += -msoft-float
 HOSTCFLAGS += -msoft-float
 endif
diff --git a/compel/plugins/Makefile b/compel/plugins/Makefile
index aa09e20..39251b0 100644
--- a/compel/plugins/Makefile
+++ b/compel/plugins/Makefile
@@ -10,7 +10,7 @@ PLUGIN_ARCH_DIR		:= compel/arch/$(ARCH)/plugins
 # We assume that compel code does not change floating point registers.
 # On s390 gcc uses fprs to cache gprs. Therefore disable floating point
 # with -msoft-float.
-ifeq ($(filter s390x,$(ARCH)),)
+ifeq ($(ARCH), s390)
 CFLAGS += -msoft-float
 endif
 
-- 
1.9.1


> 
> 
> Next, on arm it's:
> 
>      DEP      compel/plugins/std/infect.d
>    In file included from /usr/include/arpa/inet.h:21:0,
>                     from compel/include/uapi/compel/plugins/std/syscall-types.h:9,
>                     from compel/include/uapi/compel/plugins/std/syscall.h:4,
>                     from compel/include/uapi/compel/plugins/std.h:5,
>                     from compel/plugins/std/infect.c:1:
>    /usr/include/features.h:364:25: fatal error: sys/cdefs.h: No such file or directory
>     #  include <sys/cdefs.h>
> 
> This is strange, as this shown an error in a system header, rather than in criu/compel
> ones :\

Hmm, I don't understand this one either.

> 
> 
> On x86 the build has passed, but the very first test run revealed mis-compiled
> ELF parser in compel:
> 
>    ======================== Run zdtm/transition/shmem in h ========================
>    Start test
>    ./shmem --pidfile=shmem.pid --outfile=shmem.out
>    Run criu dump
>    =[log]=> dump/zdtm/transition/shmem/26/1/dump.log
>    ------------------------ grep Error ------------------------
>    (00.091109) Found task size of 7ffffffff000
>    (00.130220) Warn  (criu/net.c:2504): Unable to get a socket network namespace
>    (00.130353) No /proc/self/ns/pid_for_children
>    (00.130461) vdso: Parsing at 7ffe37df6000 7ffe37df8000
>    (00.130469) Error (criu/pie-util-vdso.c:97): vdso: ELF header magic mismatch
> 
> The last line is causing the dump to fail.

Sorry, my bad - this was caused by a last-minute change where I did not
re-test on x86.

The following fixes the problem:
---
[PATCH] Fix big endian byte order checks

Signed-off-by: Michael Holzheu <holzheu at linux.vnet.ibm.com>
---
 criu/pie/util-vdso.c | 2 +-
 criu/sk-netlink.c    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/criu/pie/util-vdso.c b/criu/pie/util-vdso.c
index 4a6138e..6213df9 100644
--- a/criu/pie/util-vdso.c
+++ b/criu/pie/util-vdso.c
@@ -68,7 +68,7 @@ static unsigned long elf_hash(const unsigned char *name)
 	return h;
 }
 
-#ifdef __ORDER_BIG_ENDIAN__
+#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
 #define BORD ELFDATA2MSB /* 0x02 */
 #else
 #define BORD ELFDATA2LSB /* 0x01 */
diff --git a/criu/sk-netlink.c b/criu/sk-netlink.c
index bfa6831..a9d73c5 100644
--- a/criu/sk-netlink.c
+++ b/criu/sk-netlink.c
@@ -107,7 +107,7 @@ static int dump_one_netlink_fd(int lfd, u32 id, const struct fd_parms *p)
 		 * On 64-bit sk->gsize is multiple to 8 bytes (sizeof(long)),
 		 * so remove the last 4 bytes if they are empty.
 		 */
-#ifdef __ORDER_BIG_ENDIAN__
+#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
 		/*
 		 * Big endian swap: Ugly hack for zdtm/static/sk-netlink
 		 *
-- 
1.9.1






More information about the CRIU mailing list