Move lsan_check_in_progress definition to lsan_common.cc.
authorMaxim Ostapenko <m.ostapenko@samsung.com>
Mon, 26 Dec 2016 08:44:46 +0000 (11:44 +0300)
committerIvan Baravy <i.baravy@samsung.com>
Wed, 22 Feb 2017 09:32:20 +0000 (12:32 +0300)
This commit fixes undefined reference error from libasan.so:

/lib/libasan.so: undefined reference to `lsan_check_in_progress'

occurred due to ASan runtime embeds part of LSan runtime and
misses lsan_check_in_progress symbol. To overcome the issue, just move
lsan_check_in_progress definition to lsan_common.cc.

Change-Id: I9ed7f4d490d525bbf7ce054285afaec24716f35a
Signed-off-by: Maxim Ostapenko <m.ostapenko@samsung.com>
libsanitizer/lsan/lsan.cc
libsanitizer/lsan/lsan_common.cc

index 3c94c88..49b4432 100644 (file)
@@ -21,7 +21,6 @@
 
 bool lsan_inited;
 bool lsan_init_is_running;
-bool lsan_check_in_progress;
 
 namespace __lsan {
 
index 2340850..866e23f 100644 (file)
@@ -24,6 +24,9 @@
 #include "sanitizer_common/sanitizer_report_decorator.h"
 
 #if CAN_SANITIZE_LEAKS
+// TODO (chefmax): Figure out how we can avoid pollutting global namespace.
+bool lsan_check_in_progress;
+
 namespace __lsan {
 
 // This mutex is used to prevent races between DoLeakCheck and IgnoreObject, and