[CRIU] [PATCH] aarch64: fix undefined "struct user_regs_struct_t" error

Yixun Lan yixun.lan at gmail.com
Tue Apr 14 10:41:30 PDT 2015


tested under Gentoo Linux, with sys-kernel/linux-headers-3.19 installed
"struct user_pt_regs" is defined at file /usr/include/asm/ptrace.h

Signed-off-by: Yixun Lan <yixun.lan at gmail.com>

---

detail log of the build error:

arch64-unknown-linux-gnu-gcc -c -O2 -pipe  -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -iquote include -iquote pie -iquote . -iquote arch/aarch64 -iquote arch/aarch64/include
-fno-strict-aliasing  -fpie -Wstrict-prototypes -Wa,--noexecstack -nostdlib -fomit-frame-pointer -Iarch/aarch64 -D__ASSEMBLY__  arch/aarch64/syscalls.S -o arch/aarch64/syscalls.o
aarch64-unknown-linux-gnu-ld -r -o arch/aarch64/syscalls.built-in.o arch/aarch64/syscalls.o
In file included from arch/aarch64/crtools.c:14:0:
include/parasite-syscall.h:25:21: error: field 'regs' has incomplete type
  user_regs_struct_t regs;
                     ^
arch/aarch64/crtools.c: In function 'parasite_setup_regs':
arch/aarch64/crtools.c:42:6: error: dereferencing pointer to incomplete type
  regs->pc = new_ip;
      ^
arch/aarch64/crtools.c:44:7: error: dereferencing pointer to incomplete type
   regs->sp = (unsigned long)stack;
       ^
arch/aarch64/crtools.c: In function 'syscall_seized':
arch/aarch64/crtools.c:63:2: error: variable 'regs' has initializer but incomplete type
  user_regs_struct_t regs = ctl->orig.regs;
  ^
arch/aarch64/crtools.c:63:21: error: storage size of 'regs' isn't known
  user_regs_struct_t regs = ctl->orig.regs;
                     ^
arch/aarch64/crtools.c:63:21: warning: unused variable 'regs' [-Wunused-variable]
arch/aarch64/crtools.c: At top level:
arch/aarch64/crtools.c:85:49: error: parameter 2 ('regs') has incomplete type
 int get_task_regs(pid_t pid, user_regs_struct_t regs, CoreEntry *core)
                                                 ^
arch/aarch64/crtools.c: In function 'get_task_regs':
arch/aarch64/crtools.c:88:27: error: storage size of 'fpsimd' isn't known
  struct user_fpsimd_state fpsimd;
                           ^
arch/aarch64/crtools.c:94:23: error: invalid application of 'sizeof' to incomplete type 'user_regs_struct_t'
  iov.iov_len = sizeof(user_regs_struct_t);
                       ^
arch/aarch64/crtools.c:88:27: warning: unused variable 'fpsimd' [-Wunused-variable]
  struct user_fpsimd_state fpsimd;
---
 arch/aarch64/include/asm/types.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/aarch64/include/asm/types.h b/arch/aarch64/include/asm/types.h
index 8dd336e..6657279 100644
--- a/arch/aarch64/include/asm/types.h
+++ b/arch/aarch64/include/asm/types.h
@@ -3,6 +3,7 @@
 
 #include <stdbool.h>
 #include <signal.h>
+#include <asm/ptrace.h>
 #include "protobuf/core.pb-c.h"
 
 #include "asm-generic/page.h"
-- 
2.3.4



More information about the CRIU mailing list