Using gcc not llvm-gcc with Mac OS X Lion

女生的网名这么多〃 提交于 2019-12-03 01:18:06

As of Xcode 4.2 in Lion, Apple no longer ships its previous version of gcc-4.2, which was in Xcode 4.1 and earlier versions. It now only ships llvm-gcc (gcc front-end with llvm code backend) and clang (clang front-end with llvm backend). While it is possible to install legacy versions of vanilla GNU gcc-4.2 from other sources, like MacPorts, (and without disturbing /usr/bin), Apple has made it clear that they aren't going to be supporting gcc anymore and that they want developers and users to move to clang.

There seems to be a way to use gcc with Xcode 4.2 - http://caiustheory.com/install-gcc-421-apple-build-56663-with-xcode-42

I experienced some problems in compiling stuff (condor for instance) with both llvm-gcc and clang os I had to get the original gcc.

I installed the version 4.6 using homebrew https://raw.github.com/adamv/homebrew-alt/master/duplicates/gcc.rb

brew install https://raw.github.com/adamv/homebrew-alt/master/duplicates/gcc.rb

I personally just use the Apple gcc, llvm or not, to build the latest gcc available. Even if /usr/bin/gcc were really gcc and not a wrapper over some llvm build, it's still crazy old. I documented my experience with the build process here.

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