From 32b4b7f53e341be663438f69fd6cb2f909427188 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 22 Nov 2012 13:56:58 -0800 Subject: builtins.def (DEF_SANITIZER_BUILTIN): Define tsan builtins. 2012-11-22 Dmitry Vyukov Wei Mi * 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 From-SVN: r193736 --- gcc/doc/invoke.texi | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'gcc/doc') 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 -- cgit v1.1