[compiler-rt] r184639 - Add cmake rules for building LSan common on Mac OS

Alexey Samsonov samsonov at google.com
Sat Jun 22 09:33:52 PDT 2013


Author: samsonov
Date: Sat Jun 22 11:33:52 2013
New Revision: 184639

URL: http://llvm.org/viewvc/llvm-project?rev=184639&view=rev
Log:
Add cmake rules for building LSan common on Mac OS

Added:
    compiler-rt/trunk/lib/asan/lit_tests/TestCases/lsan_annotations.cc
      - copied unchanged from r184638, compiler-rt/trunk/lib/asan/lit_tests/TestCases/Linux/lsan_annotations.cc
Removed:
    compiler-rt/trunk/lib/asan/lit_tests/TestCases/Linux/lsan_annotations.cc
Modified:
    compiler-rt/trunk/lib/CMakeLists.txt
    compiler-rt/trunk/lib/asan/CMakeLists.txt
    compiler-rt/trunk/lib/lsan/CMakeLists.txt

Modified: compiler-rt/trunk/lib/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/CMakeLists.txt?rev=184639&r1=184638&r2=184639&view=diff
==============================================================================
--- compiler-rt/trunk/lib/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/CMakeLists.txt Sat Jun 22 11:33:52 2013
@@ -7,6 +7,7 @@ if(CMAKE_SYSTEM_NAME MATCHES "Darwin|Lin
   add_subdirectory(interception)
   add_subdirectory(sanitizer_common)
   if(NOT ANDROID)
+    add_subdirectory(lsan)
     add_subdirectory(profile)
     add_subdirectory(ubsan)
   endif()
@@ -16,7 +17,6 @@ if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linu
   add_subdirectory(tsan)
   add_subdirectory(msan)
   add_subdirectory(msandr)
-  add_subdirectory(lsan)
 endif()
 
 # The top-level lib directory contains a large amount of C code which provides

Modified: compiler-rt/trunk/lib/asan/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/CMakeLists.txt?rev=184639&r1=184638&r2=184639&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/asan/CMakeLists.txt Sat Jun 22 11:33:52 2013
@@ -19,12 +19,10 @@ set(ASAN_SOURCES
   asan_stack.cc
   asan_stats.cc
   asan_thread.cc
-  asan_win.cc
-  )
+  asan_win.cc)
 
 set(ASAN_DYLIB_SOURCES
-  ${ASAN_SOURCES}
-  )
+  ${ASAN_SOURCES})
 
 include_directories(..)
 
@@ -58,6 +56,7 @@ if(APPLE)
     SOURCES ${ASAN_DYLIB_SOURCES}
             $<TARGET_OBJECTS:RTInterception.osx>
             $<TARGET_OBJECTS:RTSanitizerCommon.osx>
+            $<TARGET_OBJECTS:RTLSanCommon.osx>
     CFLAGS ${ASAN_CFLAGS}
     DEFS ${ASAN_COMMON_DEFINITIONS}
     # Dynamic lookup is needed because shadow scale and offset are

Removed: compiler-rt/trunk/lib/asan/lit_tests/TestCases/Linux/lsan_annotations.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/TestCases/Linux/lsan_annotations.cc?rev=184638&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/TestCases/Linux/lsan_annotations.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/TestCases/Linux/lsan_annotations.cc (removed)
@@ -1,16 +0,0 @@
-// Check that LSan annotations work fine.
-// RUN: %clangxx_asan -O0 %s -o %t && %t
-// RUN: %clangxx_asan -O3 %s -o %t && %t
-
-#include <sanitizer/lsan_interface.h>
-#include <stdlib.h>
-
-int main() {
-  int *x = new int;
-  __lsan_ignore_object(x);
-  {
-    __lsan::ScopedDisabler disabler;
-    double *y = new double;
-  }
-  return 0;
-}

Modified: compiler-rt/trunk/lib/lsan/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/lsan/CMakeLists.txt?rev=184639&r1=184638&r2=184639&view=diff
==============================================================================
--- compiler-rt/trunk/lib/lsan/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/lsan/CMakeLists.txt Sat Jun 22 11:33:52 2013
@@ -26,7 +26,12 @@ filter_available_targets(LSAN_SUPPORTED_
 
 set(LSAN_RUNTIME_LIBRARIES)
 
-if (NOT APPLE AND NOT ANDROID)
+if(APPLE)
+  add_compiler_rt_osx_object_library(RTLSanCommon
+    ARCH ${LSAN_COMMON_SUPPORTED_ARCH}
+    SOURCES ${LSAN_COMMON_SOURCES}
+    CFLAGS ${LSAN_CFLAGS})
+elseif(NOT ANDROID)
   foreach(arch ${LSAN_COMMON_SUPPORTED_ARCH})
     add_compiler_rt_object_library(RTLSanCommon ${arch}
       SOURCES ${LSAN_COMMON_SOURCES}





More information about the llvm-commits mailing list