]> granicus.if.org Git - strace/commitdiff
mips o32: fix build
authorDmitry V. Levin <ldv@altlinux.org>
Tue, 8 Jan 2019 19:23:44 +0000 (19:23 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 8 Jan 2019 02:27:18 +0000 (02:27 +0000)
Commit 917c2ccf3a67 "Refactor stack pointers" moved mips_REG_* macros
from linux/mips/arch_regs.h to linux/mips/arch_regs.c because these
macros are no longer used outside syscall.c or files included by
syscall.c, but this caused a build regression on mips o32 because
decode_syscall_subcall() uses mips_REG_SP prior to its definition.

* syscall.c (decode_syscall_subcall): Move ...
* linux/mips/get_syscall_args.c: ... here.
* NEWS: Mention this fix.

Reported-by: Baruch Siach <baruch@tkos.co.il>
Fixes: v4.26~61 "Refactor stack pointers"
NEWS
linux/mips/get_syscall_args.c
syscall.c

diff --git a/NEWS b/NEWS
index 8df5926f69338a9631a67abd0cedf713b483d530..2e813840c659f8af0914e87308d57417c3c7e3fb 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -9,6 +9,7 @@ Noteworthy changes in release ?.?? (????-??-??)
 
 * Bug fixes
   * Fixed strace-k test on alpha.
+  * Fixed build on mips o32.
   * Fixed build on NOMMU architectures.
 
 Noteworthy changes in release 4.26 (2018-12-26)
index 387aa8522b2f2add77005e72fc1ab7c86c66d90f..e2889f98532e5e272a40709be0d4635aa9f644af 100644 (file)
@@ -37,3 +37,29 @@ arch_get_syscall_args(struct tcb *tcp)
 #endif
        return 1;
 }
+
+#ifdef SYS_syscall_subcall
+static void
+decode_syscall_subcall(struct tcb *tcp)
+{
+       if (!scno_is_valid(tcp->u_arg[0]))
+               return;
+       tcp->scno = tcp->u_arg[0];
+       tcp->qual_flg = qual_flags(tcp->scno);
+       tcp->s_ent = &sysent[tcp->scno];
+       memmove(&tcp->u_arg[0], &tcp->u_arg[1],
+               sizeof(tcp->u_arg) - sizeof(tcp->u_arg[0]));
+       /*
+        * Fetching the last arg of 7-arg syscalls (fadvise64_64
+        * and sync_file_range) requires additional code,
+        * see linux/mips/get_syscall_args.c
+        */
+       if (tcp->s_ent->nargs == MAX_ARGS) {
+               if (umoven(tcp,
+                          mips_REG_SP + MAX_ARGS * sizeof(tcp->u_arg[0]),
+                          sizeof(tcp->u_arg[0]),
+                          &tcp->u_arg[MAX_ARGS - 1]) < 0)
+               tcp->u_arg[MAX_ARGS - 1] = 0;
+       }
+}
+#endif /* SYS_syscall_subcall */
index d78f51dd365240c316abb635e0b9ea3699aa2b9d..51fcc721968cd90d8070f8f64b02e7cdc305a328 100644 (file)
--- a/syscall.c
+++ b/syscall.c
@@ -349,31 +349,8 @@ decode_ipc_subcall(struct tcb *tcp)
 #endif /* SYS_ipc_subcall */
 
 #ifdef SYS_syscall_subcall
-static void
-decode_syscall_subcall(struct tcb *tcp)
-{
-       if (!scno_is_valid(tcp->u_arg[0]))
-               return;
-       tcp->scno = tcp->u_arg[0];
-       tcp->qual_flg = qual_flags(tcp->scno);
-       tcp->s_ent = &sysent[tcp->scno];
-       memmove(&tcp->u_arg[0], &tcp->u_arg[1],
-               sizeof(tcp->u_arg) - sizeof(tcp->u_arg[0]));
-# ifdef LINUX_MIPSO32
-       /*
-        * Fetching the last arg of 7-arg syscalls (fadvise64_64
-        * and sync_file_range) requires additional code,
-        * see linux/mips/get_syscall_args.c
-        */
-       if (tcp->s_ent->nargs == MAX_ARGS) {
-               if (umoven(tcp,
-                          mips_REG_SP + MAX_ARGS * sizeof(tcp->u_arg[0]),
-                          sizeof(tcp->u_arg[0]),
-                          &tcp->u_arg[MAX_ARGS - 1]) < 0)
-               tcp->u_arg[MAX_ARGS - 1] = 0;
-       }
-# endif /* LINUX_MIPSO32 */
-}
+/* The implementation is architecture specific.  */
+static void decode_syscall_subcall(struct tcb *);
 #endif /* SYS_syscall_subcall */
 
 static void