]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
sysv4.h (LIBASAN_EARLY_SPEC): Define.
authorPeter Bergner <bergner@vnet.ibm.com>
Mon, 21 Jul 2014 20:10:02 +0000 (15:10 -0500)
committerPeter Bergner <bergner@gcc.gnu.org>
Mon, 21 Jul 2014 20:10:02 +0000 (15:10 -0500)
* config/rs6000/sysv4.h (LIBASAN_EARLY_SPEC): Define.
(LIBTSAN_EARLY_SPEC): Likewise.
(STATIC_LIBASAN_LIBS): Likewise.
(STATIC_LIBTSAN_LIBS): Likewise.

From-SVN: r212899

gcc/ChangeLog
gcc/config/rs6000/sysv4.h

index ab9417304b540d7f3cd2821be9bba927caea4638..729216b217d9f01f853a485b3da9ea644284402a 100644 (file)
@@ -1,3 +1,10 @@
+2014-07-21  Peter Bergner  <bergner@vnet.ibm.com>
+
+       * 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  <ebotcazou@adacore.com>
 
        * toplev.c (output_stack_usage): Adjust the location of the warning.
index f6795b0a1583a9c4e826a6f9e92decccc4542b2a..df54b4e519230845caf2232a82f24d7852cb77f5 100644 (file)
@@ -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"