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

llvm-svn: 245784
This commit is contained in:
Alexey Samsonov 2015-08-22 05:15:55 +00:00
parent 6fa8532041
commit 4369a3f4ad
10 changed files with 17 additions and 16 deletions

View File

@ -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();
}

View File

@ -445,6 +445,8 @@ void DoLeakCheck() {
return;
}
if (common_flags()->exitcode) {
if (common_flags()->coverage)
__sanitizer_cov_dump();
Die();
}
}

View File

@ -375,6 +375,7 @@ void __msan_init() {
msan_init_is_running = 1;
SanitizerToolName = "MemorySanitizer";
SetDieCallback(MsanDie);
InitTlsSize();
CacheBinaryName();

View File

@ -167,6 +167,7 @@ struct SymbolizerScope {
~SymbolizerScope() { ExitSymbolizer(); }
};
void MsanDie();
void PrintWarning(uptr pc, uptr bp);
void PrintWarningWithOrigin(uptr pc, uptr bp, u32 origin);

View File

@ -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();

View File

@ -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=%)

View File

@ -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)

View File

@ -283,7 +283,6 @@ void PrepareForSandboxing(__sanitizer_sandbox_arguments *args);
void CovPrepareForSandboxing(__sanitizer_sandbox_arguments *args);
void SetSandboxingCallback(void (*f)());
void DumpCoverage();
void CoverageUpdateMapping();
void CovBeforeFork();
void CovAfterFork(int child_pid);

View File

@ -20,5 +20,4 @@ namespace __sanitizer {
void WriteToSyslog(const char *buffer) {}
#endif
void DumpCoverage() {}
} // namespace __sanitizer
}

View File

@ -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 __sanitizer_cov_init() {
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,