I have done below explore:
> ThreadSanitizer has been added and can be enabled via -fsanitize=thread. Instructions will be instrumented to detect data races. The ThreadSanitizer is available on x86-64 GNU/Linux.
-fsanitize=thread is only support on 64bit CPU. My linux `uname -a` output is:
> Linux hl.zy 3.9.8-300.fc19.i686 #1 SMP Thu Jun 27 19:40:39 UTC 2013 i686 i686 i386 GNU/Linux
My cpu is 32bit, It's not support!
2 checked the compiler configuration, as Jonathan Leffler said:
below is output of "gcc -dumpspecs | grep tsan":
%{fsanitize=thread:%{static-libtsan:%{!shared:-Bstatic --whole-archive -ltsan --no-whole-archive -Bdynamic}}%{!static-libtsan:-ltsan}}}} %o
But I don't understand the output.
3 I have install Fedora 19 64 bit, you can install libtsan:
sudo yum install libtsan.x86_64
Conculde:
-fsanitize=thread only support on 64 bit gcc now.