[ubsan-minimal] Add a path for non-POSIX (and bare-metal) use of the library
[ubsan-minimal] Add a path for non-POSIX (and bare-metal) use of the library

Summary:
Hook on -DKERNEL_USE (which is also used in lib/builtins) to not import
strlen and not rely on write() being implemented with the stderr on fd 2.

With this, the only requirements to use this library are:
  - "Good enough" std::atomic<void*> and std::atomic<int>
  - abort() being implemented
  - ubsan_message(const char*) being implemented

Reviewers: eugenis

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D39791

git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@320831 91177308-0d34-0410-b5e6-96231b3b80d8

llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt