Are there any patches via macports or brew that allow you to install Valgrind on macOS 12?
It's all a question of resources. I think that I'm the only active Valgrind dev that uses macOS, but my focus is on FreeBSD. It's a bit of a pity that Apple (market cap of $2.4 trillion at the time of writing) can't commit some relatively small amount of effort to achieve this. There are several IBM engineers contributing (directly for s390 and PPC and indirectly via RedHat).
The changes required to the Valgrind configure scripts are fairly minor.
Try this
- clone https://github.com/LouisBrunner/valgrind-macos/tree/feature/macos_11pp2
- edit configure.ac
- add AC_DEFINE([DARWIN_12_00], 120000, [DARWIN_VERS value for macOS 12.0]) after line 430
- add new versions for XCode 12: after line 435
AC_DEFINE([XCODE_12_0], 110000, [XCODE_VERS value for Xcode 12.0])
and after line 555
12.*)
AC_DEFINE([XCODE_VERS], XCODE_12_0, [Xcode version])
;;
- duplicate the case block for kernel version 21.0 (line 526), something like
# comes after the 20.0) case
21.*)
AC_MSG_RESULT([Darwin 21.x (${kernel}) / macOS 12 Monterey])
AC_DEFINE([DARWIN_VERS], DARWIN_12_00, [Darwin / Mac OS X version])
DEFAULT_SUPP="darwin20.supp ${DEFAULT_SUPP}"
DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
;;
- (ignore the suppression version for now)
- run
./autogen.sh - run
./configure - run
make - if that all works run
./vg-in-place yes
Doing the above plus a few more changes for DARWIN_12, I get
paulf> ./vg-in-place yes
==12358== Memcheck, a memory error detector
==12358== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==12358== Using Valgrind-3.18.0.GIT-lbmacos and LibVEX; rerun with -h for copyright info
==12358== Command: yes
==12358==
valgrind: m_mach/dyld_cache.c:244 (int try_to_init(void)): Assertion 'dyld_cache.header->mappingCount == 3' failed.