tsan: do not deadlock on fork

Currently correct programs can deadlock after fork, because atomic operations and async-signal-safe calls are not async-signal-safe under tsan.
With this change:
- if a single-threaded program forks, the child continues running with verification enabled (the tsan background thread is recreated as well)
- if a multi-threaded program forks, then the child runs with verification disabled (memory accesses, atomic operations and interceptors are disabled); it's expected that it will exec soon anyway
- if the child tries to create more threads after multi-threaded fork, the program aborts with error message
- die_after_fork flag is added that allows to continue running, but all bets are off

http://llvm-reviews.chandlerc.com/D2614




git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@199993 91177308-0d34-0410-b5e6-96231b3b80d8
Darwin: add x86_64h slice for Haswell.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@199996 91177308-0d34-0410-b5e6-96231b3b80d8
Implement __ARM_ARCH if the compiler lacks it. Add feature tests for bx and clz.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@199998 91177308-0d34-0410-b5e6-96231b3b80d8
Provide support for ARMv4, lacking bx and clz. Unroll the
test-and-subtract loop and compute the initial block as address,
shaving off between 5% and 10% on Cortex A9 and 30%+ a Raspberry Pi.
Code written by Matt Thomas and Joerg Sonnenberger.

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


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@200001 91177308-0d34-0410-b5e6-96231b3b80d8
tsan: fix test relying on assert



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@200002 91177308-0d34-0410-b5e6-96231b3b80d8
tsan: fix signal handling
We left ignore_interceptors>0 when calling signal handlers
from blocking interceptors, this leads to missing synchronization in such signal handler.




git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@200003 91177308-0d34-0410-b5e6-96231b3b80d8
Mechanically add end-of-function markers.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@200005 91177308-0d34-0410-b5e6-96231b3b80d8
Add end-of-function markers.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@200006 91177308-0d34-0410-b5e6-96231b3b80d8
Add end-of-function markers.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@200007 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] Add an ASan-on-Android installation script.


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


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@200012 91177308-0d34-0410-b5e6-96231b3b80d8
tsan: fix test for -O2
otherwise races are suppressed due to "same stack"



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@200015 91177308-0d34-0410-b5e6-96231b3b80d8
Don't use .arm for ARMv7M, which will use the hwdiv path. Non-hwdiv
remains ARM mode only, supporting thumb requires explicit it prefixes
for the predicted adds/subs and adjusting the offset computation for the
different block sizes.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@200035 91177308-0d34-0410-b5e6-96231b3b80d8
Fix a typo "endi" -> "endif" in r200035.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@200039 91177308-0d34-0410-b5e6-96231b3b80d8
ARM: remove unnecessary .arm directive

It was redundant (since ARM mode is the default) and misleading since
(e.g.) Cortex-A15 would not satisfy the #ifdef but would be in ARM
mode regardless.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@200043 91177308-0d34-0410-b5e6-96231b3b80d8
ARM: also remove useless .arm directive from other files

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