[UBSan] Build part of UBSan runtime that can be linked into C programs with -fno-rtti flag.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@214232 91177308-0d34-0410-b5e6-96231b3b80d8
[UBSan] Get pc/bp for stack unwinding as early as possible.

This will ensure that stack frames in error reports will not
contain internal UBSan failures, and frame #0 will be the
actual place in the program where the error happens.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@214245 91177308-0d34-0410-b5e6-96231b3b80d8
[UBSan] Move all runtime flags parsing to ubsan_flags.cc.

No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@214258 91177308-0d34-0410-b5e6-96231b3b80d8
[UBSan] Allow to override runtime flags defaults by providing
compile definition UBSAN_DEFAULT_OPTIONS when building the runtime.
This mirrors similar ASan functionality.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@214259 91177308-0d34-0410-b5e6-96231b3b80d8
[UBSan] Introduce ScopedReport object.

This object is used to encapsulate all actions that need to be
done before/after printing UBSan diagnostics. Currently these
actions are:
* locking a mutex to ensure that UBSan diagnostics from several
threads won't mix with each other and with other sanitizers' 
reports
* killing a program once the report is printed (if necessary).

Use this object in all UBSan handlers. Unify the way we implement
fatal and non-fatal handlers by making all the handlers simple
one-liners that redirect __ubsan_handle_foo(_abort)? to
handleFooImpl().


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@214279 91177308-0d34-0410-b5e6-96231b3b80d8
[msan] Use SIGHUP instead of SIGUSR1 in test.

Apparently, SIGUSR1 does not work on x86_64+ArchLinux for some reason.

For more details, see:
https://groups.google.com/forum/#!topic/llvm-dev/4Ag1FF4M2Dw


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