Re: r196201 - in /trunk: gcc/ChangeLog gcc/config/i...

2013-03-08 Thread Jakub Jelinek
On Fri, Feb 22, 2013 at 01:58:09PM +0100, Jakub Jelinek wrote: > 2013-02-22 Jakub Jelinek > > PR sanitizer/56393 > * config/gnu-user.h (LIBASAN_EARLY_SPEC): Link in libasan_preinit.o > if not linking a shared library. > > --- gcc/config/gnu-user.h.jj 2013-02-05 16:55:01.

Re: r196201 - in /trunk: gcc/ChangeLog gcc/config/i...

2013-02-26 Thread Toon Moene
On 02/24/2013 07:20 PM, Jakub Jelinek wrote: On Fri, Feb 22, 2013 at 02:42:44PM -0800, H.J. Lu wrote: 2013-02-22 H.J. Lu * bootstrap-asan.mk (POSTSTAGE1_LDFLAGS): Add -B$$r/prev-$(TARGET_SUBDIR)/libsanitizer/asan/. diff --git a/config/bootstrap-asan.mk b/config/bootstrap-asan.

Re: r196201 - in /trunk: gcc/ChangeLog gcc/config/i...

2013-02-24 Thread Jakub Jelinek
On Fri, Feb 22, 2013 at 02:42:44PM -0800, H.J. Lu wrote: > 2013-02-22 H.J. Lu > > * bootstrap-asan.mk (POSTSTAGE1_LDFLAGS): Add > -B$$r/prev-$(TARGET_SUBDIR)/libsanitizer/asan/. > diff --git a/config/bootstrap-asan.mk b/config/bootstrap-asan.mk > index d37a9da..e3f34f5 100644 > ---

Re: r196201 - in /trunk: gcc/ChangeLog gcc/config/i...

2013-02-22 Thread H.J. Lu
On Fri, Feb 22, 2013 at 4:58 AM, Jakub Jelinek wrote: > On Fri, Feb 22, 2013 at 11:53:39AM +0400, Konstantin Serebryany wrote: >> Jakub, thanks again for cleaning up my mess. >> >> Here is a question regarding your fix: >> > -#if ASAN_USE_PREINIT_ARRAY >> > +#if ASAN_USE_PREINIT_ARRAY && !defined

Re: r196201 - in /trunk: gcc/ChangeLog gcc/config/i...

2013-02-22 Thread Jakub Jelinek
On Fri, Feb 22, 2013 at 05:56:34PM +0400, Konstantin Serebryany wrote: > Is there a use case where __attribute__((constructor)) in asan_rtl.cc > will improve our chances to run early? I was thinking about something like: cat > libab.C <<\EOF static int a[10], b; extern "C" void bar (void) __attrib

Re: r196201 - in /trunk: gcc/ChangeLog gcc/config/i...

2013-02-22 Thread Konstantin Serebryany
On Fri, Feb 22, 2013 at 4:58 PM, Jakub Jelinek wrote: > On Fri, Feb 22, 2013 at 11:53:39AM +0400, Konstantin Serebryany wrote: >> Jakub, thanks again for cleaning up my mess. >> >> Here is a question regarding your fix: >> > -#if ASAN_USE_PREINIT_ARRAY >> > +#if ASAN_USE_PREINIT_ARRAY && !defined

Re: r196201 - in /trunk: gcc/ChangeLog gcc/config/i...

2013-02-22 Thread Jakub Jelinek
On Fri, Feb 22, 2013 at 11:53:39AM +0400, Konstantin Serebryany wrote: > Jakub, thanks again for cleaning up my mess. > > Here is a question regarding your fix: > > -#if ASAN_USE_PREINIT_ARRAY > > +#if ASAN_USE_PREINIT_ARRAY && !defined (PIC) > > The PIC macro is an artifact of the GCC build syst

Re: r196201 - in /trunk: gcc/ChangeLog gcc/config/i...

2013-02-22 Thread Jakub Jelinek
On Fri, Feb 22, 2013 at 11:53:39AM +0400, Konstantin Serebryany wrote: > Jakub, thanks again for cleaning up my mess. > > Here is a question regarding your fix: > > -#if ASAN_USE_PREINIT_ARRAY > > +#if ASAN_USE_PREINIT_ARRAY && !defined (PIC) > > The PIC macro is an artifact of the GCC build syst

Re: r196201 - in /trunk: gcc/ChangeLog gcc/config/i...

2013-02-21 Thread Konstantin Serebryany
Jakub, thanks again for cleaning up my mess. Here is a question regarding your fix: > -#if ASAN_USE_PREINIT_ARRAY > +#if ASAN_USE_PREINIT_ARRAY && !defined (PIC) The PIC macro is an artifact of the GCC build system and is not directly related the the -fPIC flag? As I can see, in the gcc build we

Re: r196201 - in /trunk: gcc/ChangeLog gcc/config/i...

2013-02-21 Thread Jakub Jelinek
On Thu, Feb 21, 2013 at 05:26:30PM +0400, Konstantin Serebryany wrote: > May I ask you to commit this to gcc (I have to run away now)? I'll get it through bootstrap/regtest cycle first, commit if that succeeds. Jakub

Re: r196201 - in /trunk: gcc/ChangeLog gcc/config/i...

2013-02-21 Thread Konstantin Serebryany
On Thu, Feb 21, 2013 at 5:21 PM, Jakub Jelinek wrote: > On Thu, Feb 21, 2013 at 05:15:51PM +0400, Konstantin Serebryany wrote: >> This commit breaks the build if the BFD linker is used (I have gold on >> my box, so I missed it). >> >> Short repro: >> % cat preinit.cc >> void foo() {} >> __attribut

Re: r196201 - in /trunk: gcc/ChangeLog gcc/config/i...

2013-02-21 Thread Jakub Jelinek
On Thu, Feb 21, 2013 at 02:21:36PM +0100, Jakub Jelinek wrote: > Here is a different fix, so libasan.so will not have .preinit_array, but > libasan.a will have it. Ideally, that hunk should go into a separate > source file (asan_preinit.cc ?), be just compiled into an object file, > rather than sh

Re: r196201 - in /trunk: gcc/ChangeLog gcc/config/i...

2013-02-21 Thread Jakub Jelinek
On Thu, Feb 21, 2013 at 05:15:51PM +0400, Konstantin Serebryany wrote: > This commit breaks the build if the BFD linker is used (I have gold on > my box, so I missed it). > > Short repro: > % cat preinit.cc > void foo() {} > __attribute__((section(".preinit_array"))) void (*xxx)(void) = foo; > %