[CRIU] [PATCH] ZDTM build fixes
Christopher Covington
cov at codeaurora.org
Thu Jul 10 14:44:51 PDT 2014
Errors building natively for x86_64 on Ubuntu 12.04:
session02.c:142:13: error: ‘PR_SET_CHILD_SUBREAPER’ undeclared
session03.c:175:13: error: ‘PR_SET_CHILD_SUBREAPER’ undeclared
vdso01.c:300: undefined reference to `clock_gettime'
Error cross compiling for arm using Linaro 14.01 toolchain:
gcc: warning: ‘-mcpu=’ is deprecated; use ‘-mtune=’ or ‘-march=’ instead
cc1: error: unrecognized command line option ‘-mfpu=neon’
cc1: error: unrecognized command line option ‘-marm’
criu-rtc.c:1:0: error: bad value (cortex-a15) for -mtune= switch
cc1: error: unrecognized command line option ‘-mfpu=neon’
cc1: error: unrecognized command line option ‘-marm’
criu-rtc.pb-c.c:1:0: error: bad value (cortex-a15) for -mtune= switch
Errors cross compiling for aarch64 using Linaro 14.01 toolchain:
maps007.c: In function ‘main’:
maps007.c:88:4: error: passing argument 1 of ‘atomic_read’ from incompatible pointer type [-Werror]
if (futex_get(&shm->stop) && atomic_get(&shm->delta) == MAX_DELTA)
^
In file included from ../../lib/lock.h:10:0,
from maps007.c:13:
../../lib/arch/aarch64/include/asm/atomic.h:14:19: note: expected ‘const atomic_t *’ but argument is of type ‘struct f
utex_t *’
static inline int atomic_read(const atomic_t *v)
^
ptrace.c: In function ‘main’:
ptrace.c:97:15: error: ‘PTRACE_GETREGS’ undeclared (first use in this function)
if (ptrace(PTRACE_GETREGS, stopped, NULL, regs)) {
^
Signed-off-by: Christopher Covington <cov at codeaurora.org>
---
test/zdtm/lib/zdtmtst.h | 4 ++++
test/zdtm/live/static/Makefile | 3 ++-
test/zdtm/live/transition/maps007.c | 2 +-
test/zdtm/live/transition/ptrace.c | 2 +-
4 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/test/zdtm/lib/zdtmtst.h b/test/zdtm/lib/zdtmtst.h
index e465e26..18eb082 100644
--- a/test/zdtm/lib/zdtmtst.h
+++ b/test/zdtm/lib/zdtmtst.h
@@ -7,6 +7,10 @@
# define PAGE_SIZE 4096
#endif
+#ifndef PR_SET_CHILD_SUBREAPER
+# define PR_SET_CHILD_SUBREAPER 36
+#endif
+
/* set up test */
extern void test_ext_init(int argc, char **argv);
extern void test_init(int argc, char **argv);
diff --git a/test/zdtm/live/static/Makefile b/test/zdtm/live/static/Makefile
index 34982bc..37e6edb 100644
--- a/test/zdtm/live/static/Makefile
+++ b/test/zdtm/live/static/Makefile
@@ -276,6 +276,7 @@ socket-tcpbuf6: override CFLAGS += -D ZDTM_IPV6
socket-tcpbuf-local: override CFLAGS += -D ZDTM_TCP_LOCAL
socket_listen6: override CFLAGS += -D ZDTM_IPV6
sigpending: override LDLIBS += -lrt
+vdso01: override LDLIBS += -lrt
$(LIB): force
$(Q) $(MAKE) -C $(LIBDIR)
@@ -300,7 +301,7 @@ criu-rtc.pb-c.c: criu-rtc.proto
protoc-c --proto_path=. --c_out=. criu-rtc.proto
criu-rtc.so: criu-rtc.c criu-rtc.pb-c.c
- gcc -g -Wall -shared -nostartfiles criu-rtc.c criu-rtc.pb-c.c -o criu-rtc.so -iquote ../../../../include -fPIC $(USERCFLAGS)
+ $(CC) -g -Wall -shared -nostartfiles criu-rtc.c criu-rtc.pb-c.c -o criu-rtc.so -iquote ../../../../include -fPIC $(USERCFLAGS)
.PHONY: force clean cleandep cleanout realclean start check_start stop wait_stop
diff --git a/test/zdtm/live/transition/maps007.c b/test/zdtm/live/transition/maps007.c
index 75164ee..a5788c3 100644
--- a/test/zdtm/live/transition/maps007.c
+++ b/test/zdtm/live/transition/maps007.c
@@ -85,7 +85,7 @@ int main(int argc, char **argv)
if (!futex_get(&shm->stop))
futex_wait_while_lt(&shm->delta, MAX_DELTA);
- if (futex_get(&shm->stop) && atomic_get(&shm->delta) == MAX_DELTA)
+ if (futex_get(&shm->stop) && atomic_get(&shm->delta.raw) == MAX_DELTA)
break;
futex_dec_and_wake(&shm->delta);
}
diff --git a/test/zdtm/live/transition/ptrace.c b/test/zdtm/live/transition/ptrace.c
index 51d15df..2c04997 100644
--- a/test/zdtm/live/transition/ptrace.c
+++ b/test/zdtm/live/transition/ptrace.c
@@ -94,7 +94,7 @@ out_th:
}
if (WIFSTOPPED(status)) {
- if (ptrace(PTRACE_GETREGS, stopped, NULL, regs)) {
+ if (ptrace(PTRACE_GETSIGINFO, stopped, NULL, regs)) {
/* FAIL */
fail("Ptrace won't work");
break;
--
Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by the Linux Foundation.
More information about the CRIU
mailing list