[PATCH] Optional support for dynamic Asan runtime

Yury Gribov tetra2005 at gmail.com
Mon Mar 31 07:11:48 PDT 2014



================
Comment at: cmake/Modules/AddCompilerRT.cmake:45
@@ +44,3 @@
+#                         DEFS <compile definitions>
+#                         OUTPUT_NAME <library name>)
+macro(add_compiler_rt_runtime name arch type)
----------------
Alexey Samsonov wrote:
> Why is the default OUTPUT_NAME not suitable here?
I want to use same name for static and dynamic runtimes but default name for dynamic is clang_rt.asan-dynamic-${arch}.

================
Comment at: lib/asan/asan_linux.cc:93
@@ +92,3 @@
+
+void AsanCheckIncompatibleRT() {
+#if !SANITIZER_ANDROID
----------------
Alexey Samsonov wrote:
> Yury Gribov wrote:
> > I think we can do this:
> > * for static rt:
> > ** check if dynamic rt in /proc/maps (and die if it's there)
> > ** set __asan_rt_version
> > * for dynamic rt:
> > ** check __asan_rt_version (and die if it's already initialized by static rt)
> > 
> > But all this looks too complicated compared to current approach (dlsym + preinit allocator).
> I think this would be easier to digest than these preinit-allocator hooks. I'd try to avoid calling functions from system libraries before ASan is initialized, by all means possible. Could you please try if this approach works?
> 
> Does anyone else have other opinions about it?
Sure I'll give it a try.


http://llvm-reviews.chandlerc.com/D3042



More information about the llvm-commits mailing list