Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support building core with thread sanitizer #4337

Merged
merged 1 commit into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ positives as well (disabling postgres is a good workaround).
What the configure script does under the cover is use the custom version of your library at link
time, but still uses the system headers - so make sure that the two don't conflict!

### enable-threadsanitizer
Build with thread sanitizer (TSan) instrumentation, which detects data races.

See https://clang.llvm.org/docs/ThreadSanitizer.html for more information.

#### Building a custom `libc++`

The steps for building an instrumented version of libc++ can be found on the [memory sanitizer
Expand Down
12 changes: 12 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,18 @@ AS_IF([test "x$enable_codecoverage" = "xyes"], [
CFLAGS="$CFLAGS -fprofile-instr-generate -fcoverage-mapping"
])

AC_ARG_ENABLE([threadsanitizer],
AS_HELP_STRING([--enable-threadsanitizer],
[build with thread-sanitizer (TSan) instrumentation]))
AS_IF([test "x$enable_threadsanitizer" = "xyes"], [
AC_MSG_NOTICE([ enabling thread-sanitizer, see https://clang.llvm.org/docs/ThreadSanitizer.html ])

AS_IF([test x != "x$sanitizeopts"], [
AC_MSG_ERROR(Cannot enable multiple checkers at once)
])
sanitizeopts="thread"
])

AC_ARG_ENABLE([memcheck],
AS_HELP_STRING([--enable-memcheck],
[build with memcheck (memory-sanitizer) instrumentation]))
Expand Down
Loading