Package: dietlibc-dev Version: 0.29-9 Followup-For: Bug #351875 Scratch that previous patch, the attached one goes a step further to fix all the remaining issues with the parisc syscalls that all contain 5 or 6 arguments, namely:
SYSCALL(sys_mount, 5) SYSCALL(sys_llseek, 5)III/* 140 */ SYSCALL(sys_select, 5) SYSCALL(sys_getsockopt, 5) SYSCALL(sys_setsockopt, 5) SYSCALL(sys_ni_syscall, 5) SYSCALL(sys_prctl, 5) SYSCALL(sys_pread64, 5)III/* 200 */ SYSCALL(sys_pwrite64, 5) SYSCALL(sys_recvfrom, 6) SYSCALL(sys_sendto, 6)III/* 180 */ The previous patch handled llseek, recvfrom, sendto. This patch builds on the previous one and adds the remaining. Also, the parisc execvp bug (#360007) is fixed in the attached patch. I have sent all this information upstream, but I include it here in case you would apply the changes to the debian package before it gets accepted upstream. I'm confident that this works in the debian package, as that was what I was using to test. Again, kudos to Herbert Poetzl! 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 --minimal -x '*.orig' parisc/getsockopt.S parisc/getsockopt.S --- parisc/getsockopt.S 2002-07-03 22:33:38.000000000 +0200 +++ parisc/getsockopt.S 2006-03-30 06:28:36.000000000 +0200 @@ -1,3 +1,3 @@ #include "syscalls.h" -syscall(getsockopt, getsockopt); +syscall5(getsockopt, getsockopt); diff -NurpP --minimal -x '*.orig' parisc/_llseek.S parisc/_llseek.S --- parisc/_llseek.S 1970-01-01 01:00:00.000000000 +0100 +++ parisc/_llseek.S 2006-03-30 05:05:11.000000000 +0200 @@ -0,0 +1,3 @@ +#include "syscalls.h" + +syscall5(llseek, llseek); diff -NurpP --minimal -x '*.orig' parisc/mmap.S parisc/mmap.S --- parisc/mmap.S 2002-01-11 19:06:53.000000000 +0100 +++ parisc/mmap.S 2006-03-30 06:27:32.000000000 +0200 @@ -1,25 +1,3 @@ -/* - Copyright (C) 2001, 2002 Thomas M. Ogrisegg - - This is free software. You can redistribute and - modify it under the terms of the GNU General Public - Public License. - - This file is part of the hppa-Port of dietlibc - - mmap.S - Wrapper for the mmap(2) Systemcall -*/ - #include "syscalls.h" -.level 1.1 -.globl mmap -.type mmap,@function -mmap: - /* Just load the arguments from the - stack into %r21 and %r22 */ - ldw -56(%sr0, %sp), %r21 ; 0x78 - ldw -52(%sr0, %sp), %r22 ; 0x74 - b __unified_syscall - ldi __NR_mmap, %r20 +syscall6(mmap, mmap); diff -NurpP --minimal -x '*.orig' parisc/mount.S parisc/mount.S --- parisc/mount.S 1970-01-01 01:00:00.000000000 +0100 +++ parisc/mount.S 2006-03-30 06:29:48.000000000 +0200 @@ -0,0 +1,3 @@ +#include "syscalls.h" + +syscall5(mount, mount); diff -NurpP --minimal -x '*.orig' parisc/recvfrom.S parisc/recvfrom.S --- parisc/recvfrom.S 2002-07-03 22:33:38.000000000 +0200 +++ parisc/recvfrom.S 2006-03-30 05:05:11.000000000 +0200 @@ -1,3 +1,3 @@ #include "syscalls.h" -syscall(recvfrom, recvfrom); +syscall6(recvfrom, recvfrom); diff -NurpP --minimal -x '*.orig' parisc/select.S parisc/select.S --- parisc/select.S 1970-01-01 01:00:00.000000000 +0100 +++ parisc/select.S 2006-03-30 06:11:19.000000000 +0200 @@ -0,0 +1,3 @@ +#include "syscalls.h" + +syscall5(select, select); diff -NurpP --minimal -x '*.orig' parisc/sendto.S parisc/sendto.S --- parisc/sendto.S 2002-07-03 22:33:38.000000000 +0200 +++ parisc/sendto.S 2006-03-30 05:05:11.000000000 +0200 @@ -1,3 +1,3 @@ #include "syscalls.h" -syscall(sendto, sendto); +syscall6(sendto, sendto); diff -NurpP --minimal -x '*.orig' parisc/setsockopt.S parisc/setsockopt.S --- parisc/setsockopt.S 2002-07-03 22:33:38.000000000 +0200 +++ parisc/setsockopt.S 2006-03-30 06:28:46.000000000 +0200 @@ -1,3 +1,3 @@ #include "syscalls.h" -syscall(setsockopt, setsockopt); +syscall5(setsockopt, setsockopt); diff -NurpP --minimal -x '*.orig' parisc/strchr.S parisc/strchr.S --- parisc/strchr.S 2003-09-20 14:18:44.000000000 +0200 +++ parisc/strchr.S 1970-01-01 01:00:00.000000000 +0100 @@ -1,40 +0,0 @@ -.text -.globl strchr - -strchr: - .PROC - .CALLINFO - .ENTRY - depw,z %r25, 23, 24, %r23 - or %r23, %r25, %r23 - depw,z %r23, 15, 16, %r21 - or %r23, %r21, %r23 - ldi 3, %r19 - and,<> %r26, %r19, %r20 - b,n .Lmdoit -.Lsingle: - ldb,ma 1(%r26), %r20 - cmpb,=,n %r20, %r25, .Lrfound - and,= %r26, %r19, %r0 - b,n .Lsingle -.Lmdoit: - ldw,ma 4(%r26), %r20 - uxor,nbz %r20, %r23, %r0 - b,n .Lfoobar - uxor,sbz %r0, %r20, %r0 - b,n .Lmdoit - bv %r0(%rp) - or %r0, %r0, %r28 -.Lfoobar: - addi -4, %r26, %r26 -.Lfound: - extrw,u %r20, 7, 8, %r19 - depw %r20, 23, 24, %r20 - cmpb,<> %r25, %r19, .Lfound - addi 1, %r26, %r26 -.Lrfound: - bv %r0(%rp) - addi -1, %r26, %r28 - .EXIT - .PROCEND - .EXPORT strchr diff -NurpP --minimal -x '*.orig' parisc/syscalls.h parisc/syscalls.h --- parisc/syscalls.h 2005-03-23 20:05:25.000000000 +0100 +++ parisc/syscalls.h 2006-03-30 05:05:11.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) @@ -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 --minimal -x '*.orig' parisc/unified.S parisc/unified.S --- parisc/unified.S 2002-01-31 13:53:45.000000000 +0100 +++ parisc/unified.S 2006-03-30 05:10:46.000000000 +0200 @@ -21,17 +21,33 @@ .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 -__unified_syscall: - be,l 0x100(%sr2, %r0), %sr0, %r31 + 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 ldi -0x100, %r1 cmpb,>>=,n %r1, %ret0, .Lnoerr sub %r0, %ret0, %ret0