Mailing List Archive

gh-112536: Define `_Py_THREAD_SANITIZER` on GCC when TSan is enabled (#117702)
https://github.com/python/cpython/commit/79eec66e3dc277ea6ebad8c0b33756eea6a7ab3b
commit: 79eec66e3dc277ea6ebad8c0b33756eea6a7ab3b
branch: main
author: Sam Gross <colesbury@gmail.com>
committer: colesbury <colesbury@gmail.com>
date: 2024-04-10T10:20:05-04:00
summary:

gh-112536: Define `_Py_THREAD_SANITIZER` on GCC when TSan is enabled (#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.

files:
M Include/pyport.h

diff --git a/Include/pyport.h b/Include/pyport.h
index 9d7ef0061806ad..2ba81a4be42822 100644
--- a/Include/pyport.h
+++ b/Include/pyport.h
@@ -572,6 +572,9 @@ extern "C" {
# if defined(__SANITIZE_ADDRESS__)
# define _Py_ADDRESS_SANITIZER
# endif
+# if defined(__SANITIZE_THREAD__)
+# define _Py_THREAD_SANITIZER
+# endif
#endif



_______________________________________________
Python-checkins mailing list -- python-checkins@python.org
To unsubscribe send an email to python-checkins-leave@python.org
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: list-python-checkins@lists.gossamer-threads.com