[cfe-dev] Clang with Xcode 3.2.2?

Fons Rademakers Fons.Rademakers at cern.ch
Thu Dec 9 02:13:41 PST 2010


Hi Ted,

  I've done this and it works fine for building for the iPhonesimulator 
however when building for iPhoneos is falls back to the llvm-gcc4.2 
compiler. I also changed the 
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/clang with a link 
to clang from the trunk (build with arm support, of course). I've looked 
into 'Clang LLVM 1.0.xcspec' and added support for armv6 and armv7 but it 
still falls back to llvm-gcc4.2. So, what else should I change in this 
xcspec file or some other file.

Due to a fatal bug in llvm-gcc4.2 and gcc4.2 I can only use clang for my 
objective-C++ project.

With Xcode4 PR5 using llvm it all works, but the Xcode 4 source editor 
misses user scripts and has still many stability issues (make clean crashes 
consistently the session, etc).

Cheers, Fons.


On 03/08/2010 22:40, Ted Kremenek wrote:
> clang++ is just a symlink to clang, so that's easy to add.
>
> Teaching Xcode 3.2.2 to use clang++ is not possible since there is no way to tell it to use clang++ for linking C++ code, although it can be done with Xcode 3.2.3 by modifying the compiler .xcspec file.  The hackiest way to get it working is to copy the .xcspec file from Xcode 4 to Xcode 3.2.3:
>
> $ cp '/Xcode4/Library/Xcode/PrivatePlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/Clang LLVM 1.0.xcplugin/Contents/Resources/Clang LLVM 1.0.xcspec' '/Developer/Library/Xcode/Plug-ins/Clang LLVM 1.0.xcplugin/Contents/Resources/Clang LLVM 1.0.xcspec'
>
> I recommend doing a backup of that file before you do this.
>
> On Aug 3, 2010, at 1:27 PM, Alexander MacDonald wrote:
>
>> hmm, but there's no clang++ provided with xcode 3.2.2 and looking into the clang xcplugin bundle it makes no mention of c++ support, maybe I need to update to the 4.0 beta, but I'd like to avoid that if possible...
>>
>> On Aug 3, 2010, at 1:22 PM, Ted Kremenek wrote:
>>
>>> Hi Alex,
>>>
>>> You can replace /Developer/usr/bin/clang with a symlink to the clang you have built.
>>>
>>> Cheers,
>>> Ted
>>>
>>> On Aug 3, 2010, at 1:09 PM, Alexander MacDonald wrote:
>>>
>>>> I've been playing with clang on the commandline and I've had some success with it but I'd really like to try it out with some larger projects that are built with XCode. Should I just replace the clang binary that xcode 3.2.2 ships with, or does someone have an updated version of the xcplugin bundle that I can use?
>>>>
>>>>
>>>> Thanks,
>>>> Alex Macdonald
>>>> _______________________________________________
>>>> cfe-dev mailing list
>>>> cfe-dev at cs.uiuc.edu
>>>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>>>
>>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

-- 
Org:    CERN, European Laboratory for Particle Physics.
Mail:   1211 Geneve 23, Switzerland
E-Mail: Fons.Rademakers at cern.ch              Phone: +41 22 7679248
WWW:    http://fons.rademakers.org           Fax:   +41 22 7669640



More information about the cfe-dev mailing list