On OS X 10.11 (which is currently a public beta), the dynamic linker has been improved so that it doesn't require the use of DYLD_INSERT_LIBRARIES in order for interposition/wrappers to work. This patch adds support of this behavior into ASan – we no longer need to re-exec in case the env. variable is not set.
Since on older OS versions (10.10 and lower) we still need to keep the old behavior, this patch adds a runtime check for the OS version via GetMacosVersion. This turns out to be a little more complicated for the iOS Simulator, where this method reports the host's version and not the simulator's. Proper version checking via iOS system API is problematic to do this early in the process runtime. Instead, the patch contains a hack that checks presence of a symbol which is known to be available only on the newer system.
This is great.