Reputation: 105
I'd like to test data races in C++ on windows 10(64 bit), but it seems that Visual C++ doesn't support it yet.
So, I installed Cygwin and got g++ 11.2.0, tried compiling my C++ code with -fsanitize=thread -fPIE -pie -g
, but it failed with -ltsan not found
error.
The doc doesn't say anything about Windows. Is it even possible to use Thread Sanitizer on Windows? If so, How?
Upvotes: 2
Views: 2235
Reputation: 2221
The sanitizers you linked are implemented in Clang, not MSVC or gcc. You can use clang with Visual Studio. To do so you need to install the appropiate toolchain. You can run clang directly on Windows, via cygwin or via WSL.
In addition could you post your complete compile command (e.g. via godbolt.org)?
e.g.: https://godbolt.org/z/fax6o9E1f
Upvotes: 1