OSX 10.8 上的 Valgrind 安装错误

kam*_*ama 4 terminal c osx-mountain-lion valgrind macos

嗨,所以我一直在尝试对美洲狮进行 Valgrind。我按照 valgrind 网页上的说明进行操作:http : //valgrind.org/docs/manual/dist.install.html

以及此博客上的说明:http : //prateekvjoshi.com/2013/02/27/how-to-install-valgrind-on-mac-os-x/

但是在任何一种情况下,当我尝试“make”或“make install”时都会遇到相同的错误:

make[3]: *** [libcoregrind_amd64_darwin_a-m_syscall.o] Error 1
make[2]: *** [install] Error 2
make[1]: *** [install-recursive] Error 1
make: *** [install] Error 2
Run Code Online (Sandbox Code Playgroud)

有谁知道这些错误可能意味着什么?我找不到任何帮助,即使在 valgrind 的常见问题解答中也是如此。任何帮助都会很棒。


此外,在我上面提到的错误之前还有几行错误,以防万一:

m_syscall.c:525:1: error: unknown type name '__private_extern__'
m_syscall.c:526:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'do_syscall_unix_WRK'
m_syscall.c:549:1: error: unknown type name '__private_extern__'
m_syscall.c:550:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'do_syscall_mach_WRK'
m_syscall.c: In function 'vgPlain_do_syscall':
m_syscall.c:703:10: warning: implicit declaration of function 'do_syscall_unix_WRK' [-Wimplicit-function-declaration]
m_syscall.c:708:10: warning: implicit declaration of function 'do_syscall_mach_WRK' [-Wimplicit-function-declaration]
Run Code Online (Sandbox Code Playgroud)

ckh*_*han 9

来自:http : //jeetworks.org/node/151:这个错误:

m_syscall.c:525:1: error: unknown type name '__private_extern__'
m_syscall.c:526:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'do_syscall_unix_WRK'
m_syscall.c:549:1: error: unknown type name '__private_extern__'
m_syscall.c:550:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'do_syscall_mach_WRK'
m_syscall.c: In function 'vgPlain_do_syscall':
m_syscall.c:703:10: warning: implicit declaration of function 'do_syscall_unix_WRK' [-Wimplicit-function-declaration]
m_syscall.c:708:10: warning: implicit declaration of function 'do_syscall_mach_WRK' [-Wimplicit-function-declaration]
make[3]: *** [libcoregrind_amd64_darwin_a-m_syscall.o] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Run Code Online (Sandbox Code Playgroud)

这可以通过添加以下行来解决:

#define __private_extern__ extern
Run Code Online (Sandbox Code Playgroud)

到以下文件:

  • coregrind/m_syscall.c
  • coregrind/m_syswrap/syswrap-darwin.c
  • coregrind/vg_preloaded.c

(由谷歌搜索用于发现这一点:unknown type name '__private_extern__' valgrind