[PATCH] D29132: [sanitizer] Remove -fno-function-sections from SANITIZER_COMMON_CFLAGS

Kostya Kortchinsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 25 10:00:54 PST 2017


cryptoad created this revision.
Herald added a subscriber: mgorny.

-fno-function-sections was added as a default Sanitizer common cflag with
https://reviews.llvm.org/rL200683, the reasoning behind was that things would
break if linked with --gc-sections.

This appears to not be necessary anymore, as tests pass without, including
function-sections-are-bad.cc. There is a large benefit to having
function-sections when dealing with static libraries in terms of size and
dependencies that go away with --gc-sections.


https://reviews.llvm.org/D29132

Files:
  CMakeLists.txt


Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -142,7 +142,6 @@
 append_list_if(COMPILER_RT_HAS_FNO_SANITIZE_SAFE_STACK_FLAG -fno-sanitize=safe-stack SANITIZER_COMMON_CFLAGS)
 append_list_if(COMPILER_RT_HAS_FVISIBILITY_HIDDEN_FLAG -fvisibility=hidden SANITIZER_COMMON_CFLAGS)
 append_list_if(COMPILER_RT_HAS_FVISIBILITY_INLINES_HIDDEN_FLAG -fvisibility-inlines-hidden SANITIZER_COMMON_CFLAGS)
-append_list_if(COMPILER_RT_HAS_FNO_FUNCTION_SECTIONS_FLAG -fno-function-sections SANITIZER_COMMON_CFLAGS)
 append_list_if(COMPILER_RT_HAS_FNO_LTO_FLAG -fno-lto SANITIZER_COMMON_CFLAGS)
 
 if(MSVC)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29132.85771.patch
Type: text/x-patch
Size: 675 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170125/8391b4f2/attachment.bin>


More information about the llvm-commits mailing list