summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>2009-12-15 10:36:33 +0100
committerPeter Korsgaard <jacmet@sunsite.dk>2009-12-15 10:41:07 +0100
commitb4f01dcc10a94dc5ace8a6780fb41c4882fa617b (patch)
tree2d4824cbbd60098aa439ee44ada7a7841f7073fd
parentd3df830c2bcad37871b6a6f2f34d6f0db106670f (diff)
downloadbuildroot-novena-b4f01dcc10a94dc5ace8a6780fb41c4882fa617b.tar.gz
buildroot-novena-b4f01dcc10a94dc5ace8a6780fb41c4882fa617b.zip
uclibc: add prctl syscall fix for AVR32 architecture
This patch fixes the prctl syscall for the AVR32 architecture, since this architecture assumes you handle varargs in a proper way, always. Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
-rw-r--r--toolchain/uClibc/uClibc-0.9.30-fix-varargs-in-prctl-syscall.patch.avr3229
1 files changed, 29 insertions, 0 deletions
diff --git a/toolchain/uClibc/uClibc-0.9.30-fix-varargs-in-prctl-syscall.patch.avr32 b/toolchain/uClibc/uClibc-0.9.30-fix-varargs-in-prctl-syscall.patch.avr32
new file mode 100644
index 000000000..8b27a84f7
--- /dev/null
+++ b/toolchain/uClibc/uClibc-0.9.30-fix-varargs-in-prctl-syscall.patch.avr32
@@ -0,0 +1,29 @@
+--- a/libc/sysdeps/linux/common/prctl.c
++++ b/libc/sysdeps/linux/common/prctl.c
+@@ -12,6 +12,24 @@
+ /* psm: including sys/prctl.h would depend on kernel headers */
+
+ #ifdef __NR_prctl
+-extern int prctl (int, long, long, long, long);
+-_syscall5(int, prctl, int, option, long, arg2, long, arg3, long, arg4, long, arg5)
++#define __NR___syscall_prctl __NR_prctl
++static inline _syscall5(int, __syscall_prctl, int, option, long, arg2, long, arg3, long,
++ arg4, long, arg5);
++
++int prctl(int option, ...) {
++ long arg2 = 0;
++ long arg3 = 0;
++ long arg4 = 0;
++ long arg5 = 0;
++ va_list ap;
++
++ va_start(ap, option);
++ arg2 = va_arg(ap, long);
++ arg3 = va_arg(ap, long);
++ arg4 = va_arg(ap, long);
++ arg5 = va_arg(ap, long);
++ va_end(ap);
++
++ return __syscall_prctl(option, arg2, arg3, arg4, arg5);
++}
+ #endif