[PATCH] D36314: Add NetBSD support in sanitizer_unwind_linux_libcdep.cc

Kamil Rytarowski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 4 08:18:11 PDT 2017


krytarowski created this revision.
krytarowski added a project: Sanitizers.
Herald added subscribers: aprantl, kubamracek, emaste, srhines.

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>


Repository:
  rL LLVM

https://reviews.llvm.org/D36314

Files:
  lib/sanitizer_common/sanitizer_unwind_linux_libcdep.cc


Index: lib/sanitizer_common/sanitizer_unwind_linux_libcdep.cc
===================================================================
--- lib/sanitizer_common/sanitizer_unwind_linux_libcdep.cc
+++ 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 @@
 }
 #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 @@
 
 }  // namespace __sanitizer
 
-#endif  // SANITIZER_FREEBSD || SANITIZER_LINUX
+#endif  // SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_NETBSD


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36314.109743.patch
Type: text/x-patch
Size: 1218 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170804/6afbe4d3/attachment.bin>


More information about the llvm-commits mailing list