Skip to content

Commit

Permalink
pythongh-112536: Define _Py_THREAD_SANITIZER on GCC when TSan is en…
Browse files Browse the repository at this point in the history
…abled (pythonGH-117702)

The `__has_feature(thread_sanitizer)` is a Clang-ism. Although new
versions of GCC implement `__has_feature`, the `defined(__has_feature)`
check still fails on GCC so we don't use that code path.
(cherry picked from commit 79eec66)

Co-authored-by: Sam Gross <colesbury@gmail.com>
  • Loading branch information
colesbury authored and miss-islington committed Apr 10, 2024
1 parent 653ed76 commit 8206a1e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Include/pyport.h
Original file line number Diff line number Diff line change
Expand Up @@ -757,6 +757,9 @@ extern char * _getpty(int *, int, mode_t, int);
# if defined(__SANITIZE_ADDRESS__)
# define _Py_ADDRESS_SANITIZER
# endif
# if defined(__SANITIZE_THREAD__)
# define _Py_THREAD_SANITIZER
# endif
#endif


Expand Down

0 comments on commit 8206a1e

Please sign in to comment.