gh-112536: Add support for thread sanitizer (TSAN) (gh-112648)

This commit is contained in:
Samet YASLAN 2023-12-30 09:17:02 +01:00 committed by GitHub
parent f46987b828
commit 88cb972000
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 81 additions and 10 deletions

View file

@ -3067,6 +3067,24 @@ AC_MSG_RESULT([no])
with_ubsan="no"
])
AC_MSG_CHECKING([for --with-thread-sanitizer])
AC_ARG_WITH(
[thread_sanitizer],
[AS_HELP_STRING(
[--with-thread-sanitizer],
[enable ThreadSanitizer data race detector, 'tsan' (default is no)]
)],
[
AC_MSG_RESULT([$withval])
BASECFLAGS="-fsanitize=thread $BASECFLAGS"
LDFLAGS="-fsanitize=thread $LDFLAGS"
with_tsan="yes"
],
[
AC_MSG_RESULT([no])
with_tsan="no"
])
# Set info about shared libraries.
AC_SUBST([SHLIB_SUFFIX])
AC_SUBST([LDSHARED])