Valgrind Mojave

The Mojave 10.14.1 update does NOT install properly on unsupported machines, and could result in an unbootable OS. If you want to install the 10.14.1 update (and are not currently running 10.14.1), perform the following steps:. Download the latest version of Mojave Patcher. Download the installer using the Tools menu of Mojave Patcher. HomebrewでmacOS Mojave(10.14)にValgrindをインストールするにはどうすればいいですか? (4) コマンドbrew install Valgrindを使用してValgrindをインストールしようとしましたが、「valgrind:アップストリームの互換性がないため、Sierraより新しいバージョンのmacOSではこの式がコンパイルまたは機. Jun 28, 2019 But it's hard to accept the fact that i.e. Valgrind doesn't work anymore, tools like lldb don't work out of the box, etc. To be able to use lldb on Mojave and probably above, you need to enable developer mode. So, if you get this. Feb 27, 2013 Yes, Valgrind can be run on the OS X 10.8 and 10.9. Not perfect but downloads and runs on Mavericks.I suspect Macports does not do it well but Homebrew is tolerant and able to install Valgrind provided there are no other instances of valgrind and other Installers e.g Macports & Fink.

本文是给想在Mojave上编译安装valgrind的人一个参考。

个人因为《Hands on concurrency with Rust》这本书的原因,需要安装valgrind。但是现在(2019/2/9)稳定版本的valgrind尚未支持Mojave,即不能通过Homebrew安装。valgrind的bug tracker里有这个问题的追踪, 但是看状态估计离正式发布还需要时间(开源项目常有的事情,缺少资源,哎)。对话中给了一个github上的commit,看起来可以使用。

下载对应的repository,checkout到修改版的branch上

2
4
6
8
10
Primary build arch: amd64
Build OS: darwin
Primary build target: AMD64_DARWIN
Platform variant: vanilla
Primary -DVGPV string: -DVGPV_amd64_darwin_vanilla=1
Default supp files: exp-sgcheck.supp xfree-3.supp xfree-4.supp darwin10-drd.supp darwin18.supp

假如Secondary build arch不像上面那样为空的话,比如是i386,那么make时会出现以上问题。

How To Install Valgrind On MacOS Mojave(10.14) With ...

在 configure 文件中,valgrind的注释提到在MacOS下会同时编译i386和x86_64,这是问题的根本原因,或者说valgrind在Mojave下编译的坑。幸好 configure 提供了只编译64位的选项,不需要修改 configure 文件。

See full list on github.com

总结一下,你要做的是

2
cdvalgrind
git checkout feature/v3.14/macos-mojave-support-v2
Valgrind

按照valgrind自身网站上的说明,接下来是常规的compile install。

2
4
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/mach/mach_vm.defs
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/mach/task.defs
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/mach/thread_act.defs
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/mach/vm_map.defs

也就是在原本 /usr/include/mach/mach_vm.defs 等文件前加上 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk 前缀,你可以 ls 一下看一下文件是否存在。

2. vgpreload_core_x86_darwin_so-vg_preloaded.o ld: symbol(s) not found for architecture i386

这个问题比较隐蔽,google搜不出来什么东西。直接看错误信息的话,大概知道MacOS下无法链接i386的程序,因为比较新的MacOS基本上只有x86_64。直接的解决方法是不让valgrind去编译i386架构的程序。

How To Install Valgrind On MacOS Mojave? - Answers

如果你留意了 ./configure 最后的输出的话,可以看到Secondary build arch

Cached

2
4
./configure--prefix=foo--enable-only64bit
make

小结

老实说很后悔升级到了Mojave,MacBook的睡死,突然mic不能使用等问题,现在又来一个valgrind……

不管怎么说,希望本文对你有所帮助。