https://github.com/python/cpython/commit/04d07964f2ccb3169ab389e7cc36c7cf59deaf2c
commit: 04d07964f2ccb3169ab389e7cc36c7cf59deaf2c
branch: 3.12
author: Miss Islington (bot) <[email protected]>
committer: colesbury <[email protected]>
date: 2024-04-10T14:38:10Z
summary:

[3.12] gh-112536: Define `_Py_THREAD_SANITIZER` on GCC when TSan is enabled 
(GH-117702) (#117713)

gh-112536: Define `_Py_THREAD_SANITIZER` on GCC when TSan is enabled (GH-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 79eec66e3dc277ea6ebad8c0b33756eea6a7ab3b)

Co-authored-by: Sam Gross <[email protected]>

files:
M Include/pyport.h

diff --git a/Include/pyport.h b/Include/pyport.h
index 30b9c8ebc409f0..e2bac3bf504261 100644
--- a/Include/pyport.h
+++ b/Include/pyport.h
@@ -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
 
 

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to