Fix think-o from r199332 -- write to the new_filename we're building, not
filename the global variable.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@199572 91177308-0d34-0410-b5e6-96231b3b80d8
[msandr] Access app TLS directly in native exec mode.

In optimized hybrid execution we do not use DynamoRIO private loader, which
mangles TLS access, so we can access the application's TLS directly.

Patch by Qin Zhao.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@199655 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] relax the checks inside __sanitizer_annotate_contiguous_container: they are too optimistic due to https://code.google.com/p/address-sanitizer/issues/detail?id=258.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@199715 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] one more test for https://code.google.com/p/address-sanitizer/issues/detail?id=258

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@199723 91177308-0d34-0410-b5e6-96231b3b80d8
[Sanitizer] Support %.*s in internal printf implementation. Patch by Yuri Gribov.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@199724 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] Enable frame pointer based unwinder on ARM.

This code works with AAPCS-style {fp, lr} frames. Unlike linux perf, it does
not unwind through code compiled with -mapcs-frame (which Clang does not
support anyway).



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

Intercept and sanitize arguments passed to printf functions in ASan and TSan
(don't do this in MSan for now). The checks are controlled by runtime flag
(off by default for now).

Patch http://llvm-reviews.chandlerc.com/D2480 by Yuri Gribov!


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@199729 91177308-0d34-0410-b5e6-96231b3b80d8
Fix unused function warning from r199729

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@199730 91177308-0d34-0410-b5e6-96231b3b80d8
Macho-embedded: update build script for newer Clang behaviour.
    
Clang now uses the *-apple-macho triples for embedded targets using MachO. The
environment makes less pretences to be running an actual Mach kernel with all
the support that would imply, so a few changes are needed to the build scripts:
    
+ The Apple way of detecting endianness applies in all cases so drop the
  __MACH__ test.
+ A quick rename since "darwin_embedded" no longer makes any sense. If there's
  no Mach going on, there's certainly no Darwin.
+ Change how we test for support for a platform. The functions we build don't
  need any SDK support (stdio.h, ...) so we don't need to check for it.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@199731 91177308-0d34-0410-b5e6-96231b3b80d8
[Sanitizer] Update file names now that we intercept both scanf and printf

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@199735 91177308-0d34-0410-b5e6-96231b3b80d8
[Sanitizer] try harder to fix Werror build break after r199729

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@199736 91177308-0d34-0410-b5e6-96231b3b80d8
asan: fix atomic operations on ARM
implement correct atomic load/store for ARM
add test for atomic load/store
http://llvm-reviews.chandlerc.com/D2582




git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@199802 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] Enable replacement new/delete on Android.

New/delete implementations in system libraries almost always are built without
frame pointers. As we switched to frame pointer based unwinder on ARM, they no
longer work for us, resulting in broken allocation/deallocation stacks.

Note that this does not work with statically linked
libstdc++/libc++/libstlport.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@199872 91177308-0d34-0410-b5e6-96231b3b80d8
[msan] Fix GCC warnings.

warning: ISO C99 requires rest arguments to be used [enabled by default]
 INTERCEPTOR(char *, dlerror) {

warning: invoking macro INTERCEPTOR argument 3: empty macro arguments are undefined in ISO C90 and ISO C++98 [enabled by default]



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@199873 91177308-0d34-0410-b5e6-96231b3b80d8
[sanitizer] Add printf format attributes.

These were lost in a refactoring a long time ago.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@199874 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] clang-format part of asan_report.cc


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@199877 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] Print shadow memory and legend as a single printf call.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@199878 91177308-0d34-0410-b5e6-96231b3b80d8
[sanitizer] Fix format string mismatches found by format attributes added in r199874.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@199879 91177308-0d34-0410-b5e6-96231b3b80d8
[sanitizer] Add a sanity check.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@199880 91177308-0d34-0410-b5e6-96231b3b80d8
[sanitizer] Replace inline with INLINE.


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