[ASan] Fix large allocator test case to cope with 64k pages

Summary: My PowerPC64 Linux box has 64k pages. The test assumes 4k pages. Fix it.

Reviewers: glider, eugenis, samsonov

Reviewed By: samsonov

Subscribers: llvm-commits

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

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

Summary:
I don't know anything about profiling but it seems to work out of the
box on PowerPC64. At least "make check-profile" works.

A few tests needed tweaking because PowerPC64 IR declares main with
"define signext i32 @main" instead of just "define i32 @main".

This also fixes the asan asan_and_llvm_coverage_test test, which
compiles with -coverage so requires that a profiling version of
libclang_rt has been built.

Reviewers: dexonsmith, kcc, samsonov

Reviewed By: samsonov

Subscribers: samsonov, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221877 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] Switch to AsanInitFromRtl in .preinit_array.

There is no functionality change due to a check in AsanActivate.



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221882 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan] Add process basename to log name and error message to simplify analysis of sanitized systems logs.

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


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221896 91177308-0d34-0410-b5e6-96231b3b80d8
Removed r221896, it seems to break build in various ways.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221912 91177308-0d34-0410-b5e6-96231b3b80d8
[CMake] Detect if -Wfoo is supported instead of -Wno-foo, as GCC occasionally silently discards unknown -Wno-foo flags.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221925 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan] Really fix zero_page_pc test for PowerPC

Summary:
As a follow-up to D6167, this patch fixes the test to account for
another difference between PowerPC and x86 systems.

On x86 if you branch to an invalid address, you get a SIGSEGV with PC
set to the invalid address (and si_addr in the siginfo struct also set
to the same address).

On PowerPC, you get a SIGSEGV with PC pointing at the branch
instruction, but si_addr set to the invalid address.

You can see this difference if you run the test case under gdb.

Reviewers: kcc, glider, samsonov

Reviewed By: samsonov

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221929 91177308-0d34-0410-b5e6-96231b3b80d8
Fix -Wcast-qual warnings in sanitizers

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221936 91177308-0d34-0410-b5e6-96231b3b80d8
[Profile] Always build profile runtime library with -fPIC.

This change removes libclang_rt.profile-pic-<arch>.a version of
profile runtime. Instead, it's sufficient to always build
libclang_rt.profile-<arch>.a with -fPIC, as it can be linked into
both executables and shared objects.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221952 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] Revert r221882.

This code is not part of ASan runtime (as it may be linked into a different
DSO), and thus can not call non-exported functions.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221986 91177308-0d34-0410-b5e6-96231b3b80d8
[sanitizer] Extend a comment in SlowUnwind.

This better explains a change in r221520.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@222000 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan] Improved stack overflow detection for PowerPC64

Summary:
AsanOnSIGSEGV has some heuristics for detecting stack overflow, but
they don't cope with a PowerPC store-with-update instruction which
modifies sp and stores to the modified address in one instruction.

This patch adds some PowerPC-specific code to check for this case.

This fixes the last few cases of the stack-overflow test.

Reviewers: kcc, samsonov, eugenis

Reviewed By: eugenis

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@222001 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] add interface function __sanitizer_get_total_unique_coverage; useful for coverage-guided in-process fuzzers

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@222060 91177308-0d34-0410-b5e6-96231b3b80d8
As a follow up to r222001, Peter Bergner pointed out that there is
nothing 64-bit-specific about the PowerPC stack overflow detection.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@222084 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan] Fix leak tests on 64-bit targets other than x86-64

Summary:
This test explicitly sets ASAN_OPTIONS=detect_leaks=1 which is only
supported on x86-64. The test is currently restricted to run only on
64-bit targets, but needs to be restricted further so it only runs on
x86-64.

Reviewers: kcc, eugenis, earthdok, samsonov

Reviewed By: samsonov

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@222091 91177308-0d34-0410-b5e6-96231b3b80d8
Revert r222091 because it caused a buildbot failure.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@222095 91177308-0d34-0410-b5e6-96231b3b80d8
tsan: add description of AcquireGlobal function



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@222228 91177308-0d34-0410-b5e6-96231b3b80d8
[msan] Remove MSanDR and supporting code.

MSanDR is a dynamic instrumentation tool that can instrument the code
(prebuilt libraries and such) that could not be instrumented at compile time.

This code is unused (to the best of our knowledge) and unmaintained, and
starting to bit-rot.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@222232 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] Fix CMake CMP0046 warning in standalone build.

Make FileCheck an "imported dependency" in standalone build.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@222234 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] Re-enable zero_page_pc test on Android.

It's not failing anymore. Not sure what has changed (the bot was down for a
long time), but lets keep it this way.


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