Skip to content

Commit 8206a1e

Browse files
colesburymiss-islington
authored andcommitted
pythongh-112536: Define _Py_THREAD_SANITIZER on GCC when TSan is enabled (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>
1 parent 653ed76 commit 8206a1e

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

Include/pyport.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -757,6 +757,9 @@ extern char * _getpty(int *, int, mode_t, int);
757757
# if defined(__SANITIZE_ADDRESS__)
758758
# define _Py_ADDRESS_SANITIZER
759759
# endif
760+
# if defined(__SANITIZE_THREAD__)
761+
# define _Py_THREAD_SANITIZER
762+
# endif
760763
#endif
761764

762765

0 commit comments

Comments
 (0)