Control: retitle -1 dietlibc: waitpid broken w/ -lpthread on s390, s390x, 
mips64, ia64
Control: tags -1 + confirmed
Control: tags -1 - patch

Thanks for reassigning this.

On 01/05/2017 11:48 AM, latinovic wrote:
> Both archs (s390x and mips64el) do not support waitpid, wait4 is used instead.
> (https://github.com/ensc/dietlibc/blob/master/s390x/__waitpid.c)
> As there is no waitpid system call for these archs, undefined reference to 
> `__libc_waitpid' appears.
> 
> In order to fix this it is needed to use wait4 syscall instead in 
> syscalls.s/waitpid.S.

Unfortunately, this is wrong, because then the flags parameter for
wait4 would be undefined and depend on the previous state of
program execution.

Also, dietlibc would then contain two copies of waitpid() on these
platforms, because that doesn't remove __waitpid.c from there.

Furthermore, ia64 is also affected because that contains a carbon
copy of s390's __waitpid.c. (Don't know which one was first.)

The correct solution is to change the name of the function to
__libc_waitpid in __waitpid.c and to define a weak alias for
waitpid there. I'm already working on this (saw your initial email
where you reassigned this), and will do an upload soon together
with regression tests for this. (The unit tests for dietlibc
do already do check for a working waitpid(), but unfortunately they
don't link against -lpthread.)

Regards,
Christian

Reply via email to