[PATCH] [ASan] Don't hardcode ASan runtime version in ASan dll thunk

Timur Iskhodzhanov timurrrr at google.com
Tue Jul 8 07:01:25 PDT 2014


This doesn't compile :-(

================
Comment at: lib/asan/asan_dll_thunk.cc:238
@@ -236,3 +237,3 @@
 
 INTERFACE_FUNCTION(__asan_memcpy);
 INTERFACE_FUNCTION(__asan_memset);
----------------
The thing is that `asan_interface_internal.h` defines pretty much the same set of functions that I do here using the `INTERFACE_FUNCTION` macro.  For editing simplicity reasons, the `INTERFACE_FUNCTION` macro doesn't know the argument types of the function, so we end up with conflicts between two declarations:

  asan_dll_thunk.cc(238) : error C2733: '__asan_memcpy' : second C linkage of overloaded function not allowed
        asan_interface_internal.h(156) : see declaration of '__asan_memcpy'
  asan_dll_thunk.cc(238) : error C2440: 'type cast' : cannot convert from 'overloaded-function' to '__sanitizer::uptr'
        Context does not allow for disambiguation of overloaded function

This is basically the reason why I haven't just used `__asan_init` in the first place...
Can we move declarations/definitions between headers somehow or have a minimalistic declaration-only new header for `__asan_init`?

================
Comment at: lib/asan/asan_interface_internal.h:36
@@ -35,2 +35,3 @@
   #define __asan_init __asan_init_v4
+  #define __asan_init_name "__asan_init_v4"
 
----------------
Suggestion: can probably use the `#` macro operator here?

http://reviews.llvm.org/D4411






More information about the llvm-commits mailing list