[LLVMdev] Updating llvm-gcc 4.2 in Xcode 3.1.4

Alexandre Colucci
Fri, 30 Jul 2010 16:28:16 -0000

Hey,

My projects are not compiling on 10.5 using llvm-gcc 4.2 in Xcode 3.1.4. These
are caused by some llvm bugs that are now fixed. Since Apple will not release a
Xcode update for 10.5, I am trying to compile a recent version of llvm-gcc 4.2
(from the LLVM 2.7 branch - but I could use ToT if this helps) to use on 10.5
intel.

I easily built llvm-gcc-4.2 on 10.5 intel by following the README.LLVM
instructions. Everything seems to be working as expected. Then I tried to
replace the llvm-gcc 4.2 build contained in Xcode 3.1.4
(/Developer/usr/llvm-gcc-4.2/) by the build I compiled. But that appears to not
work because Xcode 3.1.4 uses the "-arch" option that my compiled
version of llvm-gcc doesn't know about.

When I compile a C file with my llvm-gcc 4.2 version, I get the following error:
$ /Volumes/xData/llvm/install/bin/llvm-gcc -o test -arch i386 test.c
cc1: error: unrecognized command line option "-arch"

The original llvm-gcc included in Xcode 3.1.4 has no problem to build this C
file with the same command (llvm-gcc-4.2 -o test -arch i386 test.c ).


Did someone manage to update llvm-gcc 4.2 contained in Xcode 3.1.4? Is there a
trick? Does anyone know how to enable the -arch option?

Thanks,
Alexandre