AddressSanitizer on Windows

Lou Knauer
Mon May 4 18:44:09 GMT 2020


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
`` 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,



More information about the Gcc-help mailing list