AddressSanitizer on Windows

Lou Knauer lou.knauer98@gmail.com
Mon May 4 18:44:09 GMT 2020


Hi,


Is it possible to use the AddressSanitizer (-fsanitize=address) on
Windows (And if yes, how?)? I built gcc (master branch) from source
today, and it told me that the current configuration/target
(mingw/msys2, x86_64) would not work with the address sanitizer runtime
libraries. In fact, compiling binaries actually works, but when trying
to link with -fsanitize=address it fails (with pre-built gcc-9 as well).

Are there plans to bring gcc's AddressSanitizer to Windows in the near
feature if not? [1] says that LLVMs AddressSanitizer is "periodically"
merged to GCC, which does work on windows.


On Linux, i managed to link a binary built by gcc with clangs
`libclang_rt.asan-x86_64.so` and run it, but something similar with DLLs
on windows segfaults (and this seams like a very dirty hack too). Any ideas?


Thank you very much in advance,

Lou


[1]
https://github.com/google/sanitizers/wiki/AddressSanitizerClangVsGCC-(6.0-vs-8.1)




More information about the Gcc-help mailing list