[compiler-rt] r245784 - Revert r245770 and r245777.

Alexey Samsonov via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 21 22:15:56 PDT 2015


Author: samsonov
Date: Sat Aug 22 00:15:55 2015
New Revision: 245784

URL: http://llvm.org/viewvc/llvm-project?rev=245784&view=rev
Log:
Revert r245770 and r245777.

These changes break both autoconf Mac OS X buildbot (linker errors
due to wrong Makefiles) and CMake buildbot (safestack test failures).

Modified:
    compiler-rt/trunk/lib/asan/asan_rtl.cc
    compiler-rt/trunk/lib/lsan/lsan_common.cc
    compiler-rt/trunk/lib/msan/msan.cc
    compiler-rt/trunk/lib/msan/msan.h
    compiler-rt/trunk/lib/msan/msan_linux.cc
    compiler-rt/trunk/lib/sanitizer_common/Makefile.mk
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.cc
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_nolibc.cc
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_coverage_libcdep.cc

Modified: compiler-rt/trunk/lib/asan/asan_rtl.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_rtl.cc?rev=245784&r1=245783&r2=245784&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_rtl.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_rtl.cc Sat Aug 22 00:15:55 2015
@@ -56,6 +56,8 @@ static void AsanDie() {
       UnmapOrDie((void*)kLowShadowBeg, kHighShadowEnd - kLowShadowBeg);
     }
   }
+  if (common_flags()->coverage)
+    __sanitizer_cov_dump();
   if (flags()->abort_on_error)
     Abort();
 }

Modified: compiler-rt/trunk/lib/lsan/lsan_common.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/lsan/lsan_common.cc?rev=245784&r1=245783&r2=245784&view=diff
==============================================================================
--- compiler-rt/trunk/lib/lsan/lsan_common.cc (original)
+++ compiler-rt/trunk/lib/lsan/lsan_common.cc Sat Aug 22 00:15:55 2015
@@ -445,6 +445,8 @@ void DoLeakCheck() {
     return;
   }
   if (common_flags()->exitcode) {
+    if (common_flags()->coverage)
+      __sanitizer_cov_dump();
     Die();
   }
 }

Modified: compiler-rt/trunk/lib/msan/msan.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/msan.cc?rev=245784&r1=245783&r2=245784&view=diff
==============================================================================
--- compiler-rt/trunk/lib/msan/msan.cc (original)
+++ compiler-rt/trunk/lib/msan/msan.cc Sat Aug 22 00:15:55 2015
@@ -375,6 +375,7 @@ void __msan_init() {
   msan_init_is_running = 1;
   SanitizerToolName = "MemorySanitizer";
 
+  SetDieCallback(MsanDie);
   InitTlsSize();
 
   CacheBinaryName();

Modified: compiler-rt/trunk/lib/msan/msan.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/msan.h?rev=245784&r1=245783&r2=245784&view=diff
==============================================================================
--- compiler-rt/trunk/lib/msan/msan.h (original)
+++ compiler-rt/trunk/lib/msan/msan.h Sat Aug 22 00:15:55 2015
@@ -167,6 +167,7 @@ struct SymbolizerScope {
   ~SymbolizerScope() { ExitSymbolizer(); }
 };
 
+void MsanDie();
 void PrintWarning(uptr pc, uptr bp);
 void PrintWarningWithOrigin(uptr pc, uptr bp, u32 origin);
 

Modified: compiler-rt/trunk/lib/msan/msan_linux.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/msan_linux.cc?rev=245784&r1=245783&r2=245784&view=diff
==============================================================================
--- compiler-rt/trunk/lib/msan/msan_linux.cc (original)
+++ compiler-rt/trunk/lib/msan/msan_linux.cc Sat Aug 22 00:15:55 2015
@@ -151,6 +151,11 @@ bool InitShadow(bool init_origins) {
   return true;
 }
 
+void MsanDie() {
+  if (common_flags()->coverage)
+    __sanitizer_cov_dump();
+}
+
 static void MsanAtExit(void) {
   if (flags()->print_stats && (flags()->atexit || msan_report_count > 0))
     ReportStats();

Modified: compiler-rt/trunk/lib/sanitizer_common/Makefile.mk
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/Makefile.mk?rev=245784&r1=245783&r2=245784&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/Makefile.mk (original)
+++ compiler-rt/trunk/lib/sanitizer_common/Makefile.mk Sat Aug 22 00:15:55 2015
@@ -10,9 +10,9 @@
 ModuleName := sanitizer_common
 SubDirs :=
 
-AllSources := $(foreach file,$(wildcard $(Dir)/*.cc),$(notdir $(file)))
-LibcSources := $(filter-out $(wildcard $(Dir)/*_nolibc.cc),$(AllSources))
-ObjNames := $(LibcSources:%.cc=%.o)
+Sources := $(foreach file,$(wildcard $(Dir)/*.cc),$(notdir $(file)))
+Sources := $(filter-out $(wildcard $(Dir)/*_nolibc.cc),$(Sources))
+ObjNames := $(Sources:%.cc=%.o)
 
 Implementation := Generic
 
@@ -20,4 +20,4 @@ Implementation := Generic
 Dependencies := $(wildcard $(Dir)/*.h)
 
 # Define a convenience variable for all the sanitizer_common functions.
-SanitizerCommonFunctions := $(LibcSources:%.cc=%)
+SanitizerCommonFunctions := $(Sources:%.cc=%)

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.cc?rev=245784&r1=245783&r2=245784&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.cc Sat Aug 22 00:15:55 2015
@@ -118,12 +118,6 @@ DieCallbackType GetDieCallback() {
 }
 
 void NORETURN Die() {
-#if !SANITIZER_GO
-  // Dump coverage before invoking user callback, in case it calls abort() or
-  // _exit() itself.
-  if (common_flags()->coverage)
-    DumpCoverage();
-#endif  // !SANITIZER_GO
   if (UserDieCallback)
     UserDieCallback();
   if (InternalDieCallback)

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h?rev=245784&r1=245783&r2=245784&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h Sat Aug 22 00:15:55 2015
@@ -283,7 +283,6 @@ void PrepareForSandboxing(__sanitizer_sa
 void CovPrepareForSandboxing(__sanitizer_sandbox_arguments *args);
 void SetSandboxingCallback(void (*f)());
 
-void DumpCoverage();
 void CoverageUpdateMapping();
 void CovBeforeFork();
 void CovAfterFork(int child_pid);

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_nolibc.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_nolibc.cc?rev=245784&r1=245783&r2=245784&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_nolibc.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_nolibc.cc Sat Aug 22 00:15:55 2015
@@ -20,5 +20,4 @@ namespace __sanitizer {
 void WriteToSyslog(const char *buffer) {}
 #endif
 
-void DumpCoverage() {}
-}  // namespace __sanitizer
+}

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_coverage_libcdep.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_coverage_libcdep.cc?rev=245784&r1=245783&r2=245784&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_coverage_libcdep.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_coverage_libcdep.cc Sat Aug 22 00:15:55 2015
@@ -824,8 +824,6 @@ fd_t MaybeOpenCovFile(const char *name)
   return CovOpenFile(&path, true /* packed */, name);
 }
 
-void DumpCoverage() { coverage_data.DumpAll(); }
-
 void CovBeforeFork() {
   coverage_data.BeforeFork();
 }
@@ -879,7 +877,7 @@ SANITIZER_INTERFACE_ATTRIBUTE void __san
   coverage_data.Init();
 }
 SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_cov_dump() {
-  DumpCoverage();
+  coverage_data.DumpAll();
 }
 SANITIZER_INTERFACE_ATTRIBUTE void
 __sanitizer_cov_module_init(s32 *guards, uptr npcs, u8 *counters,




More information about the llvm-commits mailing list