You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Why do I have llvm-gcc with XCode5 ?

I thought XCode 5 no longer had GCC. However, on my 10.8.5 iMac with XCode5:


whereis llvm-gcc

/usr/bin/llvm-gcc


which is a link to /usr/llvm-gcc-4.2/bin/llvm-gcc-4.2


I'm happy to find this, because some source code from the www doesn't build on clang, but... is it correct that I have llvm-gcc, or do I have it because I upgraded to XCode5 from XCode4.6?


Thanks!

Posted on Oct 22, 2013 4:21 AM

Reply
10 replies

Oct 22, 2013 6:40 AM in response to cesarpixel

That really isn't GCC. It is just a GCC front-end attached to the LLVM backend. It is for people who really like the LLVM-genreated code but don't like LLVM's clear, and easy-to-read warnings and errors.


If you have code that only compiles on GCC, then you need to change the code. GCC has never been a standards-compliant compiler. Relying on GCC is always going to bite you end the end because it silently allows buggy code.

Oct 22, 2013 8:24 AM in response to xnav

etresoft wrote:


That really isn't GCC. It is just a GCC front-end attached to the LLVM backend. It is for people who really like the LLVM-genreated code but don't like LLVM's clear, and easy-to-read warnings and errors.


If you have code that only compiles on GCC, then you need to change the code. GCC has never been a standards-compliant compiler. Relying on GCC is always going to bite you end the end because it silently allows buggy code.


It is the GCC front-end, and that's all you need for building code which doesn't parse with clang (yes, if your code doesn't parse with clang, it's likely to be wrong code, but there're some programs like that on the net). Also, the GCC front-end supports OpenMP, while the clang front-end doesn't (yes, I saw your last post on the other thread, but I understand that's work in progress, and not merged with the 3.3 branch yet (the clang version shipped with Xcode 5 is 3.3.



xnav wrote:


From the Xcode 5 Release Notes



Xcode 5 does not support using the LLVM-GCC compiler or the GDB debugger. 14857582

This doesn't mean it can't be used from the command line.


Yes, but I was unable to find the release notes for the newest command line tools (from sept 18th), so I assume the command line tools didn't include gcc nor gdb. Moreover, searching the net I found some people having difficulties to compiles some open source code, and the general reply was that Xcode 5 doesn't have gcc, so the only options are to either install a custom gcc build, or fix the code so that it compiles with clang. I assumed these people was working from the command line, so that's why I'm surprised to find llvm-gcc on my machine. I don't know if it's there from the Xcode 5 command line tools, or from the previous 4.6 installation.

Oct 22, 2013 10:05 AM in response to etresoft

etresoft wrote:


You may need to switch to an operating system that is more compatible with GCC then. GCC has nev fully supported the Mac. It always required Xcode to run. Then, GCC changed its license specifically to keep Mac users from using their compiler. Sorry, but GCC is dead on the Msc.


That's not accurate. First, I don't need gcc (but it's better to have it installed too, because you might need it). Second, even if I need it, I could install the latest gcc if I wished so (as a lot of developers do). Third, I'm not a user of a single OS. I use several OSs, and I use both GCC as well as other commercial compilers. Fourth, I enjoy Darwin.


Anyway, back to the point I just wished to know if I can assume that the GCC front end is shipped with the Xcode 5 Command Line Tools, or if it's a side effect of my installation being an upgrade.

Oct 22, 2013 10:33 AM in response to cesarpixel

No. GCC is officially deprecated. Xcode includes a GCC crutch for those unwilling to act until things actually break. But it is not really GCC, just a front end. You can't count on it being there forever. The only reason it is there now is for you to take this opportunity to fix or replace any code that requires it. If you doubt me, feel free to search this forum for "Rosetta".

May 8, 2014 6:00 AM in response to etresoft

Thanks for the quick reply. The second link indicated switching to the GCC compiler, but that was also a year ago and appears dated already with the new XCode. I had seen the GCC reference on another blog, but switching over to windows to get it to build and to work with PCL may just be the deal today.


I will look into Clang as well. I appreciate the reference.


Thanks again.

Why do I have llvm-gcc with XCode5 ?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.