[sanitizer] move mlock interceptor from asan/tsan/msan to common; no functionality change intended

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@216407 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan/Win] Add an extra thunk.lib to handle stack-use-after-return option

With this patch, "check-asan" passes all the tests with both MT and MD ASan RTL if you set COMPILER_RT_BUILD_SHARED_ASAN to ON
(PR20214)

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@216447 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan/Win] Rename asan_dll_thunk.cc to asan_win_dll_thunk.cc

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@216448 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan/Win] Disable warning C4391: incorrect return type for intrinsic function

This warning makes it a bit hard to define strlen and wcslen interceptors in an elegant yet portable way

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@216450 91177308-0d34-0410-b5e6-96231b3b80d8
[lsan] Implement __sanitizer_print_stack_trace() in standalone LSan.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@216454 91177308-0d34-0410-b5e6-96231b3b80d8
[lsan] Implement the public allocator interface in standalone LSan.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@216459 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] add a test for poison_array_cookie=1

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@216494 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] Restore asan-rt name on linux back to pre-r216380.

There is no reason to have different library names for shared and static
cases on linux. It also breaks Android where we install the shared asan-rt
library into the system and should keep the old name.

This change reverts most of r216380 limiting it to win32 targets only.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@216533 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan/Win] Enable building the MD runtime by default

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@216534 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] Add asprintf negative test.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@216542 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan] Whitespace fix. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@216544 91177308-0d34-0410-b5e6-96231b3b80d8
[UBSan] Temporarily disable checks for stack traces in UBSan reports on Darwin
to make the tests green.
Slow stack unwinding is disabled in libsanitizer on Darwin now.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@216657 91177308-0d34-0410-b5e6-96231b3b80d8
[ubsan] Follow-up for r216657: fixed the line numbers in the test.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@216661 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan/Win] Add the -Zl flag to avoid /DEFAULTLIB:libcmt directive in the asan_win_uar_thunk object file

This directive results in 'symbol already defined' when linking DLLs that use -MD

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@216663 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan/Win] Add a test case for r216663 [-Zl vs LIBCMT vs asan_win_uar_thunk]

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@216665 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] disable poison_array_cookie while I am investigating a false positive on chromium (I suspect that LLVM looses nosanitizer metadata; no test yet)

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@216684 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] introduce __asan_load_cxx_array_cookie: check that the array cookie address is properly poisoned and return the cookie value. If not, return 0 to avoid infinite loop of DTORs (in case of use-after-free). Calls to this function will be inserted by clang (separate change)

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@216692 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] enable poison_array_cookie back

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@216705 91177308-0d34-0410-b5e6-96231b3b80d8
tsan: unbreak windows build

Currently it fails with:

# Testing race detector.
race_windows_amd64.syso:gotsan.cc:(.text+0x4d89): undefined reference to `__imp_SymGetModuleBase64'
race_windows_amd64.syso:gotsan.cc:(.text+0x4d90): undefined reference to `__imp_SymFunctionTableAccess64'
race_windows_amd64.syso:gotsan.cc:(.text+0x4dd8): undefined reference to `__imp_StackWalk64'
x86_64-w64-mingw32/bin/ld.exe: race_windows_amd64.syso
: bad reloc address 0x10 in section `.data'
collect2.exe: error: ld returned 1 exit status




git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@216875 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan] Small refactoring - split the slow unwinding logic into sanitizer_unwind_posix.cc
This allows the slow unwinder to be used on OSX (it's disabled for now, see
https://code.google.com/p/address-sanitizer/issues/detail?id=137 for details)


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@216877 91177308-0d34-0410-b5e6-96231b3b80d8