libstdc++: Make Asan detection work for Clang [PR103453]
Clang doesn't define __SANITIZE_ADDRESS__ so use its __has_feature check to detect Asan instead. libstdc++-v3/ChangeLog: PR libstdc++/103453 * config/allocator/malloc_allocator_base.h (_GLIBCXX_SANITIZE_STD_ALLOCATOR): Define for Clang. * config/allocator/new_allocator_base.h (_GLIBCXX_SANITIZE_STD_ALLOCATOR): Likewise.
This commit is contained in:
parent
36421e76a7
commit
cca6090b13
|
@ -52,8 +52,14 @@ namespace std
|
|||
# define __allocator_base __gnu_cxx::malloc_allocator
|
||||
#endif
|
||||
|
||||
#if defined(__SANITIZE_ADDRESS__) && !defined(_GLIBCXX_SANITIZE_STD_ALLOCATOR)
|
||||
# define _GLIBCXX_SANITIZE_STD_ALLOCATOR 1
|
||||
#ifndef _GLIBCXX_SANITIZE_STD_ALLOCATOR
|
||||
# if defined(__SANITIZE_ADDRESS__)
|
||||
# define _GLIBCXX_SANITIZE_STD_ALLOCATOR 1
|
||||
# elif defined __has_feature
|
||||
# if __has_feature(address_sanitizer)
|
||||
# define _GLIBCXX_SANITIZE_STD_ALLOCATOR 1
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -52,8 +52,14 @@ namespace std
|
|||
# define __allocator_base __gnu_cxx::new_allocator
|
||||
#endif
|
||||
|
||||
#if defined(__SANITIZE_ADDRESS__) && !defined(_GLIBCXX_SANITIZE_STD_ALLOCATOR)
|
||||
# define _GLIBCXX_SANITIZE_STD_ALLOCATOR 1
|
||||
#ifndef _GLIBCXX_SANITIZE_STD_ALLOCATOR
|
||||
# if defined(__SANITIZE_ADDRESS__)
|
||||
# define _GLIBCXX_SANITIZE_STD_ALLOCATOR 1
|
||||
# elif defined __has_feature
|
||||
# if __has_feature(address_sanitizer)
|
||||
# define _GLIBCXX_SANITIZE_STD_ALLOCATOR 1
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue