summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2012-09-24 11:43:40 +0000
committerAlexey Samsonov <samsonov@google.com>2012-09-24 11:43:40 +0000
commita555b3faf4d19fff92d5963475a9e13fa72019c0 (patch)
tree8535be380c84b11fc3ef5e6a9c3fb800e6101963 /compiler-rt/lib
parent34b46ca48e045976ab5f68d6f7aa5bd78abf465d (diff)
downloadbcm5719-llvm-a555b3faf4d19fff92d5963475a9e13fa72019c0.tar.gz
bcm5719-llvm-a555b3faf4d19fff92d5963475a9e13fa72019c0.zip
[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.
llvm-svn: 164486
Diffstat (limited to 'compiler-rt/lib')
-rw-r--r--compiler-rt/lib/CMakeLists.txt2
-rw-r--r--compiler-rt/lib/asan/asan_malloc_win.cc3
-rw-r--r--compiler-rt/lib/interception/interception.h4
-rw-r--r--compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h4
4 files changed, 10 insertions, 3 deletions
diff --git a/compiler-rt/lib/CMakeLists.txt b/compiler-rt/lib/CMakeLists.txt
index cb72594e699..a1dc48c467f 100644
--- a/compiler-rt/lib/CMakeLists.txt
+++ b/compiler-rt/lib/CMakeLists.txt
@@ -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)
diff --git a/compiler-rt/lib/asan/asan_malloc_win.cc b/compiler-rt/lib/asan/asan_malloc_win.cc
index 6c00e77caae..3ec76d89caa 100644
--- a/compiler-rt/lib/asan/asan_malloc_win.cc
+++ b/compiler-rt/lib/asan/asan_malloc_win.cc
@@ -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
diff --git a/compiler-rt/lib/interception/interception.h b/compiler-rt/lib/interception/interception.h
index 6ff7355684d..7dad07fc6eb 100644
--- a/compiler-rt/lib/interception/interception.h
+++ b/compiler-rt/lib/interception/interception.h
@@ -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
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h b/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h
index 6fdbd97584e..00549f03c00 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h
@@ -142,6 +142,8 @@ void NORETURN CheckFailed(const char *file, int line, const char *cond,
// 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 @@ void NORETURN CheckFailed(const char *file, int line, const char *cond,
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
OpenPOWER on IntegriCloud