|
From: Paul F. <pa...@so...> - 2026-03-18 06:52:15
|
https://sourceware.org/cgit/valgrind/commit/?id=3ed37c82bb03d4ba5b70bc553591b54c2b5d6aa1 commit 3ed37c82bb03d4ba5b70bc553591b54c2b5d6aa1 Author: Paul Floyd <pj...@wa...> Date: Wed Mar 18 07:48:39 2026 +0100 Darwin regtest: fix compilation of gdbserver_tests/self_invalidate.c This test checks for amd64 or mips. For amd64 it uses syscall 64. That is 'exit' on Linux, 'umask' on both FreeBSD and Solaris (which seems to work by accident). On Darwin it isn't a valid syscall number which causes a Valgrind error. Now Darwin uses syscall 0x02000001 (exit) and the test passes. Diff: --- gdbserver_tests/self_invalidate.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gdbserver_tests/self_invalidate.c b/gdbserver_tests/self_invalidate.c index 52b3d2bef1..5a671e33cb 100644 --- a/gdbserver_tests/self_invalidate.c +++ b/gdbserver_tests/self_invalidate.c @@ -15,7 +15,11 @@ __asm__ __volatile__ "dec %%eax\n\t" "cmp $0x0,%%eax\n\t" "jne top\n\t" - "mov $60, %%eax\n\t" +#if defined(__APPLE__) + "mov $0x02000001, %%eax\n\t" /* macOS exit */ +#else + "mov $60, %%eax\n\t" /* Linux exit, FreeBSD and Solaris umask. umask works by accident. */ +#endif "mov $0, %%rdi\n\t" "syscall\n\t" : : : "eax", "ebx", "rdi" |