Support traversing ELF objects for sanitizers needs on FreeBSD in 32-bit mode
Differential Revision: http://reviews.llvm.org/D4656


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@213940 91177308-0d34-0410-b5e6-96231b3b80d8
Allow initialization of Asan interceptors before the general Asan initialization takes place on FreeBSD
Differential Revision: http://reviews.llvm.org/D4496


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@213941 91177308-0d34-0410-b5e6-96231b3b80d8
tsan: fix and make faster GetRSS
It is currently broken because it reads a wrong value from profile (heap instead of total).
Also make it faster by reading /proc/self/statm. Reading of /proc/self/smaps
can consume more than 50% of time on beefy apps if done every 100ms.



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@213942 91177308-0d34-0410-b5e6-96231b3b80d8
tsan: query RSS every 100ms
Now that it become faster, it's OK to query it every 100ms again.



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@213943 91177308-0d34-0410-b5e6-96231b3b80d8
[Sanitizer] Introduce SANITIZER_CAN_USE_PREINIT_ARRAY definition and use it across sanitizers.

Get rid of ASAN_USE_PREINIT_ARRAY and LSAN_USE_PREINIT_ARRAY - just always
use .preinit_array if it's available. This mode seems stable enough, and
we've been relying on default values of these macro for a long time.



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@213980 91177308-0d34-0410-b5e6-96231b3b80d8
[UBSan] Call UBSan initialization as early as possible.

Specifically, use .preinit_array initialization on Linux and dynamic global
initializer on another platforms. Historically UBSan didn't have any
initialization code and its runtime was stateless. This is no longer the
case - UBSan relies on some non-trivial functionality from sanitizer_common
(e.g. online symbolization) and is now configurable by runtime flags.
Additionally, we've dropped support for enabling UBSan only for a few shared
objects, so UBSan is now always linked into the main executable, so now
we can use similar initialization as all the rest sanitizers.


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

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@213997 91177308-0d34-0410-b5e6-96231b3b80d8
[Sanitizer] Simplify Symbolizer creation interface.

Get rid of Symbolizer::Init(path_to_external) in favor of
thread-safe Symbolizer::GetOrInit(), and use the latter version
everywhere. Implicitly depend on the value of external_symbolizer_path
runtime flag instead of passing it around manually.

No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@214005 91177308-0d34-0410-b5e6-96231b3b80d8
[UBSan] Initialize symbolizer inside __ubsan::Init().

We used to initialize symbolizer lazily, but this doesn't work in
various sandboxed environments. Instead, let's be consistent with
the rest of sanitizers.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@214006 91177308-0d34-0410-b5e6-96231b3b80d8
builtins: make the x86_64 compatible with GAS

The .rodata directive was added on the IA-64 (Itanium) platform.  The LLVM IAS
supports the .rodata on i386 and x86_64 as well.  There is no reason to really
restrict compilation of the builtins to just clang.  By explicitly indicating
that the data is meant to be pushed into the .rodata section via the .section
.rodata, the assembly is made compatible with clang and gcc (with GAS).

This will enable building these routines on the Linux buildbots via CMake.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@214012 91177308-0d34-0410-b5e6-96231b3b80d8
builtins: re-enable building assembly sources

Re-apply SVN r213684 which was reverted in SVN r213724 since it broke the
build bots.  Add a tweak to enable inclusion of the assembly sources in
standalone build as well.

Original commit message:

This patch address the PR20360. The CMake assembler build system
ignores the .S assembly files in builtins library build. This patch
fixes the issue.

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


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