[ASan] Fix zero_page_pc test for PowerPC

Summary:
In the Power architecture, all branch instructions ignore the 2 least
significant bits of the target address. Consequently if you branch to an
invalid address, the address reported along with the SIGSEGV will have
been rounded down to a multiple of 4. Tweak this test accordingly.

This may fix the test for ARM too, in which case we could remove
the XFAIL, but I have no way of testing that.

Reviewers: kcc, willschm, glider, samsonov

Reviewed By: samsonov

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221542 91177308-0d34-0410-b5e6-96231b3b80d8
PPC fix works for ARM, too

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221551 91177308-0d34-0410-b5e6-96231b3b80d8
Use @rpath for ASan dylib in Makefiles

Reviewed at http://reviews.llvm.org/D6176



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221556 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan] Fix stack-overflow test for PowerPC

Summary:
Tweak the asan stack overflow heuristics to cope with PowerPC64 redzones,
which are larger than on x86-64: 288 bytes for big-endian and 512 bytes
for little-endian.

Reviewers: kcc, willschm, samsonov, eugenis

Reviewed By: samsonov, eugenis

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221578 91177308-0d34-0410-b5e6-96231b3b80d8
[Sanitizers] Enable stack traces on FreeBSD
Differential Revision: http://reviews.llvm.org/D6086


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221595 91177308-0d34-0410-b5e6-96231b3b80d8
[Ubsan] Fix the cast-overflow.cpp test to build on FreeBSD
Differential Revision: http://reviews.llvm.org/D6087


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221596 91177308-0d34-0410-b5e6-96231b3b80d8
[Ubsan] Fix the missing_return.cpp test to pass on FreeBSD
Differential Revision: http://reviews.llvm.org/D6088


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221597 91177308-0d34-0410-b5e6-96231b3b80d8
Enable running Ubsan tests on FreeBSD
Differential Revision: http://reviews.llvm.org/D6089


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221599 91177308-0d34-0410-b5e6-96231b3b80d8
Do not build a separate x86_64h Haswell slice for the iOS simulator.

r199996 added new x86_64h slices for all the Darwin compiler_rt libraries
that had an x86_64 slice, but that is overkill for the iOS Simulator
platform where the x86_64h slice is never used.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221610 91177308-0d34-0410-b5e6-96231b3b80d8
Build Darwin libclang_rt libraries against real SDKs.

The minimal fake SDK was very useful in allowing us to build for all
Darwin platforms without needing access to the real SDKs, but it did
not support building any of the sanitizer runtimes. It's important to
fix that. As a consequence, if you don't have the iOS SDKs installed,
we will now skip building the iOS-specific libclang_rt libraries.
rdar://problem/18825276

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221621 91177308-0d34-0410-b5e6-96231b3b80d8
Clean up indentation after previous change.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221622 91177308-0d34-0410-b5e6-96231b3b80d8
Add a missing parenthesis mistakenly dropped in r221621.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221656 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan] Fix use of -asan-instrument-assembly in tests

Summary:
The option -asan-instrument-assembly is declared in the X86 backend.
If I test on PowerPC configured with LLVM_TARGETS_TO_BUILD=All then the
option is tolerated but ignored.
If I test on PowerPC configured with LLVM_TARGETS_TO_BUILD=PowerPC then
the testsuite fails with:
[ 93%] Generating ASAN_INST_TEST_OBJECTS.gtest-all.cc.powerpc64-inline.o
clang (LLVM option parsing): Unknown command line argument '-asan-instrument-assembly'.  Try: 'clang (LLVM option parsing) -help'

Fix this inconsistency by only adding the option if that toolchain was
built with the X86 backend included.

Reviewers: kcc, samsonov, eugenis

Reviewed By: eugenis

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221687 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] fix coverage tests to use the new flag syntax (-fsanitize-coverage=N)

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221720 91177308-0d34-0410-b5e6-96231b3b80d8
delete => delete[] for arrays.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221769 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan] Skip ptrace test on non-x86 targets

Summary:
Address sanitization of ptrace(2) is only implemented for x86, so skip
the test on other targets.

Reviewers: kcc, eugenis, earthdok, samsonov

Reviewed By: samsonov

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221777 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan] Skip dump_instruction_bytes test on non-x86 targets

Summary: This test case is blatantly x86-specific, so skip it on other targets.

Reviewers: kcc, eugenis, earthdok, samsonov

Reviewed By: samsonov

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221778 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] [mips] added support of asan for mips64/mips64el, patch by Kumar Sukhani

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221800 91177308-0d34-0410-b5e6-96231b3b80d8
Add a test for PR21528 to make sure ASan C++ symbolization doesn't regress

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221814 91177308-0d34-0410-b5e6-96231b3b80d8
PR21518: Use unsigned arithmetic for trapping add/sub functions.

The code in {add,sub}v.i3 routines does not trap when it should, because
it performs the actual add/subtract operation in signed arithmetic,
rather than unsigned.

Patch by Francois-Xavie Coudert!

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