strace 4.10 doesn't build on MIPS arch

Dmitry V. Levin ldv at altlinux.org
Wed Apr 15 13:52:59 UTC 2015


On Wed, Apr 15, 2015 at 11:26:08AM +0200, Arturo Borrero Gonzalez wrote:
> On 14 April 2015 at 15:13, Dmitry V. Levin <ldv at altlinux.org> wrote:
> > On Tue, Apr 14, 2015 at 09:32:39AM +0200, Arturo Borrero Gonzalez wrote:
> >> Hi there!
> >>
> >> I've been taking a look at the debian log for strace on the MIPS
> >> architecture [0].
> >> There is a test that doesn't pass and therefore the build is taken as
> >> invalid (and the debian package isn't created).
> >>
> >> For me, the ideal fix is to get the test file passing.
> >> I know nothing of the strace source code base, could you please give
> >> me a few hints/pointers of how to solve the situation?
> >
> > Could you re-test with the current HEAD, please?
> > (./bootstrap && ./configure && make check)
> 
> Still errors. Find attached the result.

Thanks.  Could you update to the current HEAD once more and try with this
tentative patch applied, please:

--- a/linux/mips/syscallent-o32.h
+++ b/linux/mips/syscallent-o32.h
@@ -1,6 +1,6 @@
 #if defined LINUX_MIPSO32
 /* For an O32 strace, decode the o32 syscalls.  */
-[4000] = { MA,	0,		printargs,			"syscall"		}, /* start of Linux o32 */
+[4000] = { MA,	0,		sys_syscall,			"syscall"		}, /* start of Linux o32 */
 [4001] = { 1,	TP|SE,		sys_exit,			"exit"			},
 [4002] = { 0,	TP,		sys_fork,			"fork"			},
 [4003] = { 3,	TD,		sys_read,			"read"			},
--- a/syscall.c
+++ b/syscall.c
@@ -602,6 +602,25 @@ decode_ipc_subcall(struct tcb *tcp)
 }
 #endif
 
+#ifdef LINUX_MIPSO32
+static void
+decode_mips_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]));
+}
+
+SYS_FUNC(syscall)
+{
+	return printargs(tcp);
+}
+#endif
+
 int
 printargs(struct tcb *tcp)
 {
@@ -770,6 +789,11 @@ trace_syscall_entering(struct tcb *tcp)
 		goto ret;
 	}
 
+#ifdef LINUX_MIPSO32
+	if (sys_syscall == tcp->s_ent->sys_func)
+		decode_mips_subcall();
+#endif
+
 	if (   sys_execve == tcp->s_ent->sys_func
 # if defined(SPARC) || defined(SPARC64)
 	    || sys_execv == tcp->s_ent->sys_func


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20150415/727ce138/attachment.bin>


More information about the Strace-devel mailing list