From: Peter Bergner Date: Mon, 21 Jul 2014 20:10:02 +0000 (-0500) Subject: sysv4.h (LIBASAN_EARLY_SPEC): Define. X-Git-Tag: releases/gcc-4.8.4~347 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=04e5a432ae68501d4e203e299383d72c0d3a17d0;p=thirdparty%2Fgcc.git sysv4.h (LIBASAN_EARLY_SPEC): Define. * config/rs6000/sysv4.h (LIBASAN_EARLY_SPEC): Define. (LIBTSAN_EARLY_SPEC): Likewise. (STATIC_LIBASAN_LIBS): Likewise. (STATIC_LIBTSAN_LIBS): Likewise. From-SVN: r212899 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ab9417304b54..729216b217d9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2014-07-21 Peter Bergner + + * config/rs6000/sysv4.h (LIBASAN_EARLY_SPEC): Define. + (LIBTSAN_EARLY_SPEC): Likewise. + (STATIC_LIBASAN_LIBS): Likewise. + (STATIC_LIBTSAN_LIBS): Likewise. + 2014-07-19 Eric Botcazou * toplev.c (output_stack_usage): Adjust the location of the warning. diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h index f6795b0a1583..df54b4e51923 100644 --- a/gcc/config/rs6000/sysv4.h +++ b/gcc/config/rs6000/sysv4.h @@ -949,3 +949,27 @@ ncrtn.o%s" #define TARGET_USES_SYSV4_OPT 1 #undef DBX_REGISTER_NUMBER + +/* Link -lasan early on the command line. For -static-libasan, don't link + it for -shared link, the executable should be compiled with -static-libasan + in that case, and for executable link link with --{,no-}whole-archive around + 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 "%{!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:" \ + LD_STATIC_OPTION " --whole-archive -ltsan --no-whole-archive " \ + LD_DYNAMIC_OPTION "}}%{!static-libtsan:-ltsan}" +#endif + +/* Additional libraries needed by -static-libasan. */ +#undef STATIC_LIBASAN_LIBS +#define STATIC_LIBASAN_LIBS "-ldl -lpthread" + +/* Additional libraries needed by -static-libtsan. */ +#undef STATIC_LIBTSAN_LIBS +#define STATIC_LIBTSAN_LIBS "-ldl -lpthread"