[compiler-rt] r200746 - [CMake] Check that compiler supports -fno-function-sections flag

Alexey Samsonov samsonov at google.com
Tue Feb 4 00:28:17 PST 2014


Author: samsonov
Date: Tue Feb  4 02:28:17 2014
New Revision: 200746

URL: http://llvm.org/viewvc/llvm-project?rev=200746&view=rev
Log:
[CMake] Check that compiler supports -fno-function-sections flag

Modified:
    compiler-rt/trunk/CMakeLists.txt

Modified: compiler-rt/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/CMakeLists.txt?rev=200746&r1=200745&r2=200746&view=diff
==============================================================================
--- compiler-rt/trunk/CMakeLists.txt (original)
+++ compiler-rt/trunk/CMakeLists.txt Tue Feb  4 02:28:17 2014
@@ -141,9 +141,7 @@ if (NOT MSVC)
     -funwind-tables
     -fno-stack-protector
     -Wno-gnu  # Variadic macros with 0 arguments for ...
-    -fvisibility=hidden
-    -fno-function-sections
-    )
+    -fvisibility=hidden)
   if (NOT COMPILER_RT_DEBUG)
     list(APPEND SANITIZER_COMMON_CFLAGS -O3)
   endif()
@@ -165,6 +163,11 @@ if (NOT MSVC)
     list(APPEND SANITIZER_COMMON_CFLAGS -g)
   endif()
 endif()
+# Build sanitizer runtimes with -fno-function-sections.
+check_cxx_compiler_flag(-fno-function-sections SUPPORTS_FNO_FUNCTION_SECTIONS_FLAG)
+if(SUPPORTS_FNO_FUNCTION_SECTIONS_FLAG)
+  list(APPEND SANITIZER_COMMON_CFLAGS -fno-function-sections)
+endif()
 # Warnings suppressions.
 check_cxx_compiler_flag(-Wno-variadic-macros SUPPORTS_NO_VARIADIC_MACROS_FLAG)
 if(SUPPORTS_NO_VARIADIC_MACROS_FLAG)





More information about the llvm-commits mailing list