Also use --icf=safe if we are being linked by gold.
authorRafael Espindola <rafael.espindola@gmail.com>
Thu, 4 Dec 2014 22:16:08 +0000 (22:16 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Thu, 4 Dec 2014 22:16:08 +0000 (22:16 +0000)
llvm-svn: 223394

llvm/cmake/modules/AddLLVM.cmake

index 25abd72..8be70a5 100644 (file)
@@ -161,7 +161,7 @@ function(add_link_opts target_name)
   if(LLVM_LINKER_IS_GOLD)
     # With gold gc-sections is always safe.
     set_property(TARGET ${target_name} APPEND_STRING PROPERTY
-                 LINK_FLAGS " -Wl,--gc-sections")
+                 LINK_FLAGS " -Wl,--gc-sections -Wl,--icf=safe")
   endif()
 
   if(NOT LLVM_NO_DEAD_STRIP)