FS#58492 - [gcc] ThreadSanitizer not working

Attached to Project: Arch Linux
Opened by Bernhard Walle (bwalle) - Tuesday, 08 May 2018, 09:13 GMT
Last edited by Bartłomiej Piotrowski (Barthalion) - Friday, 01 June 2018, 09:44 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Bartłomiej Piotrowski (Barthalion)
Architecture x86_64
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 3
Private No

Details

Description:

When I compile a simple test program using " g++ -o test test.cc -pthread -fsanitize=thread -O2" I get

/bin/ld: libtsan_preinit.o kann nicht gefunden werden: Datei oder Verzeichnis nicht gefunden
collect2: Fehler: ld gab 1 als Ende-Status zurück


Additional info:
* gcc 8.1.0-1
This task depends upon

Closed by  Bartłomiej Piotrowski (Barthalion)
Friday, 01 June 2018, 09:44 GMT
Reason for closing:  Fixed
Additional comments about closing:  gcc 8.1.1+20180531-1
Comment by Bernhard Walle (bwalle) - Wednesday, 09 May 2018, 21:10 GMT
  • Field changed: Percent Complete (100% → 0%)
/bin/ld: cannot find libtsan_preinit.o: No such file or directory
collect2: error: ld returned 1 exit status
Comment by Daniel Bershatsky (daskol) - Sunday, 13 May 2018, 19:18 GMT
The same issue is reproducible for me. Address sanitizer and undefined sanitizer do not cause any issues.
Comment by Daniel Bershatsky (daskol) - Wednesday, 16 May 2018, 20:16 GMT
It seems that the issue was that sanitizer libraries, and thread sanitizer in particular, are not built entirely. The patch below fixes the issue. Additionally, I would check that all other sanitizers are built as well.


Index: PKGBUILD
===================================================================
--- PKGBUILD (revision 324311)
+++ PKGBUILD (working copy)
@@ -214,11 +214,13 @@
make -C $CHOST/libquadmath DESTDIR="$pkgdir" install-nodist_libsubincludeHEADERS
make -C $CHOST/libsanitizer DESTDIR="$pkgdir" install-nodist_{saninclude,toolexeclib}HEADERS
make -C $CHOST/libsanitizer/asan DESTDIR="$pkgdir" install-nodist_toolexeclibHEADERS
+ make -C $CHOST/libsanitizer/tsan DESTDIR="$pkgdir" install-nodist_toolexeclibHEADERS
make -C $CHOST/libmpx DESTDIR="$pkgdir" install-nodist_toolexeclibHEADERS
make -C $CHOST/32/libgomp DESTDIR="$pkgdir" install-nodist_toolexeclibHEADERS
make -C $CHOST/32/libitm DESTDIR="$pkgdir" install-nodist_toolexeclibHEADERS
make -C $CHOST/32/libsanitizer DESTDIR="$pkgdir" install-nodist_{saninclude,toolexeclib}HEADERS
make -C $CHOST/32/libsanitizer/asan DESTDIR="$pkgdir" install-nodist_toolexeclibHEADERS
+ make -C $CHOST/32/libsanitizer/tsan DESTDIR="$pkgdir" install-nodist_toolexeclibHEADERS
make -C $CHOST/32/libmpx DESTDIR="$pkgdir" install-nodist_toolexeclibHEADERS

make -C libiberty DESTDIR="$pkgdir" install

Loading...