aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Support/Unix
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Support/Unix')
-rw-r--r--lib/Support/Unix/PathV2.inc2
-rw-r--r--lib/Support/Unix/Signals.inc8
2 files changed, 6 insertions, 4 deletions
diff --git a/lib/Support/Unix/PathV2.inc b/lib/Support/Unix/PathV2.inc
index 4e431ca..93ccd1a 100644
--- a/lib/Support/Unix/PathV2.inc
+++ b/lib/Support/Unix/PathV2.inc
@@ -55,6 +55,8 @@
# define PATH_MAX 4096
#endif
+extern "C" int truncate (const char*, off_t);
+
using namespace llvm;
namespace {
diff --git a/lib/Support/Unix/Signals.inc b/lib/Support/Unix/Signals.inc
index 5195116..1d667ab 100644
--- a/lib/Support/Unix/Signals.inc
+++ b/lib/Support/Unix/Signals.inc
@@ -27,7 +27,7 @@
#if HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
-#if HAVE_DLFCN_H && __GNUG__
+#if HAVE_DLFCN_H && HAVE_CXXABI_H && __GNUG__
#include <dlfcn.h>
#include <cxxabi.h>
#endif
@@ -248,7 +248,7 @@ static void PrintStackTrace(void *) {
// Use backtrace() to output a backtrace on Linux systems with glibc.
int depth = backtrace(StackTrace,
static_cast<int>(array_lengthof(StackTrace)));
-#if HAVE_DLFCN_H && __GNUG__
+#if HAVE_DLFCN_H && HAVE_CXXABI_H && __GNUG__
int width = 0;
for (int i = 0; i < depth; ++i) {
Dl_info dlinfo;
@@ -298,7 +298,7 @@ static void PrintStackTrace(void *) {
void llvm::sys::PrintStackTraceOnErrorSignal() {
AddSignalHandler(PrintStackTrace, 0);
-#if defined(__APPLE__)
+#if defined(__APPLE__) && !defined(ANDROID)
// Environment variable to disable any kind of crash dialog.
if (getenv("LLVM_DISABLE_CRASH_REPORT")) {
mach_port_t self = mach_task_self();
@@ -324,7 +324,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(ANDROID)
#include <signal.h>
#include <pthread.h>