[sanitizer] Sanitizer __internal_*stat interface.

With this change, __internal_*stat always expect a "struct stat *" argument.
This avoids stat/stat64 caller-side confusion (sanitizer_common tests already
made this mistake), and allows the use of __internal_fstat() as a drop-in
replacement for libc's fstat().


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@181311 91177308-0d34-0410-b5e6-96231b3b80d8
[sanitizer] Move GetThreadStackAndTls from TSan to sanitizer_common.

Move this function to sanitizer_common because LSan uses it too. Also, fix a bug
where the TLS range reported for main thread was off by the size of the thread
descriptor from libc (TSan doesn't care much, but for LSan it's critical).

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@181322 91177308-0d34-0410-b5e6-96231b3b80d8
[sanitizer] Fixed includes in sanitizer_linux.cc for Android.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@181327 91177308-0d34-0410-b5e6-96231b3b80d8
[sanitizer] Fixed InitTlsSize for Android.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@181330 91177308-0d34-0410-b5e6-96231b3b80d8
[nolibc] Disable the GCC stack protector when building sanitizer runtimes.

This is the first in a sequence of changes designed to eliminate the
libc dependency in sanitizer_common.  The main motivation for these
changes is to be able to provide an alternative for the current
interceptor-based technique for instrumenting functions in libc.
In this new technique, we compile libc with instrumentation.  This has
the potential advantages of being more accurate than interception and
reducing the amount of custom code required for each libc function.
As a side effect of this, we cannot depend on libc in the sanitizer
runtime due to mutual dependency issues.

This change disables the GCC stack protector, which introduces a libc
dependency and is enabled by default in Ubuntu.

Differential Revision: http://llvm-reviews.chandlerc.com/D755

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@181422 91177308-0d34-0410-b5e6-96231b3b80d8
[sanitizer] Move GetStackTrace from ASan to sanitizer_common.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@181424 91177308-0d34-0410-b5e6-96231b3b80d8
[sanitizer] Fix build breakage in Go TSan.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@181428 91177308-0d34-0410-b5e6-96231b3b80d8
Quick fix for ASan test build on Android.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@181429 91177308-0d34-0410-b5e6-96231b3b80d8
[nolibc] Change internal syscall API to remove reliance on libc's errno.

This change moves to a model where the error value of a system call is
potentially contained in the return value itself rather than being
implicit in errno.  The helper function internal_iserror can be used
to extract the error value from a return value.  On platforms other
than Linux/x86_64 this still uses errno, but other platforms are free
to port their error handling to this new model.

Differential Revision: http://llvm-reviews.chandlerc.com/D756

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@181436 91177308-0d34-0410-b5e6-96231b3b80d8
Try to fix the mac buildbots

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@181440 91177308-0d34-0410-b5e6-96231b3b80d8
Try to fix Windows build too

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