summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2014-02-04 08:28:17 +0000
committerAlexey Samsonov <samsonov@google.com>2014-02-04 08:28:17 +0000
commit4495eb891e2319067e9f3ea135f39c8dc400d714 (patch)
tree87e86b054499fac7da9fb33309af720c1982971b /CMakeLists.txt
parentdd68b3a723e4f071b12762ae0f12a3bdd0fde2b5 (diff)
[CMake] Check that compiler supports -fno-function-sections flag
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@200746 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt9
1 files changed, 6 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 06c6880c6..dbae1ccc1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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)