Are the three main compiler flavors supported by Xcode (gcc 4.0, 4.2, and llvm) binary-compatible with one another? What kind of gotchas and corner cases should I be aware of when bringing a multi-library project up to speed with the most recent Xcode tools?
Asked
Active
Viewed 3,458 times
2 Answers
4
Clang is ABI-compatible with code generated by gcc. Clang also includes experimental support for some newer Objective-C ABIs, but compiling for the newer ABI requires flags, and generated code can be mixed with GCC-generated code anyway.

mipadi
- 398,885
- 90
- 523
- 479
-
3Is clang's C++ ABI compatible with g++? – osgx Jan 18 '12 at 02:54
-
clang is a c++ compiler :) – cubuspl42 Mar 12 '13 at 18:34
-
1clang++ is a C++ compiler. A more recent answer on the duplicate question http://stackoverflow.com/questions/11682748/is-clang-abi-same-as-g explains that for C++ there does not seem to be a commitment to full ABI compatibility. – andybuckley Apr 23 '14 at 09:53
1
A minor gotcha is that if you want to compile PowerPC code that will run on a G3, you must use GCC 4.0.

JWWalker
- 22,385
- 6
- 55
- 76
-
Thanks for the tip; we won't need to compile PPC unless Apple returns to it, but good to know in general. – fbrereto Sep 09 '10 at 16:56