summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2013-08-30 20:39:21 +0000
committerDaniel Dunbar <daniel@zuster.org>2013-08-30 20:39:21 +0000
commiteb6c708d92f1dfcd0fa631088e9f96100fc19071 (patch)
tree1f937c0507456a0379a77154ead7f375c8019961 /llvm/lib/Support
parent1b9b9ec464c1824dd6ad6c81e4f9450830a1c27f (diff)
downloadbcm5719-llvm-eb6c708d92f1dfcd0fa631088e9f96100fc19071.tar.gz
bcm5719-llvm-eb6c708d92f1dfcd0fa631088e9f96100fc19071.zip
[conf] Add config variable to disable crash related overrides.
- We do some nasty things w.r.t. installing or overriding signal handlers in order to improve our crash recovery support or interaction with crash reporting software, and those things are not necessarily appropriate when LLVM is being linked into a client application that has its own ideas about how to do things. This gives those clients a way to disable that handling at build time. - Currently, the code this guards is all Apple specific, but other platforms might have the same concerns so I went for a more generic configure name. Someone who is more familiar with library embedding on Windows can handle choosing which of the Windows/Signals.inc behaviors might make sense to go under this flag. - This also fixes the proper autoconf'ing of ENABLE_BACKTRACES. The code expects it to be undefined when disabled, but the autoconf check was just defining it to 0. llvm-svn: 189694
Diffstat (limited to 'llvm/lib/Support')
-rw-r--r--llvm/lib/Support/Unix/Signals.inc4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Support/Unix/Signals.inc b/llvm/lib/Support/Unix/Signals.inc
index c62a7ed2167..b4c78d69f77 100644
--- a/llvm/lib/Support/Unix/Signals.inc
+++ b/llvm/lib/Support/Unix/Signals.inc
@@ -333,7 +333,7 @@ static void PrintStackTraceSignalHandler(void *) {
void llvm::sys::PrintStackTraceOnErrorSignal() {
AddSignalHandler(PrintStackTraceSignalHandler, 0);
-#if defined(__APPLE__)
+#if defined(__APPLE__) && defined(ENABLE_CRASH_OVERRIDES)
// Environment variable to disable any kind of crash dialog.
if (getenv("LLVM_DISABLE_CRASH_REPORT")) {
mach_port_t self = mach_task_self();
@@ -359,7 +359,7 @@ void llvm::sys::PrintStackTraceOnErrorSignal() {
// the same linkage unit by just defining our own versions of the assert handler
// and abort.
-#ifdef __APPLE__
+#if defined(__APPLE__) && defined(ENABLE_CRASH_OVERRIDES)
#include <signal.h>
#include <pthread.h>
OpenPOWER on IntegriCloud