OSX 10.8 上的 Valgrind 安装错误

OSX 10.8 上的 Valgrind 安装错误

嗨,我一直在尝试在 Mountain Lion 上使用 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

有人知道这些错误意味着什么吗?我找不到任何帮助,甚至在 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]

答案1

从: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

可以通过添加以下行来修复此问题:

#define __private_extern__ extern

到以下文件:

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

(通过谷歌搜索找到此内容unknown type name '__private_extern__' valgrind:)

相关内容