[ASan] Fix a thinko spotted by Evgeniy Stepanov: use REAL(memcpy) on non-OSX systems.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204794 91177308-0d34-0410-b5e6-96231b3b80d8
Define uintptr_t in the profiling sources on x86_64 FreeBSD in 32-bit mode

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204799 91177308-0d34-0410-b5e6-96231b3b80d8
[sanitizer] Intercept __aeabi_mem(set|cpy|move).


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204800 91177308-0d34-0410-b5e6-96231b3b80d8
tsan: fix another compiler-injected memset
newer gcc inserts memset here



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204808 91177308-0d34-0410-b5e6-96231b3b80d8
tsan: fix deadlock during fork
ReportRace takes the two mutexes in the opposite order



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204809 91177308-0d34-0410-b5e6-96231b3b80d8
tsan: add pthread_barrier_t test



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204810 91177308-0d34-0410-b5e6-96231b3b80d8
Avoid aliases to weak aliases in interceptors.

The interceptors had code that after macro expansion ended up looking like

extern "C" void memalign()
    __attribute__((weak, alias("__interceptor_memalign")));
extern "C" void __interceptor_memalign() {}
extern "C" void __interceptor___libc_memalign()
    __attribute__((alias("memalign")));

That is,
* __interceptor_memalign is a function
* memalign is a weak alias to __interceptor_memalign
* __interceptor___libc_memalign is an alias to memalign

Both gcc and clang produce assembly that look like

__interceptor_memalign:
...
        .weak   memalign
memalign = __interceptor_memalign
        .globl  __interceptor___libc_memalign
__interceptor___libc_memalign = memalign

What it means in the end is that we have 3 symbols pointing to the
same position in the file, one of which is weak:

     8: 0000000000000000     1 FUNC    GLOBAL DEFAULT    1
__interceptor_memalign
     9: 0000000000000000     1 FUNC    WEAK   DEFAULT    1 memalign
    10: 0000000000000000     1 FUNC    GLOBAL DEFAULT    1
__interceptor___libc_memalign

In particular, note that __interceptor___libc_memalign will always
point to __interceptor_memalign, even if we do link in a strong symbol
for memalign. In fact, the above code produces exactly the same binary
as

extern "C" void memalign()
    __attribute__((weak, alias("__interceptor_memalign")));
extern "C" void __interceptor_memalign() {}
extern "C" void __interceptor___libc_memalign()
    __attribute__((alias("__interceptor_memalign")));

If nothing else, this patch makes it more obvious what is going on.

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


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204824 91177308-0d34-0410-b5e6-96231b3b80d8
Add function to get the number of DFSan labels allocated.

Expose the number of DFSan labels allocated by adding function dfsan_get_label_count().

Patch by Sam Kerner!

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

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204854 91177308-0d34-0410-b5e6-96231b3b80d8
Allow the user to override the compiler used for testing

Change-Id: Ida62c2d85f541260f505c3dbd5d71a4b2a6004f4

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204877 91177308-0d34-0410-b5e6-96231b3b80d8
Revert r204877 "Allow the user to override the compiler used for testing"

Unbreak the sanitizer-x86_64-linux bot.

Change-Id: Ie03f1b93fae45c54b142003731ff4f5d4f6b62f8

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204886 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] Do not sanitize kernel area on 32-bit targets, patch by Yuri Gribov

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

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204903 91177308-0d34-0410-b5e6-96231b3b80d8
[msan] Intercept several malloc-related functions.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204923 91177308-0d34-0410-b5e6-96231b3b80d8
Add support for _expand[_dbg] so we don't crash when _aligned_* allocation functions are used

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204925 91177308-0d34-0410-b5e6-96231b3b80d8
[msan] Implement __msan_set_death_callback.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204926 91177308-0d34-0410-b5e6-96231b3b80d8
[sanitizer] Fix Android build.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204927 91177308-0d34-0410-b5e6-96231b3b80d8
[sanitizer] Intercept __bzero on Mac.

This should make memset_test pass on Mac.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204929 91177308-0d34-0410-b5e6-96231b3b80d8
[sanitizer] Intercept ftime.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204991 91177308-0d34-0410-b5e6-96231b3b80d8
[sanitizer] Intercept mktime.


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