听起来像是test
使用一种gprof
意想不到的架构构建的。尝试以下操作:
$ cat > test2.c
#include <stdio.h>
int main() { printf("test\n"); return 0; }
^D
$ gcc -arch i386 -pg -o test2 test2.c
$ file test2
test2: Mach-O executable i386
$ ./test2
test
$ gprof test2
... bunch of output ...
$ gcc -arch ppc -pg -o test2 test2.c
$ file test2
test: Mach-O executable ppc
$ ./test2
test
$ gprof test2
gprof: file: test2 is not of the host architecture
$ arch -ppc gprof test2
... same bunch of output ...
较新的 MacOS 支持运行来自 IBM PPC 和 Intel x86 架构的可执行文件。一些工具链似乎对此有点密集。Gprof 似乎期望可执行文件位于本机架构中。但是,如果您使用该arch
实用程序强制执行非本机架构,那么它似乎可以正常工作。不久前在另一种情况下对此进行了讨论。我在那里提供了一些有用的链接和更多信息。