开发者

Valgrind error - cannot execute binary file

开发者 https://www.devze.com 2023-03-13 21:00 出处:网络
For some reason I can\'t make valgrind work with my Cocoa apllication on OS X 10.6, compiled with Apple GCC 4.2.1... After googling this error I found out that valgrind doesn\'t work with 64-bit execu

For some reason I can't make valgrind work with my Cocoa apllication on OS X 10.6, compiled with Apple GCC 4.2.1... After googling this error I found out that valgrind doesn't work with 64-bit executables, however my application and all the frameworks it uses is being com开发者_如何学编程piled with the -m32 flag and file commmand says ./MyAppName: Mach-O executable i386, Kernel is also i386.

Can somebody please tell me why won't valgrind work then?

By the way, I got valgrind from MacPorts...


Just a note that I had the same problem, but reinstalling with the +universal port option, as in

sudo port install valgrind +universal

made the MacPorts version work for me.


I am using the Homebrew build of valgrind and it works for me. After downloading valgrind it applies some patches, afaik the one discussed here. Additionally, it uses the flags --enable-only64bit --build=amd64-darwin when compiling on 64-bit darwin.

For me also neither the macports build worked, nor did the build that i created my self from the vanilla tar.gz file from the valgrind page. It seems that the provided autoconf script does not support newer macs running in 64-bit mode.


I downloaded latest valgrind v3.6.1 from valgrind.org and compiled it under OS X and it works without any issue.

0

精彩评论

暂无评论...
验证码 换一张
取 消