[compiler-rt] 02997fe - Revert "[asan] Run background thread for asan only on THUMB"
Andrew Browne via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 8 16:43:39 PST 2021
Author: Andrew Browne
Date: 2021-12-08T16:41:36-08:00
New Revision: 02997febe61597b7c3f215534c5adce851ba8963
URL: https://github.com/llvm/llvm-project/commit/02997febe61597b7c3f215534c5adce851ba8963
DIFF: https://github.com/llvm/llvm-project/commit/02997febe61597b7c3f215534c5adce851ba8963.diff
LOG: Revert "[asan] Run background thread for asan only on THUMB"
This reverts commit 5c27740238007d22f2d0cd0ebe2aaffa90a9c92b.
Reverting due to Windows build issue:
sanitizer_stackdepot.cpp.obj : error LNK2005: "void __cdecl __sanitizer::StackDepotStopBackgroundThread(void)" (?StackDepotStopBackgroundThread at __sanitizer@@YAXXZ) already defined in sanitizer_common_libcdep.cpp.obj
LINK : fatal error LNK1181: cannot open input file 'projects\compiler-rt\lib\asan\CMakeFiles\RTAsan_dynamic.x86_64.dir\asan_rtl_x86_64.S.obj'
Added:
Modified:
compiler-rt/lib/asan/asan_rtl.cpp
compiler-rt/lib/sanitizer_common/sanitizer_allocator.cpp
compiler-rt/lib/sanitizer_common/sanitizer_common_libcdep.cpp
Removed:
################################################################################
diff --git a/compiler-rt/lib/asan/asan_rtl.cpp b/compiler-rt/lib/asan/asan_rtl.cpp
index f0bbbf32e6a64..35b785a79e3ef 100644
--- a/compiler-rt/lib/asan/asan_rtl.cpp
+++ b/compiler-rt/lib/asan/asan_rtl.cpp
@@ -445,9 +445,6 @@ static void AsanInitInternal() {
allocator_options.SetFrom(flags(), common_flags());
InitializeAllocator(allocator_options);
- if (SANITIZER_START_BACKGROUND_THREAD_IN_ASAN_INTERNAL)
- MaybeStartBackgroudThread();
-
// On Linux AsanThread::ThreadStart() calls malloc() that's why asan_inited
// should be set to 1 prior to initializing the threads.
asan_inited = 1;
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_allocator.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_allocator.cpp
index c5a5fb7371dd9..fd54357adbe44 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_allocator.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_allocator.cpp
@@ -189,6 +189,8 @@ bool AllocatorMayReturnNull() {
void SetAllocatorMayReturnNull(bool may_return_null) {
atomic_store(&allocator_may_return_null, may_return_null,
memory_order_relaxed);
+ if (SANITIZER_START_BACKGROUND_THREAD_IN_ASAN_INTERNAL)
+ MaybeStartBackgroudThread();
}
void PrintHintAllocatorCannotReturnNull() {
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_common_libcdep.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_common_libcdep.cpp
index fbb98265dd33e..b68392be3b3a1 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_common_libcdep.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_common_libcdep.cpp
@@ -112,8 +112,6 @@ static struct BackgroudThreadStarted {
} background_thread_strarter UNUSED;
# pragma clang diagnostic pop
# endif
-#else
-void MaybeStartBackgroudThread() {}
#endif
void WriteToSyslog(const char *msg) {
More information about the llvm-commits
mailing list