This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: r196201 - in /trunk: gcc/ChangeLog gcc/config/i...
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Konstantin Serebryany <konstantin dot s dot serebryany at gmail dot com>
- Cc: "Zamyatin, Igor" <igor dot zamyatin at intel dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Dodji Seketeli <dodji at redhat dot com>, Dmitry Vyukov <dvyukov at google dot com>
- Date: Fri, 8 Mar 2013 18:19:08 +0100
- Subject: Re: r196201 - in /trunk: gcc/ChangeLog gcc/config/i...
- References: <20130221105711.23596.qmail@sourceware.org> <CAGQ9bdwfaS=fPfurN+fJOgg-2s4-c23A9z97aQtVK71PjfMfQg@mail.gmail.com> <20130221132136.GZ1215@tucnak.zalov.cz> <CAGQ9bdx8Yxw=MY=+WKVeSwQ9qgDyXJFhSQxxBUrRuLM+2u8svQ@mail.gmail.com> <CAGQ9bdx1KOtGMXi1K1K8Kx34xD+23S-FOLKdjLQYW7F0r8FE5w@mail.gmail.com> <20130222125809.GK1215@tucnak.zalov.cz>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Fri, Feb 22, 2013 at 01:58:09PM +0100, Jakub Jelinek wrote:
> 2013-02-22 Jakub Jelinek <jakub@redhat.com>
>
> 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.000000000 +0100
> +++ gcc/config/gnu-user.h 2013-02-22 13:02:11.000000000 +0100
> @@ -104,11 +104,13 @@ see the files COPYING3 and COPYING.RUNTI
> it to force everything into the executable. And similarly for -ltsan. */
> #if defined(HAVE_LD_STATIC_DYNAMIC)
> #undef LIBASAN_EARLY_SPEC
> -#define LIBASAN_EARLY_SPEC "%{static-libasan:%{!shared:" \
> +#define LIBASAN_EARLY_SPEC "%{!shared:libasan_preinit%O%s} " \
> + "%{static-libasan:%{!shared:" \
> LD_STATIC_OPTION " --whole-archive -lasan --no-whole-archive " \
> LD_DYNAMIC_OPTION "}}%{!static-libasan:-lasan}"
> #undef LIBTSAN_EARLY_SPEC
> -#define LIBTSAN_EARLY_SPEC "%{static-libtsan:%{!shared:" \
> +#define LIBTSAN_EARLY_SPEC "%{!shared:libasan_preinit%O%s} " \
> + "%{static-libtsan:%{!shared:" \
> LD_STATIC_OPTION " --whole-archive -ltsan --no-whole-archive " \
> LD_DYNAMIC_OPTION "}}%{!static-libtsan:-ltsan}"
> #endif
No idea what I've been thinking that I also changed LIBTSAN_EARLY_SPEC.
Obviously for -fsanitize=thread we shouldn't link in libasan_preinit.o,
that is never going to work.
Fixed thusly, committed as obvious to trunk:
2013-03-08 Jakub Jelinek <jakub@redhat.com>
* config/gnu-user.h (LIBTSAN_EARLY_SPEC): Don't link against
libasan_preinit.o.
--- gcc/config/gnu-user.h.jj 2013-02-22 17:05:05.000000000 +0100
+++ gcc/config/gnu-user.h 2013-03-08 18:11:53.147370936 +0100
@@ -109,8 +109,7 @@ see the files COPYING3 and COPYING.RUNTI
LD_STATIC_OPTION " --whole-archive -lasan --no-whole-archive " \
LD_DYNAMIC_OPTION "}}%{!static-libasan:-lasan}"
#undef LIBTSAN_EARLY_SPEC
-#define LIBTSAN_EARLY_SPEC "%{!shared:libasan_preinit%O%s} " \
- "%{static-libtsan:%{!shared:" \
+#define LIBTSAN_EARLY_SPEC "%{static-libtsan:%{!shared:" \
LD_STATIC_OPTION " --whole-archive -ltsan --no-whole-archive " \
LD_DYNAMIC_OPTION "}}%{!static-libtsan:-ltsan}"
#endif
Jakub