[cfe-dev] Using Clang -O4 with CMake

Clark Gaebel cg.wowus.cg at gmail.com
Sat Jun 19 11:52:45 PDT 2010


Is there any way to do this with CMake?

Also (kinda related), how do I detect whether I'm using clang or gcc
from a CMakeFile?

On 06/19/10 14:35, David Chisnall wrote:
> On 19 Jun 2010, at 19:23, Clark Gaebel wrote:
>
>   
>> Is there any way to do this without using gold? I'd rather not enable an
>> experimental linker.
>>     
> You can add -emit-llvm to your CFLAGS, then use llvm-link to link the resulting bitcode files together, use opt to produce an optimised version, and then llc to generate the native code, which you then pass to the linker.  It's a bit more effort (and involves spawning a lot of processes, so will be slower), but should have the same end result.
>
> David
>
> -- Sent from my IBM 1620

-- 
Regards,
-Clark




More information about the cfe-dev mailing list