Bug 1674773 - make tsan builds use consistent flags. r=rstewart

This makes --enable-thread-sanitizer turn on Rust tsan (-Zsanitizer=thread).
This requires changing SpiderMonkey tsan to use the tsan rust nightly.

In future changes, more Rust tsan integration will key off of MOZ_TSAN.

Differential Revision: https://phabricator.services.mozilla.com/D96453
This commit is contained in:
Alexis Beingessner 2020-11-10 21:11:37 +00:00
parent e5a523648c
commit d1d354bb8f
3 changed files with 6 additions and 4 deletions

View file

@ -18,9 +18,6 @@ export MOZ_PKG_SPECIAL=tsan
# Disable telemetry
ac_add_options MOZ_TELEMETRY_REPORTING=
# Ensure Rust also gets the necessary instrumentation
export RUSTFLAGS="-Zsanitizer=thread"
# rustfmt is currently missing in Rust nightly
unset RUSTFMT

View file

@ -53,6 +53,11 @@ ifeq (1,$(MOZ_PARALLEL_BUILD))
cargo_build_flags += -j1
endif
# This should also be paired with -Zbuild-std, but that doesn't work yet.
ifdef MOZ_TSAN
RUSTFLAGS += -Zsanitizer=thread
endif
# These flags are passed via `cargo rustc` and only apply to the final rustc
# invocation (i.e., only the top-level crate, not its dependencies).
cargo_rustc_flags = $(CARGO_RUSTCFLAGS)

View file

@ -237,7 +237,7 @@ sm-tsan-linux64/opt:
toolchain:
- linux64-binutils
- linux64-clang
- linux64-rust
- linux64-rust-nightly
- linux64-dump-syms
sm-rootanalysis-linux64/debug: