summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKamil Rytarowski <n54@gmx.com>2017-08-05 13:36:49 +0000
committerKamil Rytarowski <n54@gmx.com>2017-08-05 13:36:49 +0000
commite0a4b2e12bbbc4f49bb8c6abdc87a07ab503611f (patch)
tree5e405c6059241aed79db033299d70619473b5a0f /lib
parent6906724697e9c56ad605dc70a64cae6cbb0d8901 (diff)
Add NetBSD support in sanitizer_unwind_linux_libcdep.cc
Summary: NetBSD is a POSIX-like and BSD-family system. Reuse FreeBSD and Linux code. NetBSD uses DWARF ExceptionHandler. Part of the code inspired by the original work on libsanitizer in GCC 5.4 by Christos Zoulas. Sponsored by <The NetBSD Foundation> Reviewers: joerg, kcc, filcab, vitalybuka Reviewed By: vitalybuka Subscribers: srhines, emaste, llvm-commits, kubamracek, aprantl, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D36314 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@310179 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/sanitizer_common/sanitizer_unwind_linux_libcdep.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/sanitizer_common/sanitizer_unwind_linux_libcdep.cc b/lib/sanitizer_common/sanitizer_unwind_linux_libcdep.cc
index 5943125c8..59b71842b 100644
--- a/lib/sanitizer_common/sanitizer_unwind_linux_libcdep.cc
+++ b/lib/sanitizer_common/sanitizer_unwind_linux_libcdep.cc
@@ -8,11 +8,11 @@
//===----------------------------------------------------------------------===//
//
// This file contains the unwind.h-based (aka "slow") stack unwinding routines
-// available to the tools on Linux, Android, and FreeBSD.
+// available to the tools on Linux, Android, NetBSD and FreeBSD.
//===----------------------------------------------------------------------===//
#include "sanitizer_platform.h"
-#if SANITIZER_FREEBSD || SANITIZER_LINUX
+#if SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_NETBSD
#include "sanitizer_common.h"
#include "sanitizer_stacktrace.h"
@@ -78,7 +78,8 @@ void SanitizerInitializeUnwinder() {
}
#endif
-#ifdef __arm__
+#if defined(__arm__) && !SANITIZER_NETBSD
+// NetBSD uses dwarf EH
#define UNWIND_STOP _URC_END_OF_STACK
#define UNWIND_CONTINUE _URC_NO_REASON
#else
@@ -165,4 +166,4 @@ void BufferedStackTrace::SlowUnwindStackWithContext(uptr pc, void *context,
} // namespace __sanitizer
-#endif // SANITIZER_FREEBSD || SANITIZER_LINUX
+#endif // SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_NETBSD