I'd prefer something different: <div><br></div><div>- Don't put this into sysinfo/sysinfo.cc (we don't use it in some settings, also we may want to get rid of it eventually). </div><div>- I suggest we implement ReadProcSelfEnviron in asan_rtl.cc and then use it to implement asan_getenv() in asan_linux.cc (and in asan_mac.cc, if needed).</div>
<div>- no need for PLATFORM_WINDOWS section (yet). Such code will need to go to asan_windows.cc once we have it. </div><div>- we want to avoid memchr/memcmp/etc (use __internal* variants).</div><div>- don't fallback to libc, just do ASAN_DIE</div>
<div>- do we need HAVE___ENVIRON section? </div><div><br></div><div>--kcc </div><div><br><div class="gmail_quote">On Wed, Dec 21, 2011 at 3:57 AM, Evgeniy Stepanov <span dir="ltr"><<a href="mailto:eugeni.stepanov@gmail.com">eugeni.stepanov@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
this patch brings in the implementation of GetenvBeforeMain() from<br>
google-perftools and uses it in place of getenv(). This is required to<br>
call __asan_init from .preinit_array.<br>
</blockquote></div><br></div>