Unable to link ppc after upgrading to XCode 4

无人久伴 提交于 2019-12-03 03:14:55
Mecki

Since you are using the command line gcc (Unix Development Package), not the GCC of /Developer or /Xcode3 will be used, but the one of /usr, which I have not touched my original description. To restore PPC support to the command line GCC, you'll have to do at least what jas pointed out in this answer. Or you to alter your Makefile to use the gcc from /Developer instead (I created your helloworld.cpp in the current working directory before executing those commands):

$ /Developer/usr/bin/g++-4.0 -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4   -c -o helloworld.o helloworld.cpp
$ /Developer/usr/bin/g++-4.0 helloworld.o -o helloworld -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4
ld: warning: object file compiled with -mlong-branch which is no longer needed. To remove this warning, recompile without -mlong-branch: /Developer/SDKs/MacOSX10.4u.sdk/usr/lib/crt1.o
ld: warning: object file compiled with -mlong-branch which is no longer needed. To remove this warning, recompile without -mlong-branch: /Xcode3/usr/bin/../lib/gcc/powerpc-apple-darwin10/4.0.1/crt3.o
$ ./helloworld 
hello world 

You can safely ignore the two warnings. Unfortunately GCC 4.0 does not support the -mno-long-branch, which would be necessary to avoid long branches.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!