[libcxx-commits] [libcxx] 18014fe - [libcxx][hwasan] Add basic HWAddress support
Vitaly Buka via libcxx-commits
libcxx-commits at lists.llvm.org
Sat Aug 13 00:05:09 PDT 2022
Author: Vitaly Buka
Date: 2022-08-13T00:04:55-07:00
New Revision: 18014fe0a9bf41775e377db7a4214a159f79f257
URL: https://github.com/llvm/llvm-project/commit/18014fe0a9bf41775e377db7a4214a159f79f257
DIFF: https://github.com/llvm/llvm-project/commit/18014fe0a9bf41775e377db7a4214a159f79f257.diff
LOG: [libcxx][hwasan] Add basic HWAddress support
Added:
Modified:
libcxx/CMakeLists.txt
libcxx/utils/libcxx/test/params.py
Removed:
################################################################################
diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
index f9f14fd5cf1d6..bbc9005274ff4 100644
--- a/libcxx/CMakeLists.txt
+++ b/libcxx/CMakeLists.txt
@@ -699,6 +699,8 @@ function(get_sanitizer_flags OUT_VAR USE_SANITIZER)
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")
diff --git a/libcxx/utils/libcxx/test/params.py b/libcxx/utils/libcxx/test/params.py
index 3f223ac17f3bb..1b2b1a766d6b2 100644
--- a/libcxx/utils/libcxx/test/params.py
+++ b/libcxx/utils/libcxx/test/params.py
@@ -134,7 +134,7 @@ def getStdFlag(cfg, std):
[AddCompileFlag('-D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER')]
),
- Parameter(name='use_sanitizer', choices=['', 'Address', 'Undefined', 'Memory', 'MemoryWithOrigins', 'Thread', 'DataFlow', 'Leaks'], type=str, default='',
+ Parameter(name='use_sanitizer', choices=['', 'Address', 'HWAddress', 'Undefined', 'Memory', 'MemoryWithOrigins', 'Thread', 'DataFlow', 'Leaks'], type=str, default='',
help="An optional sanitizer to enable when building and running the test suite.",
actions=lambda sanitizer: filter(None, [
AddFlag('-g -fno-omit-frame-pointer') if sanitizer else None,
@@ -145,6 +145,10 @@ def getStdFlag(cfg, std):
AddFlag('-fsanitize=address') if sanitizer == 'Address' else None,
AddFeature('asan') if sanitizer == 'Address' else None,
+ AddFlag('-fsanitize=hwaddress') if sanitizer == 'HWAddress' else None,
+ # FIXME: Use hwasan feature.
+ AddFeature('asan') if sanitizer == 'HWAddress' else None,
+
AddFlag('-fsanitize=memory') if sanitizer in ['Memory', 'MemoryWithOrigins'] else None,
AddFeature('msan') if sanitizer in ['Memory', 'MemoryWithOrigins'] else None,
AddFlag('-fsanitize-memory-track-origins') if sanitizer == 'MemoryWithOrigins' else None,
More information about the libcxx-commits
mailing list