diff options
author | Dmitry Vyukov <dvyukov@google.com> | 2012-11-22 13:56:58 -0800 |
---|---|---|
committer | Wei Mi <wmi@gcc.gnu.org> | 2012-11-22 21:56:58 +0000 |
commit | 32b4b7f53e341be663438f69fd6cb2f909427188 (patch) | |
tree | 368bbe384fc86dd4c4da764b1d83bb50a9b3ced8 /gcc/gcc.c | |
parent | bdb6985c8782cdd91a637a6d36bab4ba561c3f9b (diff) | |
download | gcc-32b4b7f53e341be663438f69fd6cb2f909427188.zip gcc-32b4b7f53e341be663438f69fd6cb2f909427188.tar.gz gcc-32b4b7f53e341be663438f69fd6cb2f909427188.tar.bz2 |
builtins.def (DEF_SANITIZER_BUILTIN): Define tsan builtins.
2012-11-22 Dmitry Vyukov <dvyukov@google.com>
Wei Mi <wmi@google.com>
* builtins.def (DEF_SANITIZER_BUILTIN): Define tsan builtins.
* sanitizer.def: Ditto.
* Makefile.in (tsan.o): Add tsan.o target.
(BUILTINS_DEF): Add sanitizer.def.
* passes.c (init_optimization_passes): Add tsan passes.
* tree-pass.h (register_pass_info): Ditto.
* toplev.c (compile_file): Ditto.
* doc/invoke.texi: Document tsan related options.
* gcc.c (LINK_COMMAND_SPEC): Add LIBTSAN_SPEC in link command if
-fsanitize=thread.
* tsan.c: New file about tsan.
* tsan.h: Ditto.
* common.opt: Add -fsanitize=thread.
Co-Authored-By: Wei Mi <wmi@google.com>
From-SVN: r193736
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r-- | gcc/gcc.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -560,6 +560,15 @@ proper position among the other output files. */ #endif #endif +#ifndef LIBTSAN_SPEC +#ifdef HAVE_LD_STATIC_DYNAMIC +#define LIBTSAN_SPEC "%{static-libtsan:" LD_STATIC_OPTION \ + "} -ltsan %{static-libtsan:" LD_DYNAMIC_OPTION "}" +#else +#define LIBTSAN_SPEC "-ltsan" +#endif +#endif + /* config.h can define LIBGCC_SPEC to override how and when libgcc.a is included. */ #ifndef LIBGCC_SPEC @@ -704,6 +713,7 @@ proper position among the other output files. */ %(mflib) " STACK_SPLIT_SPEC "\ %{fprofile-arcs|fprofile-generate*|coverage:-lgcov}\ %{fsanitize=address:" LIBASAN_SPEC "%{static:%ecannot specify -static with -fsanitize=address}}\ + %{fsanitize=thread:" LIBTSAN_SPEC "}\ %{!nostdlib:%{!nodefaultlibs:%(link_ssp) %(link_gcc_c_sequence)}}\ %{!nostdlib:%{!nostartfiles:%E}} %{T*} }}}}}}" #endif |