[compiler-rt] r189581 - [TSan] Add a couple of compiler warnings to TSan runtime compile flags

Alexey Samsonov samsonov at google.com
Thu Aug 29 05:08:36 PDT 2013


Author: samsonov
Date: Thu Aug 29 07:08:36 2013
New Revision: 189581

URL: http://llvm.org/viewvc/llvm-project?rev=189581&view=rev
Log:
[TSan] Add a couple of compiler warnings to TSan runtime compile flags

Modified:
    compiler-rt/trunk/CMakeLists.txt
    compiler-rt/trunk/lib/tsan/CMakeLists.txt

Modified: compiler-rt/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/CMakeLists.txt?rev=189581&r1=189580&r2=189581&view=diff
==============================================================================
--- compiler-rt/trunk/CMakeLists.txt (original)
+++ compiler-rt/trunk/CMakeLists.txt Thu Aug 29 07:08:36 2013
@@ -167,6 +167,8 @@ check_cxx_compiler_flag(-Wno-non-virtual
 if (SUPPORTS_NO_NON_VIRTUAL_DTOR_FLAG)
   list(APPEND SANITIZER_COMMON_CFLAGS -Wno-non-virtual-dtor)
 endif()
+check_cxx_compiler_flag(-Wglobal-constructors SUPPORTS_GLOBAL_CONSTRUCTORS_FLAG)
+# Not all sanitizers forbid global constructors.
 
 # Setup min Mac OS X version.
 if(APPLE)

Modified: compiler-rt/trunk/lib/tsan/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/CMakeLists.txt?rev=189581&r1=189580&r2=189581&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/tsan/CMakeLists.txt Thu Aug 29 07:08:36 2013
@@ -8,10 +8,14 @@ set(TSAN_CFLAGS
   ${SANITIZER_COMMON_CFLAGS}
   -fPIE
   -fno-rtti)
-# FIXME: Add support for compile flags:
-#   -Wframe-larger-than=512,
-#   -Wglobal-constructors,
-#   --sysroot=.
+
+set(TSAN_RTL_CFLAGS
+  ${TSAN_CFLAGS}
+  -Wframe-larger-than=512)
+if(SUPPORTS_GLOBAL_CONSTRUCTORS_FLAG)
+  list(APPEND TSAN_RTL_CFLAGS -Wglobal-constructors)
+endif()
+# FIXME: Add support for --sysroot=. compile flag:
 
 if("${CMAKE_BUILD_TYPE}" EQUAL "Release")
   set(TSAN_COMMON_DEFINITIONS DEBUG=0)
@@ -64,7 +68,7 @@ if(CAN_TARGET_x86_64 AND UNIX AND NOT AP
             $<TARGET_OBJECTS:RTInterception.${arch}>
             $<TARGET_OBJECTS:RTSanitizerCommon.${arch}>
             $<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}>
-    CFLAGS ${TSAN_CFLAGS}
+    CFLAGS ${TSAN_RTL_CFLAGS}
     DEFS ${TSAN_COMMON_DEFINITIONS})
   add_sanitizer_rt_symbols(clang_rt.tsan-${arch} rtl/tsan.syms.extra)
   list(APPEND TSAN_RUNTIME_LIBRARIES clang_rt.tsan-${arch}





More information about the llvm-commits mailing list