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

Kostya Serebryany kcc at google.com
Wed Dec 28 15:36:26 PST 2011


r147326
This slightly different, but the idea is the same. I'm glad to get rid of
getenv.

On Wed, Dec 28, 2011 at 4:43 AM, Evgeniy Stepanov <eugeni.stepanov at gmail.com
> wrote:

> On Wed, Dec 28, 2011 at 3:08 AM, Kostya Serebryany <kcc at google.com> wrote:
> > 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/20111228/d28c664f/attachment.html>


More information about the llvm-commits mailing list