[PATCH] D39791: [ubsan-minimal] Add a path for non-POSIX (and bare-metal) use of the library

Filipe Cabecinhas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 15 09:31:31 PST 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL320831: [ubsan-minimal] Add a path for non-POSIX (and bare-metal) use of the library (authored by filcab, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D39791?vs=122058&id=127151#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D39791

Files:
  compiler-rt/trunk/lib/ubsan_minimal/ubsan_minimal_handlers.cc


Index: compiler-rt/trunk/lib/ubsan_minimal/ubsan_minimal_handlers.cc
===================================================================
--- compiler-rt/trunk/lib/ubsan_minimal/ubsan_minimal_handlers.cc
+++ compiler-rt/trunk/lib/ubsan_minimal/ubsan_minimal_handlers.cc
@@ -5,9 +5,14 @@
 #include <string.h>
 #include <unistd.h>
 
+#ifdef KERNEL_USE
+extern "C" void ubsan_message(const char *msg);
+static void message(const char *msg) { ubsan_message(msg); }
+#else
 static void message(const char *msg) {
   write(2, msg, strlen(msg));
 }
+#endif
 
 static const int kMaxCallerPcs = 20;
 static __sanitizer::atomic_uintptr_t caller_pcs[kMaxCallerPcs];


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39791.127151.patch
Type: text/x-patch
Size: 654 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171215/4c78f25c/attachment.bin>


More information about the llvm-commits mailing list