public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Using thread sanitizer
@ 2013-03-05 23:30 Daniel B Mosesson
  0 siblings, 0 replies; only message in thread
From: Daniel B Mosesson @ 2013-03-05 23:30 UTC (permalink / raw)
  To: gcc-help

I am attempting to use -fsanitize=thread but am getting an error one
of a two ways:

Way 1: g++ dummy.cpp -g -fsanitize=thread -pthread -shared -fPIC

This compiles just fine, and claims it links fine, but in reality, it
just sits at 0 and then segfaults at start (options determined by
following error messages)

Way 2: g++ dummy.cpp -g -fsanitize=thread -pthread -pie -fPIC
/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../lib64/libasan_preinit.o:(.preinit_array+0x0):
undefined reference to `__asan_init_v1'
collect2: error: ld returned 1 exit status

The program compiles just fine with g++ dummpy.cpp

Is this problem related to the fact that gcc seems to think that it is
running on "unknown linux" as opposed to "linux-gnu"? If so, how can I
fix that issue (setting --target=x86_64-linux-gnu configurers just
fine but fails to build, even after make distclean)?

uname returns:
daniel@daniel-Virtual-Machine:~$ uname -a
Linux daniel-Virtual-Machine 3.2.0-38-generic #61-Ubuntu SMP Tue Feb
19 12:18:21 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

gcc --v:
daniel@daniel-Virtual-Machine:~$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../SomeLocalDir/configure --enable-languages=c,c++
Thread model: posix
gcc version 4.8.0 20130305 (experimental) (GCC)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-03-05 23:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-05 23:30 Using thread sanitizer Daniel B Mosesson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).