On May 28, 2019 6:25 PM, "Laurent Vivier" <laur...@vivier.eu> wrote: > > On 23/05/2019 19:54, Laurent Vivier wrote: >> >> In current code, __NR_msgrcv and__NR_semtimedop are supposed to be >> defined if __NR_msgsnd is defined. >> >> But linux headers 5.2-rc1 for MIPS define __NR_msgsnd without defining >> __NR_semtimedop and it breaks the QEMU build. >> >> __NR_semtimedop is defined in asm-mips/unistd_n64.h and asm-mips/unistd_n32.h >> but not in asm-mips/unistd_o32.h. >> >> Commit d9cb4336159a ("linux headers: update against Linux 5.2-rc1") has >> updated asm-mips/unistd_o32.h and added __NR_msgsnd but not __NR_semtimedop. >> It introduces __NR_semtimedop_time64 instead. >> >> This patch fixes the problem by checking for each __NR_XXX symbol >> before defining the corresponding syscall. >> >> Fixes: d9cb4336159a ("linux headers: update against Linux 5.2-rc1") >> Reported-by: Philippe Mathieu-Daudé <phi...@redhat.com> >> Signed-off-by: Laurent Vivier <laur...@vivier.eu> >> --- >> linux-user/syscall.c | 24 ++++++++++++++++-------- >> 1 file changed, 16 insertions(+), 8 deletions(-) > > > This only fixes the problem at build time, but the changes in the kernel headers introduce also a regression at execution time: > > if the host kernel doesn't implement the syscall, the syscall fails (ENOSYS) whereas it was working before because it was using ipc() instead. I have this problem with a Fedora 28 on ppc64 (5.0.16-100.fc28.ppc64) (LTP test msgctl07). > > I'm preparing a fix. >
OK, great that you found this behavior, thanks. Just want to tell you that meanwhile the original code of this patch got integrated into main source tree. Regards, Aleksandar > Thanks, > Laurent