Build: Enable std::vector ASAN annotation in libstdc++

By defining _GLIBCXX_SANITIZE_VECTOR when ASAN is enabled `std::vector` operations
will be annotated so ASAN can detect invalid accesses.

See https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_macros.html
This commit is contained in:
Peter Keresztes Schmidt 2021-05-29 19:55:17 +02:00
parent 09b0353592
commit e8adf5d331
1 changed files with 1 additions and 0 deletions

View File

@ -20,6 +20,7 @@ endif()
if(ASAN)
target_compile_options(zm-compile-option-interface
INTERFACE
-D_GLIBCXX_SANITIZE_VECTOR=1
-fno-omit-frame-pointer
-fsanitize=address
-fsanitize-recover=address