[compiler-rt] r318349 - [LSan] Export __lsan_init

Alex Shlyapnikov via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 15 15:42:48 PST 2017


Author: alekseyshl
Date: Wed Nov 15 15:42:48 2017
New Revision: 318349

URL: http://llvm.org/viewvc/llvm-project?rev=318349&view=rev
Log:
[LSan] Export __lsan_init

Summary:
lsan_preinit.cc is meant to be linked into executable and calls
lsan_init from .preinit_array section. But if liblsan is a shared library,
then this doesn't work, because the symbol is not exported. This patch fixes
that. The counterparts like asan_init or __tsan_init already do have
SANITIZER_INTERFACE_ATTRIBUTE.

Committing on behalf of jakubjelinek.

Reviewers: alekseyshl, kcc

Subscribers: llvm-commits

Differential revision: https://reviews.llvm.org/D39889

Modified:
    compiler-rt/trunk/lib/lsan/lsan.h

Modified: compiler-rt/trunk/lib/lsan/lsan.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/lsan/lsan.h?rev=318349&r1=318348&r2=318349&view=diff
==============================================================================
--- compiler-rt/trunk/lib/lsan/lsan.h (original)
+++ compiler-rt/trunk/lib/lsan/lsan.h Wed Nov 15 15:42:48 2017
@@ -64,4 +64,4 @@ void GetStackTrace(__sanitizer::Buffered
 extern bool lsan_inited;
 extern bool lsan_init_is_running;
 
-extern "C" void __lsan_init();
+extern "C" SANITIZER_INTERFACE_ATTRIBUTE void __lsan_init();




More information about the llvm-commits mailing list