Building with ASan giving 'undefined ___asan_init_v4'

Hi all,

I'm trying to build cmake with clang + ASan in order to run cmake's tests under ASan. Most everything works, but there's one test where I get:

Undefined symbols for architecture x86_64:
   "___asan_init_v4", referenced from:
       _asan.module_ctor in libfoo.a(foo.cpp.o)
ld: symbol(s) not found for architecture x86_64

This is on OS X 10.8, with clang trunk from a couple of days ago.

Googling ___asan_init_v4 yields next to nothing. What might be going wrong here?

Thanks,

Hi,

You should update (rebuild from trunk) the ASan runtime you use (IIRC it’s a dylib on Mac). We occasionally bump the version of __asan_init to mark the ABI changes (changes in the interface between compiler instrumentation and runtime library).