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

Alexey Samsonov vonosmas at gmail.com
Wed Jul 9 16:26:30 PDT 2014


================
Comment at: lib/asan/asan_dll_thunk.cc:238
@@ -236,3 +237,3 @@
 
 INTERFACE_FUNCTION(__asan_memcpy);
 INTERFACE_FUNCTION(__asan_memset);
----------------
Timur Iskhodzhanov wrote:
> 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`?
Yeah, let's create asan_init_version.h which would hold all the comments about ABI versions and have
  #define ASAN_VERSIONED_INIT __asan_init_v4
and get rid of all __asan_init mentions throughout the code.

Kostya, are you OK with that?

http://reviews.llvm.org/D4411






More information about the llvm-commits mailing list