Package: dietlibc-dev
Version: 0.29-9
Followup-For: Bug #351875

The attached patch fixes the llseek (5 args) and the sendto/recvfrom (6
args) issue on hppa by using a syscall5/syscall6 wrapper to handle
things with more than 4 arguments. 

This patch can replace the debian/diff/parisc-sendto-recvfrom.diff that
currently exists, as this fixes things in a better way.

Herbert Poetzl is to be given kudos for coming up with this.

Micah

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.15+vserver
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)

dietlibc-dev depends on no packages.

Versions of packages dietlibc-dev recommends:
pn  dietlibc                      <none>     (no description available)

-- no debconf information
diff -NurpP -x '*.o' -x '*.orig' parisc/_llseek.S parisc/_llseek.S
--- parisc/_llseek.S	1970-01-01 01:00:00.000000000 +0100
+++ parisc/_llseek.S	2006-03-26 03:55:09.000000000 +0200
@@ -0,0 +1,3 @@
+#include "syscalls.h"
+
+syscall5(llseek, llseek);
diff -NurpP -x '*.o' -x '*.orig' parisc/recvfrom.S parisc/recvfrom.S
--- parisc/recvfrom.S	2002-07-03 22:33:38.000000000 +0200
+++ parisc/recvfrom.S	2006-03-26 03:15:15.000000000 +0200
@@ -1,3 +1,3 @@
 #include "syscalls.h"
 
-syscall(recvfrom, recvfrom);
+syscall6(recvfrom, recvfrom);
diff -NurpP -x '*.o' -x '*.orig' parisc/sendto.S parisc/sendto.S
--- parisc/sendto.S	2002-07-03 22:33:38.000000000 +0200
+++ parisc/sendto.S	2006-03-26 03:15:15.000000000 +0200
@@ -1,3 +1,3 @@
 #include "syscalls.h"
 
-syscall(sendto, sendto);
+syscall6(sendto, sendto);
diff -NurpP -x '*.o' -x '*.orig' parisc/syscalls.h parisc/syscalls.h
--- parisc/syscalls.h	2005-03-23 20:05:25.000000000 +0100
+++ parisc/syscalls.h	2006-03-26 03:37:15.000000000 +0200
@@ -153,7 +153,7 @@
 #define __NR_afs_syscall        (__NR_Linux + 137) /* Syscall for Andrew File System */
 #define __NR_setfsuid           (__NR_Linux + 138)
 #define __NR_setfsgid           (__NR_Linux + 139)
-#define __NR__llseek            (__NR_Linux + 140)
+#define __NR_llseek             (__NR_Linux + 140)
 #define __NR_getdents           (__NR_Linux + 141)
 #define __NR_select		(__NR_Linux + 142)
 #define __NR__newselect         (__NR_Linux + 142)
@@ -282,7 +282,7 @@
 
 #define LINUX_GATEWAY_ADDR      0x100
 
-#define syscall_weak(name, sym, wsym) 	\
+#define syscall_weak(name, sym, wsym)	\
 .text!					\
 .type wsym, @function!			\
 .weak wsym!				\
@@ -293,11 +293,16 @@ sym:					\
 	b __unified_syscall!		\
 	ldi __NR_##name, %r20!		\
 
-#define syscall(name, sym)  		\
+#define __syscall(name, sym, imp)  	\
 .text!					\
 .type sym,@function!			\
 .globl sym!				\
 .export sym!				\
 sym:					\
-	b __unified_syscall!		\
+	b imp!				\
 	ldi __NR_##name, %r20!
+
+#define syscall(name, sym)	__syscall(name, sym, __unified_syscall)
+#define syscall5(name, sym)	__syscall(name, sym, __unified_syscall5)
+#define syscall6(name, sym)	__syscall(name, sym, __unified_syscall6)
+
diff -NurpP -x '*.o' -x '*.orig' parisc/unified.S parisc/unified.S
--- parisc/unified.S	2002-01-31 13:53:45.000000000 +0100
+++ parisc/unified.S	2006-03-26 04:43:08.000000000 +0200
@@ -21,14 +21,30 @@
 .global __unified_syscall
 .type __unified_syscall,@function
 
+.export __unified_syscall5
+.global __unified_syscall5
+.type __unified_syscall5,@function
+
+.export __unified_syscall6
+.global __unified_syscall6
+.type __unified_syscall6,@function
+
 .export __error_unified_syscall
 .global __error_unified_syscall
 
+
 .globl _exit
 .weak exit
 _exit:
 exit:
         ldi 1, %r20
+	b __unified_syscall
+	nop
+
+__unified_syscall6:
+	ldw -0x38(%sr0, %sp), %r21
+__unified_syscall5:
+	ldw -0x34(%sr0, %sp), %r22
 __unified_syscall:
 	be,l 0x100(%sr2, %r0), %sr0, %r31
 	nop

Reply via email to