tsan: refactor atexit handling
The current handling (manual execution of atexit callbacks)
is overly complex and leads to constant problems due to mutual ordering of callbacks.
Instead simply wrap callbacks into our wrapper to establish
the necessary synchronization.
Fixes issue https://code.google.com/p/thread-sanitizer/issues/detail?id=80



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@219675 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] Add fast_unwind_on_check flag.

Allows to specify the unwinder to use for CHECK failures. Previous behaviour
was to use the "fatal" unwinder.
As compiler-rt is built without frame pointers, only the slow unwinder
really makes sense here, and it is the default.



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@219677 91177308-0d34-0410-b5e6-96231b3b80d8
tsan: remove trailing whitespace



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@219678 91177308-0d34-0410-b5e6-96231b3b80d8
Disable failing ASAN LongJump test on ARM

Updated the URL to reflect information on the problem as well as build the
case for ARM. This seems to be a wider problem, not ARM or PPC specific.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@219680 91177308-0d34-0410-b5e6-96231b3b80d8
Fix silly commit to disable test on ARM

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@219681 91177308-0d34-0410-b5e6-96231b3b80d8
[sanitizer] Fix a crash in FP unwinder on ARM.

This change fixes 2 issues in the fast unwinder from r217079:
* A crash if a frame pointer points below current stack head, but
  inside the current thread stack limits. That memory may be
  unmapped. A check for this was lost in r217079.
* The last valid stack frame (the first one with an invalid next
  frame pointer) is always interpreted as a GCC layout frame. This
  results in garbled last PC in the (expected) case when the last
  frame has LLVM layout.



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@219683 91177308-0d34-0410-b5e6-96231b3b80d8
[UBSan] XFAIL test added in r219642 on Darwin

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@219699 91177308-0d34-0410-b5e6-96231b3b80d8
Add complex multiply/divide functions to arm64 iOS libclang_rt libraries.

Clang r219557 introduces libcalls to complex multiply/divide functions.
Since these functions are not available in iOS for arm64 devices, add them to
the static libraries.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@219715 91177308-0d34-0410-b5e6-96231b3b80d8
Re-enable ASAN/UBSAN tests on ARM, with VFP3 they began to pass

When compiling with -mfpu=vfpv3, those tests began to pass, like the others
with "Illegal Instruction" error, so removing the XFAIL from them should
get the bot green (and have more tests!).

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@219721 91177308-0d34-0410-b5e6-96231b3b80d8
Fix compiler-rt build on FreeBSD 10.1

We have to #define _WANT_RTENTRY to get struct rtentry, and add headers
that it depends on.

SIOCADDRT and SIOCDELRT also do not exist in FreeBSD 10.1 and were removed
in FreeBSD rev. 263203:

  Garbage collect long time obsoleted (or never used) stuff from routing
  API.

Differential Revision: http://reviews.llvm.org/D5703


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@219722 91177308-0d34-0410-b5e6-96231b3b80d8
tsan: remove dead code



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@219779 91177308-0d34-0410-b5e6-96231b3b80d8
tsan: use a different dir for llvm build
build is used as gtest temp build dir, and is cleared during every build



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@219783 91177308-0d34-0410-b5e6-96231b3b80d8
tsan: fix false positive related to signals
Write interceptor calls malloc, which causes a false
unsafe-call-in-signal-handler report. See the test.



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@219784 91177308-0d34-0410-b5e6-96231b3b80d8
[Tsan] Make the mutex_robust tests Linux-specific
Differential Revision: http://reviews.llvm.org/D5729


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@219790 91177308-0d34-0410-b5e6-96231b3b80d8
[Tsan] Fix the sunrpc.cc test to build on FreeBSD
Differential Revision: http://reviews.llvm.org/D5730


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@219791 91177308-0d34-0410-b5e6-96231b3b80d8
[UBSan] [MIPS] Adding support of UBSan for mipsel arch 

Summary:
Changed files:
config-ix.cmake: Added mipsel to UBSAN_SUPPORTED_ARCH

Reviewers: rsmith, kcc, dsanders, petarj, samsonov

Reviewed By: samsonov

Subscribers: llvm-commits, mohit.bhakkad, farazs, kumarsukhani

Differential Revision: http://reviews.llvm.org/D5750

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@219822 91177308-0d34-0410-b5e6-96231b3b80d8
[CMake] Cleanup CMake rules after r219302. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@219825 91177308-0d34-0410-b5e6-96231b3b80d8
[compiler-rt] Enable ASAN for powerpc64le-linux

Whitespace update for lint check by myself (Will).  Otherwise code and comments by Peter Bergner, as previously seen on llvm-commits. 

    The following patch gets ASAN somewhat working on powerpc64le-linux.
    It currently assumes the LE kernel uses 46-bit addressing, which is
    true, but it doesn't solve the case for BE where it may be 44 or
    46 bits.  That can be fixed with a follow on patch.
    
    There are some test suite fails even with this patch that I haven't had
    time to solve yet, but this is better than the state it is in now.
    The limited debugging of those test suite fails seems to show that the
    address map for 46-bit addressing has changed and so we'll need to
    modify the shadow memory location slightly.  Again, that can be fixed
    with a follow on patch.




git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@219827 91177308-0d34-0410-b5e6-96231b3b80d8
[compiler-rt] compiler-rt's CMake append_if function clashes with LLVM's, let's rename it to append_list_if

Doing s/append_if/append_list_if/, no functional change.

http://reviews.llvm.org/D5739



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@219860 91177308-0d34-0410-b5e6-96231b3b80d8
Merge branch 'master', remote-tracking branch 'trunk/master'