[llvm-commits] [compiler-rt] r164486 - in /compiler-rt/trunk: CMakeLists.txt include/sanitizer/common_interface_defs.h lib/CMakeLists.txt lib/asan/asan_malloc_win.cc lib/interception/interception.h lib/sanitizer_common/sanitizer_internal_defs.h

Alexey Samsonov samsonov at google.com
Mon Sep 24 04:43:40 PDT 2012


Author: samsonov
Date: Mon Sep 24 06:43:40 2012
New Revision: 164486

URL: http://llvm.org/viewvc/llvm-project?rev=164486&view=rev
Log:
[ASan] Apply some ASan-relevant pieces of patch by Ruben Van Boxem. In the same time, remove ASan from CMake build on Windows after conversation with Timur. We don't want to support building ASan on Windows until it is in a working state.

Modified:
    compiler-rt/trunk/CMakeLists.txt
    compiler-rt/trunk/include/sanitizer/common_interface_defs.h
    compiler-rt/trunk/lib/CMakeLists.txt
    compiler-rt/trunk/lib/asan/asan_malloc_win.cc
    compiler-rt/trunk/lib/interception/interception.h
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_internal_defs.h

Modified: compiler-rt/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/CMakeLists.txt?rev=164486&r1=164485&r2=164486&view=diff
==============================================================================
--- compiler-rt/trunk/CMakeLists.txt (original)
+++ compiler-rt/trunk/CMakeLists.txt Mon Sep 24 06:43:40 2012
@@ -67,9 +67,11 @@
   -fno-exceptions
   -fomit-frame-pointer
   -funwind-tables
-  -fvisibility=hidden
   -O3
   )
+if(NOT WIN32)
+  list(APPEND SANITIZER_COMMON_CFLAGS -fvisibility=hidden)
+endif()
 check_cxx_compiler_flag(-Wno-variadic-macros SUPPORTS_NO_VARIADIC_MACROS_FLAG)
 if(SUPPORTS_NO_VARIADIC_MACROS_FLAG)
   list(APPEND SANITIZER_COMMON_CFLAGS -Wno-variadic-macros)

Modified: compiler-rt/trunk/include/sanitizer/common_interface_defs.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/include/sanitizer/common_interface_defs.h?rev=164486&r1=164485&r2=164486&view=diff
==============================================================================
--- compiler-rt/trunk/include/sanitizer/common_interface_defs.h (original)
+++ compiler-rt/trunk/include/sanitizer/common_interface_defs.h Mon Sep 24 06:43:40 2012
@@ -40,8 +40,14 @@
 // in a portable way by the language itself.
 namespace __sanitizer {
 
+#if defined(_WIN64)
+// 64-bit Windows uses LLP64 data model.
+typedef unsigned long long uptr;  // NOLINT
+typedef signed   long long sptr;  // NOLINT
+#else
 typedef unsigned long uptr;  // NOLINT
 typedef signed   long sptr;  // NOLINT
+#endif  // defined(_WIN64)
 typedef unsigned char u8;
 typedef unsigned short u16;  // NOLINT
 typedef unsigned int u32;

Modified: compiler-rt/trunk/lib/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/CMakeLists.txt?rev=164486&r1=164485&r2=164486&view=diff
==============================================================================
--- compiler-rt/trunk/lib/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/CMakeLists.txt Mon Sep 24 06:43:40 2012
@@ -1,6 +1,6 @@
 # First, add the subdirectories which contain feature-based runtime libraries
 # and several convenience helper libraries.
-if(CMAKE_SYSTEM_NAME MATCHES "Darwin|Linux|Windows")
+if(CMAKE_SYSTEM_NAME MATCHES "Darwin|Linux")
   # AddressSanitizer is supported on Linux and Mac OS X.
   # Windows support is work in progress.
   add_subdirectory(asan)

Modified: compiler-rt/trunk/lib/asan/asan_malloc_win.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_malloc_win.cc?rev=164486&r1=164485&r2=164486&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_malloc_win.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_malloc_win.cc Mon Sep 24 06:43:40 2012
@@ -17,9 +17,10 @@
 #include "asan_interceptors.h"
 #include "asan_internal.h"
 #include "asan_stack.h"
-
 #include "interception/interception.h"
 
+#include <stddef.h>
+
 // ---------------------- Replacement functions ---------------- {{{1
 using namespace __asan;  // NOLINT
 

Modified: compiler-rt/trunk/lib/interception/interception.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/interception/interception.h?rev=164486&r1=164485&r2=164486&view=diff
==============================================================================
--- compiler-rt/trunk/lib/interception/interception.h (original)
+++ compiler-rt/trunk/lib/interception/interception.h Mon Sep 24 06:43:40 2012
@@ -170,7 +170,11 @@
 // challenging, as we don't even pass function type to
 // INTERCEPT_FUNCTION macro, only its name.
 namespace __interception {
+#if defined(_WIN64)
+typedef unsigned long long uptr;  // NOLINT
+#else
 typedef unsigned long uptr;  // NOLINT
+#endif  // _WIN64
 }  // namespace __interception
 
 #define INCLUDED_FROM_INTERCEPTION_LIB

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_internal_defs.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_internal_defs.h?rev=164486&r1=164485&r2=164486&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_internal_defs.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_internal_defs.h Mon Sep 24 06:43:40 2012
@@ -142,6 +142,8 @@
 
 // Limits for integral types. We have to redefine it in case we don't
 // have stdint.h (like in Visual Studio 9).
+#undef __INT64_C
+#undef __UINT64_C
 #if __WORDSIZE == 64
 # define __INT64_C(c)  c ## L
 # define __UINT64_C(c) c ## UL
@@ -164,7 +166,7 @@
 
 enum LinkerInitialized { LINKER_INITIALIZED = 0 };
 
-#if !defined(_WIN32) || defined(__clang__)
+#if !defined(_MSC_VER) || defined(__clang__)
 # define GET_CALLER_PC() (uptr)__builtin_return_address(0)
 # define GET_CURRENT_FRAME() (uptr)__builtin_frame_address(0)
 #else





More information about the llvm-commits mailing list