[lsan] Unbreak lsan_testlib.cc.

Also, add missing logging output.

llvm-svn: 195652
This commit is contained in:
Sergey Matveev 2013-11-25 15:54:31 +00:00
parent 583b00e60a
commit 5170bca73c
3 changed files with 9 additions and 3 deletions

View File

@ -275,6 +275,8 @@ static void ClassifyAllChunks(SuspendedThreadsList const &suspended_threads) {
// The check here is relatively expensive, so we do this in a separate flood
// fill. That way we can skip the check for chunks that are reachable
// otherwise.
if (flags()->log_pointers)
Report("Processing platform-specific allocations.\n");
ProcessPlatformSpecificAllocations(&frontier);
FloodFillTag(&frontier, kReachable);

View File

@ -14,7 +14,11 @@
#include "lsan.h"
#if !defined(PIC)
#ifndef LSAN_USE_PREINIT_ARRAY
#define LSAN_USE_PREINIT_ARRAY 1
#endif
#if LSAN_USE_PREINIT_ARRAY && !defined(PIC)
// We force __lsan_init to be called before anyone else by placing it into
// .preinit_array section.
__attribute__((section(".preinit_array"), used))

View File

@ -14,12 +14,12 @@
/* Usage:
clang++ ../sanitizer_common/sanitizer_*.cc ../interception/interception_*.cc \
lsan*.cc tests/lsan_testlib.cc -I. -I.. -g -ldl -lpthread -fPIC -shared -O2 \
-o lsan.so
-DLSAN_USE_PREINIT_ARRAY=0 -o lsan.so
LD_PRELOAD=./lsan.so /your/app
*/
#include "lsan.h"
__attribute__((constructor))
void constructor() {
__lsan::Init();
__lsan_init();
}