From: Evgeniy Stepanov Date: Wed, 7 Sep 2016 22:56:02 +0000 (+0000) Subject: [asan] Add openlog() on Android. X-Git-Tag: llvmorg-4.0.0-rc1~10396 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0b2dba1841113e4080a98111079d9014bc501357;p=platform%2Fupstream%2Fllvm.git [asan] Add openlog() on Android. Normally, syslog() uses argv[0] for the log tag; bionic, however, would crash in syslog() before libc constructor unless the log tag is explicitly set with openlog(). llvm-svn: 280875 --- diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc b/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc index a37bdf1..d3965eb 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc +++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc @@ -47,12 +47,11 @@ #if SANITIZER_ANDROID #include +#include #endif #if SANITIZER_ANDROID && __ANDROID_API__ < 21 #include -#else -#include #endif #if !SANITIZER_ANDROID @@ -521,6 +520,7 @@ uptr GetRSS() { static atomic_uint8_t android_log_initialized; void AndroidLogInit() { + openlog(GetProcessName(), 0, LOG_USER); atomic_store(&android_log_initialized, 1, memory_order_release); }