r260707 - [CMake] Pass stage1 tools through to stage2 when building with LTO

ChrisBieneman via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 12 12:02:31 PST 2016


It is needed if you're doing LTO. If you're not doing an LTO build using the host AR will work, and it is faster to not have to build extra targets.

It is really just a build-time optimization.

-Chris

> On Feb 12, 2016, at 11:52 AM, Rafael EspĂ­ndola <rafael.espindola at gmail.com> wrote:
> 
> Any reason it is lto specific? For example, it is nice to test llvm-ar
> in stage2 even if not doing LTO, no?
> 
> Cheers,
> Rafael
> 
> 
> On 12 February 2016 at 14:06, Chris Bieneman via cfe-commits
> <cfe-commits at lists.llvm.org> wrote:
>> Author: cbieneman
>> Date: Fri Feb 12 13:06:12 2016
>> New Revision: 260707
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=260707&view=rev
>> Log:
>> [CMake] Pass stage1 tools through to stage2 when building with LTO
>> 
>> This was originally a hacky if(APPLE) block. Now that we have an option for enabling LTO, it is better to properly gate this.
>> 
>> Modified:
>>    cfe/trunk/CMakeLists.txt
>> 
>> Modified: cfe/trunk/CMakeLists.txt
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CMakeLists.txt?rev=260707&r1=260706&r2=260707&view=diff
>> ==============================================================================
>> --- cfe/trunk/CMakeLists.txt (original)
>> +++ cfe/trunk/CMakeLists.txt Fri Feb 12 13:06:12 2016
>> @@ -677,11 +677,15 @@ if (CLANG_ENABLE_BOOTSTRAP)
>> 
>>   # If on Darwin we need to make bootstrap depend on LTO and pass
>>   # DARWIN_LTO_LIBRARY so that -flto will work using the just-built compiler
>> -  if(APPLE)
>> +  if(BOOTSTRAP_LLVM_ENABLE_LTO OR LLVM_ENABLE_LTO)
>>     set(LTO_DEP LTO llvm-ar llvm-ranlib)
>> -    set(LTO_LIBRARY -DDARWIN_LTO_LIBRARY=${LLVM_SHLIB_OUTPUT_INTDIR}/libLTO.dylib)
>>     set(LTO_AR -DCMAKE_AR=${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-ar)
>>     set(LTO_RANLIB -DCMAKE_RANLIB=${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-ranlib)
>> +    if(APPLE)
>> +      set(LTO_LIBRARY -DDARWIN_LTO_LIBRARY=${LLVM_SHLIB_OUTPUT_INTDIR}/libLTO.dylib)
>> +    elseif(NOT WIN32)
>> +      list(APPEND LTO_DEP LLVMgold)
>> +    endif()
>>   endif()
>> 
>>   add_custom_target(${NEXT_CLANG_STAGE}-clear
>> 
>> 
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


More information about the cfe-commits mailing list