[libcxx-commits] [PATCH] D127608: [CMake][libcxx] Support HWASan

Petr Hosek via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Jun 12 17:32:05 PDT 2022


phosek created this revision.
phosek added a reviewer: ldionne.
Herald added a subscriber: mgorny.
Herald added a project: All.
phosek requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

This is analogous to ASan.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D127608

Files:
  libcxx/CMakeLists.txt


Index: libcxx/CMakeLists.txt
===================================================================
--- libcxx/CMakeLists.txt
+++ libcxx/CMakeLists.txt
@@ -704,6 +704,8 @@
     endif()
     if (USE_SANITIZER STREQUAL "Address")
       append_flags(SANITIZER_FLAGS "-fsanitize=address")
+    elseif (USE_SANITIZER STREQUAL "HWAddress")
+      append_flags(SANITIZER_FLAGS "-fsanitize=hwaddress")
     elseif (USE_SANITIZER MATCHES "Memory(WithOrigins)?")
       append_flags(SANITIZER_FLAGS -fsanitize=memory)
       if (USE_SANITIZER STREQUAL "MemoryWithOrigins")
@@ -714,6 +716,9 @@
     elseif (USE_SANITIZER STREQUAL "Address;Undefined" OR
             USE_SANITIZER STREQUAL "Undefined;Address")
       append_flags(SANITIZER_FLAGS "-fsanitize=address,undefined -fno-sanitize=vptr,function -fno-sanitize-recover=all")
+    elseif (USE_SANITIZER STREQUAL "HWAddress;Undefined" OR
+            USE_SANITIZER STREQUAL "Undefined;HWAddress")
+      append_flags(SANITIZER_FLAGS "-fsanitize=hwaddress,undefined -fno-sanitize=vptr,function -fno-sanitize-recover=all")
     elseif (USE_SANITIZER STREQUAL "Thread")
       append_flags(SANITIZER_FLAGS -fsanitize=thread)
     elseif (USE_SANITIZER STREQUAL "DataFlow")


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127608.436263.patch
Type: text/x-patch
Size: 1212 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220613/193f68aa/attachment.bin>


More information about the libcxx-commits mailing list