[PATCH] D55589: [hwasan] Link ubsan_cxx to shared runtime library.

Evgenii Stepanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 12 14:59:15 PST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rCRT348986: [hwasan] Link ubsan_cxx to shared runtime library. (authored by eugenis, committed by ).
Herald added a subscriber: Sanitizers.

Changed prior to commit:
  https://reviews.llvm.org/D55589?vs=177805&id=177943#toc

Repository:
  rCRT Compiler Runtime

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55589/new/

https://reviews.llvm.org/D55589

Files:
  lib/hwasan/CMakeLists.txt
  test/hwasan/TestCases/cfi.cc


Index: test/hwasan/TestCases/cfi.cc
===================================================================
--- test/hwasan/TestCases/cfi.cc
+++ test/hwasan/TestCases/cfi.cc
@@ -0,0 +1,18 @@
+// RUN: %clang_hwasan -fsanitize=cfi -fno-sanitize-trap=cfi -flto -fvisibility=hidden -fuse-ld=lld %s -o %t
+// RUN: not %run %t 2>&1 | FileCheck %s
+
+// REQUIRES: android
+
+// Smoke test for CFI + HWASAN.
+
+struct A {
+  virtual void f();
+};
+
+void A::f() {}
+
+int main() {
+  // CHECK: control flow integrity check for type {{.*}} failed during cast to unrelated type
+  A *a = reinterpret_cast<A *>(reinterpret_cast<void *>(&main));
+  (void)a;
+}
Index: lib/hwasan/CMakeLists.txt
===================================================================
--- lib/hwasan/CMakeLists.txt
+++ lib/hwasan/CMakeLists.txt
@@ -145,6 +145,7 @@
             RTSanitizerCommonCoverage
             RTSanitizerCommonSymbolizer
             RTUbsan
+            RTUbsan_cxx
             # The only purpose of RTHWAsan_dynamic_version_script_dummy is to
             # carry a dependency of the shared runtime on the version script.
             # Replacing it with a straightforward


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55589.177943.patch
Type: text/x-patch
Size: 1161 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181212/1dda292a/attachment.bin>


More information about the llvm-commits mailing list