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/doc | |
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/doc')
-rw-r--r-- | gcc/doc/invoke.texi | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index a1c59f0..9c2629c 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -453,7 +453,8 @@ Objective-C and Objective-C++ Dialects}. @xref{Link Options,,Options for Linking}. @gccoptlist{@var{object-file-name} -l@var{library} @gol -nostartfiles -nodefaultlibs -nostdlib -pie -rdynamic @gol --s -static -static-libgcc -static-libasan -static-libstdc++ @gol +-s -static -static-libgcc -static-libstdc++ @gol +-static-libasan -static-libtsan @gol -shared -shared-libgcc -symbolic @gol -T @var{script} -Wl,@var{option} -Xlinker @var{option} @gol -u @var{symbol}} @@ -6862,6 +6863,12 @@ Memory access instructions will be instrumented to detect out-of-bounds and use-after-free bugs. So far only heap bugs will be detected. See @uref{http://code.google.com/p/address-sanitizer/} for more details. +@item -fsanitize=thread +Enable ThreadSanitizer, a fast data race detector. +Memory access instructions will be instrumented to detect +data race bugs. +See @uref{http://code.google.com/p/data-race-test/wiki/ThreadSanitizer} for more details. + @item -fmudflap -fmudflapth -fmudflapir @opindex fmudflap @opindex fmudflapth @@ -9947,6 +9954,15 @@ option is not used, then this links against the shared version of driver to link @file{libasan} statically, without necessarily linking other libraries statically. +@item -static-libtsan +When the @option{-fsanitize=thread} option is used to link a program, +the GCC driver automatically links against @option{libtsan}. If +@file{libtsan} is available as a shared library, and the @option{-static} +option is not used, then this links against the shared version of +@file{libtsan}. The @option{-static-libtsan} option directs the GCC +driver to link @file{libtsan} statically, without necessarily linking +other libraries statically. + @item -static-libstdc++ When the @command{g++} program is used to link a C++ program, it normally automatically links against @option{libstdc++}. If |