From 8e935144655b94efc121b8432c4f5653e3cc2c01 Mon Sep 17 00:00:00 2001 From: Paul Floyd Date: Wed, 26 Nov 2025 20:25:10 +0100 Subject: [PATCH] Darwin: fix x86 build and client syscall --- cachegrind/tests/x86/fpu-28-108.S | 3 +++ coregrind/m_replacemalloc/vg_replace_malloc.c | 2 +- coregrind/m_syswrap/syswrap-main.c | 2 +- coregrind/m_syswrap/syswrap-x86-darwin.c | 4 ++-- memcheck/tests/x86/pushfpopf_s.S | 2 ++ memcheck/tests/x86/tronical.S | 2 ++ none/tests/x86/cpuid_s.S | 3 +++ 7 files changed, 14 insertions(+), 4 deletions(-) diff --git a/cachegrind/tests/x86/fpu-28-108.S b/cachegrind/tests/x86/fpu-28-108.S index cb770f818..7f99387ff 100644 --- a/cachegrind/tests/x86/fpu-28-108.S +++ b/cachegrind/tests/x86/fpu-28-108.S @@ -24,5 +24,8 @@ VG_SYM_ASM(main): movl $0, %eax ret +#if !defined(VGO_darwin) .section .note.GNU-stack,"",@progbits +#endif + diff --git a/coregrind/m_replacemalloc/vg_replace_malloc.c b/coregrind/m_replacemalloc/vg_replace_malloc.c index 5f3aec0f0..114e92228 100644 --- a/coregrind/m_replacemalloc/vg_replace_malloc.c +++ b/coregrind/m_replacemalloc/vg_replace_malloc.c @@ -1883,7 +1883,7 @@ extern int * __error(void) __attribute__((weak)); VERIFY_ALIGNMENT(&aligned_alloc_info); \ TRIGGER_MEMCHECK_ERROR_IF_UNDEFINED((UWord)zone); \ TRIGGER_MEMCHECK_ERROR_IF_UNDEFINED(n); \ - MALLOC_TRACE("zone_memalign(%p, %lu, %u)", zone, \ + MALLOC_TRACE("zone_memalign(%p, %lu, %lu)", zone, \ alignment, n); \ \ if (alignment == 0 || alignment % sizeof(void*) != 0 || \ diff --git a/coregrind/m_syswrap/syswrap-main.c b/coregrind/m_syswrap/syswrap-main.c index 82f3adc5d..ff9960225 100644 --- a/coregrind/m_syswrap/syswrap-main.c +++ b/coregrind/m_syswrap/syswrap-main.c @@ -2296,7 +2296,7 @@ void VG_(client_syscall) ( ThreadId tid, UInt trc ) /* Save the syscall number in the thread state in case the syscall is interrupted by a signal. */ canonical_sysno = sci->orig_args.canonical_sysno; -#if defined(VGO_freebsd) || defined(VGO_darwin) +#if defined(VGO_freebsd) || defined(VGP_amd64_darwin) original_sysno = sci->orig_args.original_sysno; #else /* diff --git a/coregrind/m_syswrap/syswrap-x86-darwin.c b/coregrind/m_syswrap/syswrap-x86-darwin.c index 7459ef83a..97c044f77 100644 --- a/coregrind/m_syswrap/syswrap-x86-darwin.c +++ b/coregrind/m_syswrap/syswrap-x86-darwin.c @@ -375,8 +375,8 @@ asm( To handle this in valgrind, we create and destroy a valgrind thread for every work item. */ -void wqthread_hijack(Addr self, Addr kport, Addr stackaddr, Addr workitem, - Int reuse, Addr sp) +void wqthread_hijack(Addr self, Addr kport, Addr stackaddr, Addr workitem, + UInt reuse, Int kevent_count, Addr sp) { ThreadState *tst; VexGuestX86State *vex; diff --git a/memcheck/tests/x86/pushfpopf_s.S b/memcheck/tests/x86/pushfpopf_s.S index 3cdd64d56..5fef88e14 100644 --- a/memcheck/tests/x86/pushfpopf_s.S +++ b/memcheck/tests/x86/pushfpopf_s.S @@ -46,5 +46,7 @@ theend: .size VG_SYM_ASM(fooble),.Lfe1-VG_SYM_ASM(fooble) #endif .ident "GCC: (GNU) 2.96 20000731 (Red Hat Linux 7.1 2.96-98)" +#if !defined(VGO_darwin) .section .note.GNU-stack,"",@progbits +#endif diff --git a/memcheck/tests/x86/tronical.S b/memcheck/tests/x86/tronical.S index 60427c1c2..52adfd82b 100644 --- a/memcheck/tests/x86/tronical.S +++ b/memcheck/tests/x86/tronical.S @@ -104,5 +104,7 @@ VG_SYM_ASM(main): .Lfe3: .comm foo,4,4 .ident "GCC: (GNU) 2.96 20000731 (Red Hat Linux 7.1 2.96-98)" +#if !defined(VGO_darwin) .section .note.GNU-stack,"",@progbits +#endif diff --git a/none/tests/x86/cpuid_s.S b/none/tests/x86/cpuid_s.S index e5012cc92..8f8c9611d 100644 --- a/none/tests/x86/cpuid_s.S +++ b/none/tests/x86/cpuid_s.S @@ -71,5 +71,8 @@ VG_SYM_ASM(get_cpuid1): .ident "GCC: (GNU) 2.96 20000731 (Red Hat Linux 7.1 2.96-98)" +#if !defined(VGO_darwin) .section .note.GNU-stack,"",@progbits +#endif + -- 2.47.3