[llvm-commits] [compiler-rt] r163204 - in /compiler-rt/trunk: CMakeLists.txt lib/asan/CMakeLists.txt lib/asan/tests/CMakeLists.txt lib/interception/CMakeLists.txt lib/sanitizer_common/CMakeLists.txt

Alexey Samsonov samsonov at google.com
Wed Sep 5 02:00:03 PDT 2012


Author: samsonov
Date: Wed Sep  5 04:00:03 2012
New Revision: 163204

URL: http://llvm.org/viewvc/llvm-project?rev=163204&view=rev
Log:
[ASan] hoist more compile flags to SANITIZER_COMMON_CFLAGS var and add the rest of flags/defs from old Makefile to CMake

Modified:
    compiler-rt/trunk/CMakeLists.txt
    compiler-rt/trunk/lib/asan/CMakeLists.txt
    compiler-rt/trunk/lib/asan/tests/CMakeLists.txt
    compiler-rt/trunk/lib/interception/CMakeLists.txt
    compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt

Modified: compiler-rt/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/CMakeLists.txt?rev=163204&r1=163203&r2=163204&view=diff
==============================================================================
--- compiler-rt/trunk/CMakeLists.txt (original)
+++ compiler-rt/trunk/CMakeLists.txt Wed Sep  5 04:00:03 2012
@@ -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

Modified: compiler-rt/trunk/lib/asan/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/CMakeLists.txt?rev=163204&r1=163203&r2=163204&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/asan/CMakeLists.txt Wed Sep  5 04:00:03 2012
@@ -28,11 +28,12 @@
 
 include_directories(..)
 
-set(ASAN_CFLAGS
-  ${SANITIZER_COMMON_CFLAGS}
-  -fno-builtin
-  -fomit-frame-pointer
-  -O3
+set(ASAN_CFLAGS ${SANITIZER_COMMON_CFLAGS})
+
+set(ASAN_COMMON_DEFINITIONS
+  ASAN_HAS_EXCEPTIONS=1
+  ASAN_FLEXIBLE_MAPPING_AND_OFFSET=0
+  ASAN_NEEDS_SEGV=1
   )
 
 set(ASAN_DYLIB_DEFINITIONS
@@ -40,15 +41,6 @@
   MAC_INTERPOSE_FUNCTIONS=1
   )
 
-if (APPLE)
-  list(APPEND ASAN_CFLAGS -mmacosx-version-min=10.5)
-endif()
-
-set(ASAN_COMMON_DEFINITIONS
-  ASAN_HAS_EXCEPTIONS=1
-  ASAN_NEEDS_SEGV=1
-  )
-
 set(ASAN_RUNTIME_LIBRARIES)
 if(APPLE)
   # Build universal binary on APPLE.

Modified: compiler-rt/trunk/lib/asan/tests/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/tests/CMakeLists.txt?rev=163204&r1=163203&r2=163204&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/tests/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/asan/tests/CMakeLists.txt Wed Sep  5 04:00:03 2012
@@ -46,6 +46,11 @@
   ${ASAN_GTEST_INCLUDE_CFLAGS}
   -faddress-sanitizer
   -mllvm "-asan-blacklist=${CMAKE_CURRENT_SOURCE_DIR}/asan_test.ignore"
+  -mllvm -asan-stack=1
+  -mllvm -asan-globals=1
+  -mllvm -asan-mapping-scale=0        # default will be used
+  -mllvm -asan-mapping-offset-log=-1  # default will be used
+  -mllvm -asan-use-after-return=0
 )
 
 function(add_asan_test testsuite testname)

Modified: compiler-rt/trunk/lib/interception/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/interception/CMakeLists.txt?rev=163204&r1=163203&r2=163204&view=diff
==============================================================================
--- compiler-rt/trunk/lib/interception/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/interception/CMakeLists.txt Wed Sep  5 04:00:03 2012
@@ -13,7 +13,7 @@
   list(APPEND INTERCEPTION_SOURCES mach_override/mach_override.c)
 endif ()
 
-set(INTERCEPTION_CFLAGS -O3 ${SANITIZER_COMMON_CFLAGS})
+set(INTERCEPTION_CFLAGS ${SANITIZER_COMMON_CFLAGS})
 
 if(APPLE)
   # Build universal binary on APPLE.

Modified: compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt?rev=163204&r1=163203&r2=163204&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt Wed Sep  5 04:00:03 2012
@@ -18,7 +18,7 @@
   sanitizer_win.cc
   )
 
-set(SANITIZER_CFLAGS -O3 ${SANITIZER_COMMON_CFLAGS})
+set(SANITIZER_CFLAGS ${SANITIZER_COMMON_CFLAGS})
 
 set(SANITIZER_COMMON_DEFINITIONS)
 





More information about the llvm-commits mailing list