[ASan] Don't call __asan_init() from certain interceptors on Darwin.
Fixes http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58994, which hadn't manifested in LLVM because libclang_rt.asan_osx_dynamic.dylib used to depend on the Foundation framework. Without that dependency some interceptors may be called from the system libraries before libSystem_initializer() is called, which lead to assertion failures in sanitizer_mac.cc (_NSGetEnviron() returns NULL). To fix the problem we fall back to the original functions in the common libsanitizer interceptors and the __cxa_atexit() interceptor on Darwin. This patch also prints a better error message in the case _NSGetEnviron() returns NULL. llvm-svn: 194573
Loading
Please register or sign in to comment