[PATCH] D36810: Minimal runtime for UBSan.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 17 15:49:02 PDT 2017


pcc added inline comments.


================
Comment at: clang/lib/Driver/ToolChains/CommonArgs.cpp:548
+    } else {
+      SharedRuntimes.push_back("ubsan_standalone");
+      if (SanArgs.linkCXXRuntimes())
----------------
What would happen if I compile with asan+ubsan+minimal runtime? Does that combination make sense?


================
Comment at: compiler-rt/lib/ubsan_minimal/ubsan_minimal_handlers.cc:18
+static void message(const char *msg) {
+  write(2, msg, strlen(msg));
+}
----------------
This won't work on Windows I think, so you'll probably want to disable building the runtime on Windows.


================
Comment at: compiler-rt/lib/ubsan_minimal/ubsan_minimal_handlers.cc:24
+#define HANDLER(name, msg)                                 \
+  INTERFACE void __ubsan_handle_##name##_minimal() {       \
+    message("ubsan: " msg "\n");                           \
----------------
There's a function type mismatch here I believe. If the idea is to reduce binary size, I'd imagine that we'd want to avoid passing the source location on the clang side.


https://reviews.llvm.org/D36810





More information about the llvm-commits mailing list