锵在Windows -faddress,消毒剂 [英] Clang with -faddress-sanitizer on Windows
问题描述
我的意图是使用锵
为 Valgrind的
在Windows的替代品找到缓冲区溢出,动态内存滥用我已经写在等C / C ++程序。我已经成功地构建以下这里提供的说明锵。
My intent is to use Clang
as a replacement for Valgrind
on Windows to find buffer overflows, dynamic memory misuse etc. in C/C++ programs that I've written. I have successfully built Clang following the instructions provided here.
我试图编译与-faddress,消毒剂的选择一个简单的C程序(如指定这里)和以下错误被抛出 -
I attempted to compile a simple C program with the -faddress-sanitizer option (as specified here) and the following the error is thrown -
gcc.exe: error: unrecognized command line option '-faddress-sanitizer'
Using built-in specs.
COLLECT_GCC=C:/MinGW/bin/gcc.exe
Target: mingw32
Configured with: ../gcc-4.7.0/configure --enable-languages=c,c++,ada,fortran,objc,obj- c++ --disable-sjlj-exceptions --with-dwarf2 --enable-shared --enable-libgomp --disable-win32-registry --enable-libstdcxx-debug --disable-build-poststage1-with-cxx --enable-version-specific-runtime-libs --build=mingw32 --prefix=/mingw
Thread model: win32
gcc version 4.7.0 (GCC)
clang: error: assembler (via gcc) command failed with exit code 1 (use -v to see invocation)
为什么铛(据我所知)调用GCC?当然GCC不支持-faddress-消毒剂选项。
Why is clang (as I understand it) invoking GCC? Of course GCC does not support the -faddress-sanitizer option.
我在用这个,因为我一直在试图找到一个Valgrind的好(免费)替代了一段时间的可能性非常兴奋。是否有人可以帮助?
I am really excited at the possibility of using this as I've been trying to find a good (free) substitute for Valgrind for a while. Can someone please help?
推荐答案
AddressSanitizer在Windows上运行这些天好多了(但它仍然是一个有点工作正在进行中)。有在 HTTPS一些文档://$c$c.google.com / p /地址消毒剂/维基/ WindowsPort
AddressSanitizer works much better on Windows these days (but it's still a bit of a work-in-progress). There's some documentation at https://code.google.com/p/address-sanitizer/wiki/WindowsPort
这篇关于锵在Windows -faddress,消毒剂的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!