[compiler-rt] Re-enable the use of -gmlt for ASan tests on Darwin

The optimization for -gmlt/-gline-tables-only introduced in r218129 happened to break on Darwin and produce no line number information due to
an incompatibility with dsymutil. ASan tests have been failing because of that and we disabled the use of -gmlt for the tests in r218545. This patch re-enables the use of -gmlt, because we have conditionally disabled the incompatible optimization in LLVM, so -gmlt now works on Darwin. Once Darwin's dsymutil is modified to allow this optimization, we can re-enable the optimization in LLVM.



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218716 91177308-0d34-0410-b5e6-96231b3b80d8
Disable the ubsan-asan config on Darwin.
UBSan doesn't work together with ASan on Darwin yet, see http://llvm.org/bugs/show_bug.cgi?id=21112


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218746 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] Tune down mmap_limit_mb test.

The memory limits were a bit too large for 32-bit Android.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218759 91177308-0d34-0410-b5e6-96231b3b80d8
[sanitizer] Add i686 arch to compiler-rt.

This is needed so we can produce -i686- named libraries for
x86 Android (which is i686-linux-android).

An alternative solution would be keeping the "i386" name internally and
tweaking the OUTPUT_NAME of compiler-rt libraries.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218761 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] Scale back mmap_limit_mb test.

There is some strange interaction between mmap limit and unlimited stack
(ulimit -s unlimited), which results in this test failing when run with
"make".


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218764 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan] Make stack-buffer-overflow reports more robust

Summary:
Fix the function that gets stack frame description by address in
thread stack, so that it clearly indicates failures. Make this error non-fatal,
and print as much information as we can in this case. Make all errors in
ParseFrameDescription non-fatal.

Test Plan: check-asan testsuite

Reviewers: kcc

Reviewed By: kcc

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218819 91177308-0d34-0410-b5e6-96231b3b80d8
[ASan] Don't use large stack buffer for local variable name in stack frame description

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218827 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] make new_array_cookie_test more robust

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218841 91177308-0d34-0410-b5e6-96231b3b80d8
[Compiler-rt][MIPS][Profile] Adding support for MIPS32/64

Summary:
Changed cmake/config-ix.cmake to add support for different MIPS architectures: mips, mipsel, mips64, mips64el
In profile code there is no target  based dependencies, so just enabling mips flag does the work. 

Patch by Mohit Bhakkad

Reviewers: dsanders, void, petarj, kcc, samsonov

Reviewed By: samsonov

Subscribers: llvm-commits, farazs, kumarsukhani

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


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218866 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] Support Android/x86 in asan_device_setup.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218968 91177308-0d34-0410-b5e6-96231b3b80d8
tsan: output stats about stackdepot in memory profiler

quite amusing on some programs:
RSS 9152 MB: shadow:2456 meta:1736 file:454 mmap:3442 trace:196 heap:866 other:0 stacks=176[1065994] nthr=157/159
...
RSS 30192 MB: shadow:613 meta:5550 file:1839 mmap:20487 trace:212 heap:1489 other:0 stacks=12870[1599445] nthr=162/165
...
RSS 42232 MB: shadow:599 meta:8199 file:2304 mmap:29420 trace:213 heap:1494 other:0 stacks=17794[1690645] nthr=162/165




git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218988 91177308-0d34-0410-b5e6-96231b3b80d8
Fix the armv7 thumb builtins on darwin

The arm builtins converted into thumb in r213481 are not working
on darwin. On apple platforms, .thumb_func directive is required
to generated correct symbols for thumb functions.

<rdar://problem/18523605>

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@219040 91177308-0d34-0410-b5e6-96231b3b80d8
Attempt to fix ARM/Linux after r219040.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@219064 91177308-0d34-0410-b5e6-96231b3b80d8
Try harder to fix ARM/Linux after r219040.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@219066 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] Minor tweak to asan_device_setup.

Add another wait-for-device which may fix a flaky setup error.
Fix output message.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@219117 91177308-0d34-0410-b5e6-96231b3b80d8
builtins: rework use of DEFINE_COMPILERRT_THUMB_FUNCTION

This is simply to help clarity of the code.  The functions are built as thumb
only if Thumb2 is available (__ARM_ARCH_ISA_THUMB == 2).  Sink the selection
into the location of the definition and make DEFINE_COMPILERRT_THUMB_FUNCTION
always define a thumb function while DEFINE_COMPILERRT_FUNCTION always selects
the default.

Since the .thumb_func directive is always available (at least on Linux, Windows,
and BSD), sinking the macro right into the macro works just as well.

No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@219182 91177308-0d34-0410-b5e6-96231b3b80d8
builtins: add missed change from previous commit

The macro rework was missing a trailing SEPARATOR for the .thumb_func, resulting
in assembly failures.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@219183 91177308-0d34-0410-b5e6-96231b3b80d8
Fixed asan-asm-stacktrace-test.cc

Summary: Fixed asan-asm-stacktrace-test.cc. Now it's supported on x86_64 and added test run when no debug info is generated.

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

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@219200 91177308-0d34-0410-b5e6-96231b3b80d8
Run profile tests on FreeBSD

FreeBSD does not have libdl, so set it via lit.cfg instead of the test
input, as with asan.  Also remove it from Darwin test runs - it's not
necessary, but harmless there.

Add FreeBSD to the list of hosts to test.

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


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@219227 91177308-0d34-0410-b5e6-96231b3b80d8
Avoid bashisms and switch to /bin/sh

Bash may not be installed on some systems by default, like FreeBSD.

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


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