Using iOS 7 SDK with llvm-gcc-4.2
Asked Answered
T

4

5

I've installed xcode 5 and noticed that gcc compiler is deprecated. Assuming that I don't want to switch to Apple LLVM 5.0, here come my questions:

Is it possible to use iOS7 SDK and still compile in llvm-gcc-4.2?

If yes, how to do this?

If you don't know if that's possible, please don't post answers like "use clang, man", because they are not actually answering the questions I've posted.

Tereus answered 19/9, 2013 at 9:0 Comment(9)
Can I ask why you don't want to use clang?Latta
I guess that "I'm just curious" is not enough :). Let's say, there's a huge project which doesn't like being compiled in clang. In the future it will be fixed, but for now it would be great to compile it "the old way" :).Tereus
So you are willing to update it to use iOS 7 but not to fix it to use clang? I think your only route is to go back to Xcode 4.Latta
Apple has expressed their displeasure with the dinosaur that is GCC on several occasions and have been stating that they plan to remove it since they first started using clang circa iOS 5 since it was making their build chain miserable. If you want to stick with "the old way" you will have to stick with "the old SDK"Bramlett
The real issue Apple has with GCC is the GNU license. This is why they invested so heavily in clang and llvm.Discharge
I have no idea if it works, but you could try to overwrite the default compilter using the CC flag, as described in this post under (2). There may be a few (or many) flags that Xcode sets by default which are not supported by GCC. In this case, you'll probably see a warning in the build log... I currently don't have the possibility to test it myself.Essequibo
@Latta clang doesn't support the __builtin SSE instructions, that's how I arrived at this question. We used to use llvm-gcc which was previous bundled with Xcode.Roseliaroselin
@Roseliaroselin A post in this thread recommends not using them anyway, and recommends using intrinsics instead: clang-developers.42468.n3.nabble.com/…Latta
clang.llvm.org/compatibility.html#vector_builtins for the lazy. I'm aware of the issue, but we have a huge data processing codebase that uses those all over the place. It sounds like OP has a similar issue.Roseliaroselin
A
5

Apple has removed the support for llvm-gcc-4.2 in XCode 5. Even if you install and change your base sdk to 6.1 sdk, you won't be able to build using llvm-gcc-4.2. So your only option is to continue using XCode 4.x if you want to use llvm-gcc-4.2.

Animalcule answered 19/9, 2013 at 15:22 Comment(0)
B
1

LLVM-GCC is not included in Xcode 5.

I got above line from https://developer.apple.com/library/ios/documentation/DeveloperTools/Conceptual/WhatsNewXcode/Articles/xcode_5_0.html

So the question is what to use instead of llvm-gcc ?

Burdelle answered 28/9, 2013 at 14:1 Comment(0)
E
1

Is it possible to use iOS7 SDK and still compile in llvm-gcc-4.2?

If you want to compile your whole app using llvm-gcc-4.2: Probably not. I haven't checked this myself, but the iOS 7 headers would only need to add a single dependency on a clang feature missing in llvm-gcc-4.2 and you're swimming in compile errors. You may be able to hack your way through them, but it would likely be easier (not to mention more future-proof) to suck it up and upgrade to clang.

If you only need to compile some of your app using llvm-gcc-4.2: Sure, as long as you don't need to import any iOS 7 headers in the parts that you build with llvm-gcc-4.2.

You could try moving the problematic bits off to a static library, compiling that with gcc, then linking in to the final app, built with clang. You won't be able to target 64-bit, as llvm-gcc-4.2 doesn't can't generate armv8 code, but it should work otherwise.

One caveat: If your static lib uses C++, there may be some problems due to ABI and std library differences. But those are solvable problems, at least.

Estep answered 29/9, 2013 at 16:31 Comment(0)
C
0

You could use homebrew to install the gcc version you need. Most probably all your Makefiles will need to be corrected (sigh)

I did:

brew search gcc

And the results:

homebrew/versions/gcc43     
homebrew/versions/gcc45 
homebrew/versions/gcc47    
homebrew/versions/gcc49
homebrew/versions/gcc44
homebrew/versions/gcc45
homebrew/versions/gcc48    
homebrew/versions/llvm-gcc28
homebrew/dupes/apple-gcc42
Cooking answered 29/9, 2013 at 15:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.