[compiler-rt] r190513 - [TSan] Use --whole-archive around TSan runtime in old TSan makefiles. Fix a Go build

Alexey Samsonov samsonov at google.com
Wed Sep 11 04:06:07 PDT 2013


Author: samsonov
Date: Wed Sep 11 06:06:06 2013
New Revision: 190513

URL: http://llvm.org/viewvc/llvm-project?rev=190513&view=rev
Log:
[TSan] Use --whole-archive around TSan runtime in old TSan makefiles. Fix a Go build

Modified:
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc
    compiler-rt/trunk/lib/tsan/Makefile.old
    compiler-rt/trunk/lib/tsan/lit_tests/test_output.sh

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc?rev=190513&r1=190512&r2=190513&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc Wed Sep 11 06:06:06 2013
@@ -310,7 +310,9 @@ void PrepareForSandboxing() {
   // cached mappings.
   MemoryMappingLayout::CacheMemoryMappings();
   // Same for /proc/self/exe in the symbolizer.
+#if !SANITIZER_GO
   getSymbolizer()->PrepareForSandboxing();
+#endif
 }
 
 // ----------------- sanitizer_procmaps.h

Modified: compiler-rt/trunk/lib/tsan/Makefile.old
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/Makefile.old?rev=190513&r1=190512&r2=190513&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/Makefile.old (original)
+++ compiler-rt/trunk/lib/tsan/Makefile.old Wed Sep 11 06:06:06 2013
@@ -54,7 +54,7 @@ libtsan:
 
 tsan_test: $(UNIT_TEST_OBJ) $(RTL_TEST_OBJ) \
            $(SANITIZER_COMMON_TESTS_OBJ) $(LIBTSAN) $(GTEST_LIB)
-	$(CXX) $^ -o $@ $(LDFLAGS)
+	$(CXX) -Wl,--whole-archive $^ -Wl,--no-whole-archive -o $@ $(LDFLAGS)
 
 test: libtsan tsan_test
 

Modified: compiler-rt/trunk/lib/tsan/lit_tests/test_output.sh
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/lit_tests/test_output.sh?rev=190513&r1=190512&r2=190513&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/lit_tests/test_output.sh (original)
+++ compiler-rt/trunk/lib/tsan/lit_tests/test_output.sh Wed Sep 11 06:06:06 2013
@@ -13,7 +13,7 @@ BLACKLIST=$ROOTDIR/lit_tests/Helpers/bla
 
 # TODO: add testing for all of -O0...-O3
 CFLAGS="-fsanitize=thread -fsanitize-blacklist=$BLACKLIST -fPIE -O1 -g -Wall"
-LDFLAGS="-pie -lpthread -ldl -lrt $ROOTDIR/rtl/libtsan.a"
+LDFLAGS="-pie -lpthread -ldl -lrt -Wl,--whole-archive $ROOTDIR/rtl/libtsan.a -Wl,--no-whole-archive"
 
 test_file() {
   SRC=$1





More information about the llvm-commits mailing list