[compiler-rt] r310179 - Add NetBSD support in sanitizer_unwind_linux_libcdep.cc

Kamil Rytarowski via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 5 06:36:49 PDT 2017


Author: kamil
Date: Sat Aug  5 06:36:49 2017
New Revision: 310179

URL: http://llvm.org/viewvc/llvm-project?rev=310179&view=rev
Log:
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

Modified:
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_unwind_linux_libcdep.cc

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_unwind_linux_libcdep.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_unwind_linux_libcdep.cc?rev=310179&r1=310178&r2=310179&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_unwind_linux_libcdep.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_unwind_linux_libcdep.cc Sat Aug  5 06:36:49 2017
@@ -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::SlowUnwindStack
 
 }  // namespace __sanitizer
 
-#endif  // SANITIZER_FREEBSD || SANITIZER_LINUX
+#endif  // SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_NETBSD




More information about the llvm-commits mailing list