[llvm-commits] [PATCH] asan-rt: getenv() from .preinit_array

Kostya Serebryany kcc at google.com
Tue Dec 27 15:08:32 PST 2011


I'd prefer something different:

- 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).
- 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).
- no need for PLATFORM_WINDOWS section (yet). Such code will need to go to
asan_windows.cc once we have it.
- we want to avoid memchr/memcmp/etc (use __internal* variants).
- don't fallback to libc, just do ASAN_DIE
- do we need HAVE___ENVIRON section?

--kcc

On Wed, Dec 21, 2011 at 3:57 AM, Evgeniy Stepanov <eugeni.stepanov at gmail.com
> wrote:

> Hi,
>
> this patch brings in the implementation of GetenvBeforeMain() from
> google-perftools and uses it in place of getenv(). This is required to
> call __asan_init from .preinit_array.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20111227/f1d81455/attachment.html>


More information about the llvm-commits mailing list