The attached patch fixes the dietlibc testsuite crash on hppa
in the socketfns testcase.
The problem is with recvfrom(), which takes 6 arguments.
The 5th and 6th argument is pushed on the stack by gcc, and
on hppa the argument is moved from the stack into a register
in __unified_syscall5 and __unified_syscall6 in parisc/unified.S
before jumping into the kernel.
Now, in syscalls.s/__recvfrom.S we have:
syscall_weak(recvfrom,recvfrom,__libc_recvfrom)
which adds the weak function, but actually it should be (for hppa):
syscall6_weak(recvfrom,recvfrom,__libc_recvfrom)
So, instead of adding and ifdef for hppa/syscall6_weak, simply
drop the weak function and call the normal __unified_syscall6.
I think it was simply luck why the testcase succeeded on physical machines.
diff -up ./syscalls.s/__recvfrom.S.org ./syscalls.s/__recvfrom.S
--- ./syscalls.s/__recvfrom.S.org 2024-07-07 16:52:47.158318342 +0000
+++ ./syscalls.s/__recvfrom.S 2024-07-07 18:05:32.560544428 +0000
@@ -1,5 +1,5 @@
#include "syscalls.h"
-#ifdef __NR_recvfrom
+#if defined(__NR_recvfrom) && !defined(__hppa__)
syscall_weak(recvfrom,recvfrom,__libc_recvfrom)
#endif