Open alexeyr opened 3 years ago
The sanitizer relies on code instrumentation and corresponding run-time. This means that mix-n-matching Rust and C compiler versions is unlikely to work. Same LLVM version from Rust and Clang should work, but one shouldn't hold the breath for any other combination. Given the uncertainties it's probably safer to leave it to the user. All you'll need to do is to set additional environment variable, e.g. env RUSTFLAGS=-Zsanitizer=address CFLAGS=-fsanitize=address cargo ...
.
When using
-Zsanitizer=
I think it might be a good idea to pass corresponding option to the C/C++ compiler as well (if it supports it). It's easy to check if it's inRUSTFLAGS
, but I don't know if that's enough.