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