[llvm] r234159 - Don't use -ffunction-sections -fdata-sections on debug builds.

Rafael EspĂ­ndola rafael.espindola at gmail.com
Mon Apr 6 08:09:20 PDT 2015


No problem. Thanks for noticing.

I also disabled the linker optimizations, so Debug builds should be a
bit faster too.

On 6 April 2015 at 10:47, David Blaikie <dblaikie at gmail.com> wrote:
>
>
> On Mon, Apr 6, 2015 at 7:34 AM, Rafael Espindola
> <rafael.espindola at gmail.com> wrote:
>>
>> Author: rafael
>> Date: Mon Apr  6 09:34:43 2015
>> New Revision: 234159
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=234159&view=rev
>> Log:
>> Don't use -ffunction-sections -fdata-sections on debug builds.
>
>
> Thanks a bunch!
>
>>
>>
>> Unfortunately, on ELF there is not used attribute on the .o files,
>> so there is no easy way to keep the dump function alive.
>>
>> If we are not gcing, we may as well produce non gcable files and
>> avoid the cost.
>>
>> Linking a debug clang now takes 18.856225992 seconds, before it
>> took 21.206897447.
>>
>> I will try avoiding --gc-sections -O3 on a followup patch.
>>
>> Modified:
>>     llvm/trunk/cmake/modules/HandleLLVMOptions.cmake
>>
>> Modified: llvm/trunk/cmake/modules/HandleLLVMOptions.cmake
>> URL:
>> http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/HandleLLVMOptions.cmake?rev=234159&r1=234158&r2=234159&view=diff
>>
>> ==============================================================================
>> --- llvm/trunk/cmake/modules/HandleLLVMOptions.cmake (original)
>> +++ llvm/trunk/cmake/modules/HandleLLVMOptions.cmake Mon Apr  6 09:34:43
>> 2015
>> @@ -486,7 +486,8 @@ endif()
>>  # But MinSizeRel seems to add that automatically, so maybe disable these
>>  # flags instead if LLVM_NO_DEAD_STRIP is set.
>>  if(NOT CYGWIN AND NOT WIN32)
>> -  if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
>> +  if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND
>> +     NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
>>      check_c_compiler_flag("-Werror -fno-function-sections"
>> C_SUPPORTS_FNO_FUNCTION_SECTIONS)
>>      if (C_SUPPORTS_FNO_FUNCTION_SECTIONS)
>>        # Don't add -ffunction-section if it can be disabled with
>> -fno-function-sections.
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>



More information about the llvm-commits mailing list