[sanitizer] Handle TLS sizes for glibc < 2.13; As discussed in http://gcc.gnu.org/PR60038, the hardcoded sizeof(struct thread); patch by Jakub Jelinek

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@200733 91177308-0d34-0410-b5e6-96231b3b80d8
[sanitizer] make __tls_get_addr interceptor (more) AS-safe. No good test so far, will keep trying.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@200734 91177308-0d34-0410-b5e6-96231b3b80d8
tsan: relax check for errno spoiling more

We do not detect errno spoiling for SIGTERM,
because some SIGTERM handlers do spoil errno but reraise SIGTERM,
tsan reports false positive in such case.
It's difficult to properly detect this situation (reraise),
because in async signal processing case (when handler is called directly
from rtl_generic_sighandler) we have not yet received the reraised
signal; and it looks too fragile to intercept all ways to reraise a signal.



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@200742 91177308-0d34-0410-b5e6-96231b3b80d8
[CMake] Check that compiler supports -fno-function-sections flag

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@200746 91177308-0d34-0410-b5e6-96231b3b80d8
tsan: add SANITIZER_INTERFACE_ATTRIBUTE to more callbacks
so that it's possible to override them from a dynamic library.



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@200747 91177308-0d34-0410-b5e6-96231b3b80d8
[lsan] simplify use_tls_dynamic.cc test

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@200748 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan] Replace the call to "vname" with "WRAP(vname)" in FORMAT_INTERCEPTOR_IMPL
It's incorrect to call the function by its name in the interceptor, because that means WRAP(vname) on Linux and REAL(vname) on OSX.

This patch fixes asan/lit_tests/TestCases/printf-3.c on Mac.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@200749 91177308-0d34-0410-b5e6-96231b3b80d8
tsan: update public Go interface
in preparation for https://codereview.appspot.com/55100044



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@200750 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan] Fix printf-5.c on OSX: fix a compiler warning, avoid intercepting memcpy (which triggers the error report before printf does).



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@200751 91177308-0d34-0410-b5e6-96231b3b80d8
CMake: Enable -Werror for the -fno-function-sections check

If the -fno-function-sections flag isn't recognized, the compiler
emits a warning. This isn't enough to cause the check to fail, so we
enable -Werror as well.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@200753 91177308-0d34-0410-b5e6-96231b3b80d8
tsan: fix darwin Go build



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@200755 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan] Use replace_str=0 and replace_intrin=0 in printf-{2,4}.c to avoid triggering a buffer overflow in strlen and memcpy.
This change fixes printf-2.c and printf-4.c under OSX.



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@200756 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan] Get rid of asan_mac.h, which contents have been moved to sanitizer_mac.h


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@200757 91177308-0d34-0410-b5e6-96231b3b80d8
[CMake] Fixup for r200753

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@200761 91177308-0d34-0410-b5e6-96231b3b80d8
tsan: update Go public interface
in preparation for https://codereview.appspot.com/55100044



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


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



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



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@200780 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan/Win] Fall back to stdout if we can't print the reports to stderr

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@200804 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan/Win] Add DLL thunks for __asan_{,un}poison_memory_region

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