gcc 4.8.1 says "cannot find -ltsan"

892 views
Skip to first unread message

hust hl

unread,
Jul 6, 2013, 5:12:42 AM7/6/13
to thread-s...@googlegroups.com
My gcc version on Fedora 19:
    gcc version 4.8.1 20130603 (Red Hat 4.8.1-1) (GCC)

Link my program with below command (output of CMake):

Linking C executable bin/ftu
/usr/bin/cmake -E cmake_link_script CMakeFiles/ftu.dir/link.txt --verbose=1
/usr/bin/cc  -g -g -O0 -Wall -D_REENTRANT  -rdynamic -fsanitize=thread -fPIE -pie    CMakeFiles/ftu.dir/src/main/main.c.o  -o bin/ftu  -L/home/hl/ftu/arm/src/libapp/pc -rdynamic ../libapp/pc/libbase.a ../libapp/pc/libstbl.a ../libapp/pc/libstbl_utest.a ../libapp/pc/libbase_utest.a ../libapp/pc/libmem_utest.a ../libapp/pc/libmemspy_utest.a ../libapp/pc/libos_utest.a ../libapp/pc/libmain_utest.a ../libapp/pc/liblog_utest.a ../libapp/pc/libini_utest.a ../libapp/pc/libdsp_utest.a ../libapp/pc/libmstation_utest.a ../libapp/pc/libflist_utest.a ../libapp/pc/libdc_utest.a ../libapp/pc/libflist.a ../libapp/pc/libdsp.a ../libapp/pc/liblog.a ../libapp/pc/libini.a ../libapp/pc/libmstation.a ../libapp/pc/libdc.a ../libapp/pc/libmemspy.a ../libapp/pc/libmem.a ../libapp/pc/libos.a ../libapp/pc/libbase.a -lrt -lpopt -lpthread -Wl,-rpath,/home/hl/ftu/arm/src/libapp/pc
/usr/bin/ld: cannot find -ltsan
collect2: error: ld returned 1 exit status

Gcc says "cannot find -ltsan". Where is libtsan exist?

hust hl

unread,
Jul 9, 2013, 3:02:50 AM7/9/13
to thread-s...@googlegroups.com

I have done below explore:

1   I found something on http://gcc.gnu.org/gcc-4.8/changes.html:

> 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.
    

Alexey Samsonov

unread,
Jul 9, 2013, 5:23:15 AM7/9/13
to thread-s...@googlegroups.com
Yes, TSan works only on 64-bit systems. We don't plan to support 32 bits any time soon...


    

--
You received this message because you are subscribed to the Google Groups "thread-sanitizer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to thread-sanitiz...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Alexey Samsonov, MSK

Rohit Singh

unread,
Sep 2, 2022, 12:01:14 PM9/2/22
to thread-sanitizer
I am using 64-bit machine, but it's still giving the same error - 

Error - "/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: cannot find -ltsan
"
Please note - I have already installed - " devtoolset-7 devtoolset-7-libasan-devel  "

Still facing the same error, using gcc7.
Reply all
Reply to author
Forward
0 new messages