[LLVMdev] gcc 4.2 to llvm-gcc 4.2 transition

Alexandre Colucci timac at timac.org
Sat Jul 24 04:41:42 PDT 2010


Hi,

I am currently studying the possibility to make the transition from gcc 4.2 to llvm-gcc 4.2 for the projects I am working on.
These projects are huge projects, most of the source code is written in C++ but we have objc, c and assembly code. We are targeting MacOSX 10.5 and MacOSX 10.6.

Our build system is currently running on MacOSX 10.5 and uses Xcode 3.1.4 with gcc 4.2. It is used to generate the release builds we ship and the beta releases. We could possibly switch this machine to 10.6 and Xcode 3.2.x. We still plan to support 10.5 for some time.

Switching the compiler to llvm-gcc 4.2 on 10.6 with Xcode 3.2.3 is smooth. By just changing the compiler setting in Xcode, I was basically able to compile the projects with llvm-gcc 4.2 with no major issues. On 10.5 with Xcode 3.1.4, it is a different story. Xcode 3.1.4 contains an old version of llvm-gcc 4.2 which can't build our applications. There are 2 causes of the compilation failure:

- llvm-gcc 4.2 contained in Xcode 3.1.4 can't compile CodeWarrior or Microsoft inline assembly.

- llvm-gcc 4.2 contained in Xcode 3.1.4 doesn't recognize some i386 inline assembly instructions ("mov edx,aFloat" where aFloat is a float*).


These issues prevent us to switch from gcc 4.2 to llvm-gcc 4.2. We could switch our build system to 10.6 but if we have a 10.5 specific issue, we need to be able to compile and debug our code on 10.5 on the developers machines. I would like to avoid to temporary change all the projects to gcc 4.2 on a machine in order to fix a 10.5 issue (and to hope the compiler doesn't change the issue behavior).

We have right now several possibilities:

- we don't switch to llvm-gcc 4.2 until we drop 10.5 support. But that could be in 1 or 2 years. At this point we might decide to switch directly to LLVM 2.0 since Xcode 4 will probably be available.

- we hope that Apple release for 10.5 a new version of Xcode (Xcode 3.1.5) with an updated llvm-gcc 4.2 compiler. I really doubt about it.

- we find a way to update the llvm-gcc 4.2 version in Xcode 3.1.4. I haven't investigated this point yet. Does anyone know if this is possible at all?


Does anyone have some recommendations? Is llvm-gcc 4.2 appropriate to use in our case or should we keep using gcc 4.2 for some time?

Thanks,
Alexandre







More information about the llvm-dev mailing list