From 554e6f3240bcd6110214685371745278b43a8ab7 Mon Sep 17 00:00:00 2001 From: James Hogan Date: Wed, 1 May 2013 13:16:50 +0100 Subject: [PATCH] test/threaded_execve: fix on metag The metag ABI has stacks growing upwards so clone expects the stack argument to point at the bottom of the stack instead of the top. * test/threaded_execve.c [__metag__]: Define clone2 differently to avoid a segfault at runtime. Signed-off-by: James Hogan --- test/threaded_execve.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/threaded_execve.c b/test/threaded_execve.c index 628589a3..4c21688c 100644 --- a/test/threaded_execve.c +++ b/test/threaded_execve.c @@ -54,6 +54,9 @@ extern int __clone2(int (*fn) (void *), void *child_stack_base, size_t stack_size, int flags, void *arg, ...); #define clone2 __clone2 +#elif defined(__metag__) +#define clone2(func, stack_base, size, flags, arg...) \ + clone(func, stack_base, flags, arg) #else #define clone2(func, stack_base, size, flags, arg...) \ clone(func, (stack_base) + (size), flags, arg)