I get the error '/Applications/Xcode.app/Contents/Developer/Platforms/atform/Developer/SDKs/MacOSX.sdk/usr/include/mach/fs', line 509: type 'task_exc_guard_behavior_t' not defined You can do that via: brew install automake autogen.sh requires the package 'automake' to be installed. I ended up with this error 'Undefined symbols for architecture x86_64: '_mach_msg_destroy', referenced from: _kernelrpc_mach_vm_allocate in libcoregrind-amd64-darwin.a(libcoregrind_amd64_darwin_a-mach_vmUser.o). Therefore in my case the path was '/Applications/Xcode.app/Contents/Developer/Platforms/atform/Developer/SDKs/MacOSX10.11.sdk'.
I was able to install the valgrind using the above instructions on MacOS Mojave 10.14.13 without adding a fix to the files: coregrind/m_syscall.c, coregrind/m_syswrap/syswrap-darwin.c, coregrind/vg_preloaded.c I have tried that but it still shows the exact same messages.Maybe try brew edit valgrind and replace ' /git/valgrind.git' with 'git:///git/valgrind.git' in head section of the formula.