Skip to content

[libc++] Don't define _LIBCPP_INSTRUMENTED_WITH_ASAN for hwasan builds#178278

Merged
ldionne merged 2 commits intollvm:mainfrom
PiJoules:building-with-asan
Jan 28, 2026
Merged

[libc++] Don't define _LIBCPP_INSTRUMENTED_WITH_ASAN for hwasan builds#178278
ldionne merged 2 commits intollvm:mainfrom
PiJoules:building-with-asan

Conversation

@PiJoules
Copy link
Contributor

@PiJoules PiJoules commented Jan 27, 2026

This macro can be defined if LLVM_USE_SANITIZER is HWAddress.

@PiJoules PiJoules requested a review from a team as a code owner January 27, 2026 19:13
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Jan 27, 2026
@llvmbot
Copy link
Member

llvmbot commented Jan 27, 2026

@llvm/pr-subscribers-libcxx

Author: None (PiJoules)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/178278.diff

1 Files Affected:

  • (modified) libcxx/CMakeLists.txt (+1-1)
diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
index b1a52c95edead..0ac582cb561a8 100644
--- a/libcxx/CMakeLists.txt
+++ b/libcxx/CMakeLists.txt
@@ -649,7 +649,7 @@ target_compile_options(cxx-sanitizer-flags INTERFACE ${SANITIZER_FLAGS})
 # will not be compiled into it, resulting in false positives.
 # For context, read: https://github.com/llvm/llvm-project/pull/72677#pullrequestreview-1765402800
 string(FIND "${LLVM_USE_SANITIZER}" "Address" building_with_asan)
-if (NOT "${building_with_asan}" STREQUAL "-1")
+if ("${building_with_asan}" STREQUAL "0")
   config_define(ON _LIBCPP_INSTRUMENTED_WITH_ASAN)
 else()
   config_define(OFF _LIBCPP_INSTRUMENTED_WITH_ASAN)

@PiJoules PiJoules requested a review from petrhosek January 27, 2026 19:14
@PiJoules
Copy link
Contributor Author

ping

Copy link
Member

@ldionne ldionne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the fix.

@ldionne ldionne changed the title [libcxx] Don't define _LIBCPP_INSTRUMENTED_WITH_ASAN for hwasan builds [libc++] Don't define _LIBCPP_INSTRUMENTED_WITH_ASAN for hwasan builds Jan 28, 2026
@ldionne ldionne merged commit 570d5e3 into llvm:main Jan 28, 2026
81 checks passed
honeygoyal pushed a commit to honeygoyal/llvm-project that referenced this pull request Jan 30, 2026
llvm#178278)

This macro should not be defined if `LLVM_USE_SANITIZER` is `HWAddress`.
sshrestha-aa pushed a commit to sshrestha-aa/llvm-project that referenced this pull request Feb 4, 2026
llvm#178278)

This macro should not be defined if `LLVM_USE_SANITIZER` is `HWAddress`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Comments