[PATCH] D90537: [GWP-ASan] Stub out backtrace/signal functions on Fuchsia

Kostya Kortchinsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 31 11:09:51 PDT 2020


cryptoad created this revision.
cryptoad added reviewers: hctim, mcgrathr, eugenis.
Herald added subscribers: Sanitizers, phosek.
Herald added a project: Sanitizers.
cryptoad requested review of this revision.

The initial version of GWP-ASan on Fuchsia doesn't support crash and
signal handlers, so this just adds empty stubs to be able to compile
the project on the platform.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D90537

Files:
  compiler-rt/lib/gwp_asan/optional/backtrace_fuchsia.cpp
  compiler-rt/lib/gwp_asan/optional/segv_handler_fuchsia.cpp


Index: compiler-rt/lib/gwp_asan/optional/segv_handler_fuchsia.cpp
===================================================================
--- /dev/null
+++ compiler-rt/lib/gwp_asan/optional/segv_handler_fuchsia.cpp
@@ -0,0 +1,26 @@
+//===-- segv_handler_fuchsia.cpp --------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "gwp_asan/optional/segv_handler.h"
+
+// GWP-ASan on Fuchsia doesn't currently support signal handlers.
+
+namespace gwp_asan {
+namespace crash_handler {
+void installSignalHandlers(gwp_asan::GuardedPoolAllocator *GPA, Printf_t Printf,
+                           PrintBacktrace_t PrintBacktrace,
+                           SegvBacktrace_t SegvBacktrace) {
+  (void)GPA;
+  (void)Printf;
+  (void)PrintBacktrace;
+  (void)SegvBacktrace;
+}
+
+void uninstallSignalHandlers() {}
+} // namespace crash_handler
+} // namespace gwp_asan
Index: compiler-rt/lib/gwp_asan/optional/backtrace_fuchsia.cpp
===================================================================
--- /dev/null
+++ compiler-rt/lib/gwp_asan/optional/backtrace_fuchsia.cpp
@@ -0,0 +1,22 @@
+//===-- backtrace_fuchsia.cpp -----------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "gwp_asan/optional/backtrace.h"
+
+// GWP-ASan on Fuchsia doesn't currently support backtraces.
+
+namespace gwp_asan {
+namespace options {
+Backtrace_t getBacktraceFunction() { return nullptr; }
+crash_handler::PrintBacktrace_t getPrintBacktraceFunction() { return nullptr; }
+} // namespace options
+
+namespace crash_handler {
+SegvBacktrace_t getSegvBacktraceFunction() { return nullptr; }
+} // namespace crash_handler
+} // namespace gwp_asan


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D90537.302105.patch
Type: text/x-patch
Size: 2210 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201031/26e4a693/attachment.bin>


More information about the llvm-commits mailing list