[ASan] hoist more compile flags to SANITIZER_COMMON_CFLAGS var and add the rest of flags/defs from old Makefile to CMake
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@163204 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 17268c8..0820360 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -77,9 +77,12 @@
# Provide some common commmandline flags for Sanitizer runtimes.
set(SANITIZER_COMMON_CFLAGS
-fPIC
+ -fno-builtin
-fno-exceptions
+ -fomit-frame-pointer
-funwind-tables
-fvisibility=hidden
+ -O3
)
if(SUPPORTS_NO_VARIADIC_MACROS_FLAG)
list(APPEND SANITIZER_COMMON_CFLAGS -Wno-variadic-macros)
@@ -89,6 +92,9 @@
if(SUPPORTS_NO_C99_EXTENSIONS_FLAG)
list(APPEND SANITIZER_COMMON_CFLAGS -Wno-c99-extensions)
endif()
+if(APPLE)
+ list(APPEND SANITIZER_COMMON_CFLAGS -mmacosx-version-min=10.5)
+endif()
# Because compiler-rt spends a lot of time setting up custom compile flags,
# define a handy helper function for it. The compile flags setting in CMake