[CRIU] [PATCH 0/2] Fix compilation on ARM

Cyrill Gorcunov gorcunov at openvz.org
Thu Dec 3 09:24:14 PST 2015


When we run cr-check we assume that the kernel headers may be old
and don't have all predefined constants needed. So we use our syscalls
library for that.

But since commit 5e2ca506e4b02f12c74cc36b8c49711899a2b436 we also
need to check __NR_ptrace which is missing in our syscalls so
sysem wide <sys/syscalls.h> has been included. And this cause
problem on ARM:

 | In file included from include/syscall.h:5:0,
 |                  from cr-check.c:27:
 | include/syscall-codes.h:4:0: error: "__NR_read" redefined [-Werror]
 |  #define __NR_read 3
 |  ^
 | In file included from /usr/include/arm-linux-gnueabihf/sys/syscall.h:24:0,
 |                  from cr-check.c:17:
 | /usr/include/arm-linux-gnueabihf/asm/unistd.h:31:0: note: this is the location of the previous definition
 |  #define __NR_read   (__NR_SYSCALL_BASE+  3)

Thus define own __NR_ptrace in syscalls and drop system header.


=== NOTE ===

	I need some help in defining this proto for othen than x86
	syscalls table. Please guys add ones.

Cyrill Gorcunov (2):
  arch: x86 -- Add sys_ptrace declaration
  cr-check: Don't include sys/syscalls.h

 arch/x86/syscalls/syscall_32.tbl | 1 +
 arch/x86/syscalls/syscall_64.tbl | 1 +
 cr-check.c                       | 1 -
 3 files changed, 2 insertions(+), 1 deletion(-)

-- 
2.5.0



More information about the CRIU mailing list