summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/strace/strace/0001-mips-o32-fix-build.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/strace/strace/0001-mips-o32-fix-build.patch')
-rw-r--r--meta/recipes-devtools/strace/strace/0001-mips-o32-fix-build.patch98
1 files changed, 98 insertions, 0 deletions
diff --git a/meta/recipes-devtools/strace/strace/0001-mips-o32-fix-build.patch b/meta/recipes-devtools/strace/strace/0001-mips-o32-fix-build.patch
new file mode 100644
index 0000000000..a5dccfb08c
--- /dev/null
+++ b/meta/recipes-devtools/strace/strace/0001-mips-o32-fix-build.patch
@@ -0,0 +1,98 @@
1From 2c8b6de913973274e877639658e9e7273a012adb Mon Sep 17 00:00:00 2001
2From: "Dmitry V. Levin" <ldv@altlinux.org>
3Date: Tue, 8 Jan 2019 19:23:44 +0000
4Subject: [PATCH] mips o32: fix build
5
6Upstream-Status: Backport
7
8Commit 917c2ccf3a67 "Refactor stack pointers" moved mips_REG_* macros
9from linux/mips/arch_regs.h to linux/mips/arch_regs.c because these
10macros are no longer used outside syscall.c or files included by
11syscall.c, but this caused a build regression on mips o32 because
12decode_syscall_subcall() uses mips_REG_SP prior to its definition.
13
14* syscall.c (decode_syscall_subcall): Move ...
15* linux/mips/get_syscall_args.c: ... here.
16
17Reported-by: Baruch Siach <baruch@tkos.co.il>
18Fixes: v4.26~61 "Refactor stack pointers"
19---
20 linux/mips/get_syscall_args.c | 26 ++++++++++++++++++++++++++
21 syscall.c | 27 ++-------------------------
22 2 files changed, 29 insertions(+), 25 deletions(-)
23
24diff --git a/linux/mips/get_syscall_args.c b/linux/mips/get_syscall_args.c
25index 387aa852..e2889f98 100644
26--- a/linux/mips/get_syscall_args.c
27+++ b/linux/mips/get_syscall_args.c
28@@ -37,3 +37,29 @@ arch_get_syscall_args(struct tcb *tcp)
29 #endif
30 return 1;
31 }
32+
33+#ifdef SYS_syscall_subcall
34+static void
35+decode_syscall_subcall(struct tcb *tcp)
36+{
37+ if (!scno_is_valid(tcp->u_arg[0]))
38+ return;
39+ tcp->scno = tcp->u_arg[0];
40+ tcp->qual_flg = qual_flags(tcp->scno);
41+ tcp->s_ent = &sysent[tcp->scno];
42+ memmove(&tcp->u_arg[0], &tcp->u_arg[1],
43+ sizeof(tcp->u_arg) - sizeof(tcp->u_arg[0]));
44+ /*
45+ * Fetching the last arg of 7-arg syscalls (fadvise64_64
46+ * and sync_file_range) requires additional code,
47+ * see linux/mips/get_syscall_args.c
48+ */
49+ if (tcp->s_ent->nargs == MAX_ARGS) {
50+ if (umoven(tcp,
51+ mips_REG_SP + MAX_ARGS * sizeof(tcp->u_arg[0]),
52+ sizeof(tcp->u_arg[0]),
53+ &tcp->u_arg[MAX_ARGS - 1]) < 0)
54+ tcp->u_arg[MAX_ARGS - 1] = 0;
55+ }
56+}
57+#endif /* SYS_syscall_subcall */
58diff --git a/syscall.c b/syscall.c
59index d78f51dd..51fcc721 100644
60--- a/syscall.c
61+++ b/syscall.c
62@@ -349,31 +349,8 @@ decode_ipc_subcall(struct tcb *tcp)
63 #endif /* SYS_ipc_subcall */
64
65 #ifdef SYS_syscall_subcall
66-static void
67-decode_syscall_subcall(struct tcb *tcp)
68-{
69- if (!scno_is_valid(tcp->u_arg[0]))
70- return;
71- tcp->scno = tcp->u_arg[0];
72- tcp->qual_flg = qual_flags(tcp->scno);
73- tcp->s_ent = &sysent[tcp->scno];
74- memmove(&tcp->u_arg[0], &tcp->u_arg[1],
75- sizeof(tcp->u_arg) - sizeof(tcp->u_arg[0]));
76-# ifdef LINUX_MIPSO32
77- /*
78- * Fetching the last arg of 7-arg syscalls (fadvise64_64
79- * and sync_file_range) requires additional code,
80- * see linux/mips/get_syscall_args.c
81- */
82- if (tcp->s_ent->nargs == MAX_ARGS) {
83- if (umoven(tcp,
84- mips_REG_SP + MAX_ARGS * sizeof(tcp->u_arg[0]),
85- sizeof(tcp->u_arg[0]),
86- &tcp->u_arg[MAX_ARGS - 1]) < 0)
87- tcp->u_arg[MAX_ARGS - 1] = 0;
88- }
89-# endif /* LINUX_MIPSO32 */
90-}
91+/* The implementation is architecture specific. */
92+static void decode_syscall_subcall(struct tcb *);
93 #endif /* SYS_syscall_subcall */
94
95 static void
96--
972.17.0
98