diff options
author | Timur Iskhodzhanov <timurrrr@google.com> | 2014-08-22 12:38:07 +0000 |
---|---|---|
committer | Timur Iskhodzhanov <timurrrr@google.com> | 2014-08-22 12:38:07 +0000 |
commit | 220ddacf8d5861a38e2edfdf3caae13ebfdde0f9 (patch) | |
tree | 83eda6d9284a634cd865c8275b01c886e3a512ec /compiler-rt | |
parent | f2d24473fedb94c95ed6226d7805de1bcc10a047 (diff) | |
download | bcm5719-llvm-220ddacf8d5861a38e2edfdf3caae13ebfdde0f9.tar.gz bcm5719-llvm-220ddacf8d5861a38e2edfdf3caae13ebfdde0f9.zip |
[ASan/Win] Land the trivial bits of -MD RTL support (PR20214)
llvm-svn: 216265
Diffstat (limited to 'compiler-rt')
-rw-r--r-- | compiler-rt/lib/asan/asan_interceptors.cc | 4 | ||||
-rw-r--r-- | compiler-rt/lib/asan/asan_win.cc | 2 | ||||
-rw-r--r-- | compiler-rt/lib/interception/interception.h | 12 | ||||
-rw-r--r-- | compiler-rt/lib/interception/interception_win.cc | 1 | ||||
-rw-r--r-- | compiler-rt/test/asan/lit.cfg | 2 |
5 files changed, 11 insertions, 10 deletions
diff --git a/compiler-rt/lib/asan/asan_interceptors.cc b/compiler-rt/lib/asan/asan_interceptors.cc index 16f2c512521..8ec2c27c453 100644 --- a/compiler-rt/lib/asan/asan_interceptors.cc +++ b/compiler-rt/lib/asan/asan_interceptors.cc @@ -309,6 +309,10 @@ INTERCEPTOR(int, _except_handler3, void *a, void *b, void *c, void *d) { return REAL(_except_handler3)(a, b, c, d); } +#if ASAN_DYNAMIC +// This handler is named differently in -MT and -MD CRTs. +#define _except_handler4 _except_handler4_common +#endif INTERCEPTOR(int, _except_handler4, void *a, void *b, void *c, void *d) { CHECK(REAL(_except_handler4)); __asan_handle_no_return(); diff --git a/compiler-rt/lib/asan/asan_win.cc b/compiler-rt/lib/asan/asan_win.cc index 162393c6477..ade28c0d41b 100644 --- a/compiler-rt/lib/asan/asan_win.cc +++ b/compiler-rt/lib/asan/asan_win.cc @@ -71,7 +71,7 @@ void *AsanDoesNotSupportStaticLinkage() { return 0; } -void AsanCheckDynamicRTPrereqs() { UNIMPLEMENTED(); } +void AsanCheckDynamicRTPrereqs() {} void AsanCheckIncompatibleRT() {} diff --git a/compiler-rt/lib/interception/interception.h b/compiler-rt/lib/interception/interception.h index 743c88dd745..52573258bf9 100644 --- a/compiler-rt/lib/interception/interception.h +++ b/compiler-rt/lib/interception/interception.h @@ -122,15 +122,9 @@ const interpose_substitution substitution_##func_name[] \ # define DECLARE_WRAPPER(ret_type, func, ...) #elif defined(_WIN32) -# if defined(_DLL) // DLL CRT -# define WRAP(x) x -# define WRAPPER_NAME(x) #x -# define INTERCEPTOR_ATTRIBUTE -# else // Static CRT -# define WRAP(x) __asan_wrap_##x -# define WRAPPER_NAME(x) "__asan_wrap_"#x -# define INTERCEPTOR_ATTRIBUTE __declspec(dllexport) -# endif +# define WRAP(x) __asan_wrap_##x +# define WRAPPER_NAME(x) "__asan_wrap_"#x +# define INTERCEPTOR_ATTRIBUTE __declspec(dllexport) # define DECLARE_WRAPPER(ret_type, func, ...) \ extern "C" ret_type func(__VA_ARGS__); # define DECLARE_WRAPPER_WINAPI(ret_type, func, ...) \ diff --git a/compiler-rt/lib/interception/interception_win.cc b/compiler-rt/lib/interception/interception_win.cc index a20939c7772..9a5fb67fe25 100644 --- a/compiler-rt/lib/interception/interception_win.cc +++ b/compiler-rt/lib/interception/interception_win.cc @@ -96,6 +96,7 @@ static size_t RoundUpToInstrBoundary(size_t size, char *code) { case 0x458B: // 8B 45 XX = mov eax, dword ptr [ebp+XXh] case 0x5D8B: // 8B 5D XX = mov ebx, dword ptr [ebp+XXh] case 0xEC83: // 83 EC XX = sub esp, XX + case 0x75FF: // FF 75 XX = push dword ptr [ebp+XXh] cursor += 3; continue; case 0xC1F7: // F7 C1 XX YY ZZ WW = test ecx, WWZZYYXX diff --git a/compiler-rt/test/asan/lit.cfg b/compiler-rt/test/asan/lit.cfg index 6bcbfdae44d..eda25bf4e82 100644 --- a/compiler-rt/test/asan/lit.cfg +++ b/compiler-rt/test/asan/lit.cfg @@ -81,6 +81,8 @@ if platform.system() == 'Windows': "-WX", "-D_HAS_EXCEPTIONS=0", "-Zi"] + target_cflags + if config.asan_dynamic: + clang_cl_asan_cxxflags.append("-MD") clang_invocation = build_invocation(clang_cl_asan_cxxflags) clang_cl_invocation = clang_invocation.replace("clang.exe","clang-cl.exe") config.substitutions.append( ("%clang_cl_asan ", clang_cl_invocation) ) |