-
Install the MSYS2 distribution.
-
Activate the clang64 environment. For newer versions of MSYS2, it is activated by default. If you have installed an older version, edit
MSYS2_ROOT/etc/pacman.conf
to activate it. -
In the MSYS2 terminal, run
pacman -S mingw-w64-clang-x86_64-clang
. -
Complie AND link your program with
-fsanitize=address
flag. See https://clang.llvm.org/docs/AddressSanitizer.html#id3 for more information. Note that you have to use the-fsanitize=address
flag both when compiling and linking; for example, in CMakeLists.txt, you have to use bothtarget_compile_options(<YOUR_TARGET> PRIVATE -fsanitize=address)
andtarget_link_options(<YOUR_TARGET> PRIVATE -fsanitize=address)
.
Last active
July 5, 2024 12:01
-
-
Save GoBigorGoHome/26eebe8db2ff28c3330018dcd1ae1fa1 to your computer and use it in GitHub Desktop.
Use Asan on Windows with the MSYS2 clang64 toolchain
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Guide is either wrong or not full