【问题标题】:Cannot find -lasan using address sanitizer in Qt Creator in Windows (MinGW)在 Windows (MinGW) 的 Qt Creator 中无法使用地址清理程序找到 -lasan
【发布时间】:2019-03-06 08:30:18
【问题描述】:

我正在尝试通过将CONFIG += sanitizer sanitize_address 添加到我的.pro 文件中来在Qt 中使用gcc 地址清理程序,但我得到了error: cannot find -lasan

我应该如何安装库?

我正在使用 Qt 提供的 MinGW,但我也可以尝试独立版本。


相关问题:MinGW-w64's gcc and Address Sanitizer

【问题讨论】:

    标签: qt gcc mingw qt-creator address-sanitizer


    【解决方案1】:

    不幸的是,GCC 不支持 Windows 上的 Asan:这是libsanitizer/configure.tgt 的摘录:

    case "${target}" in
      x86_64-*-linux* | i?86-*-linux*)
        ...
      powerpc*-*-linux*)
        ...
      sparc*-*-linux*)
        ...
      s390*-*-linux*)
        ...
      sparc*-*-solaris2.11*)
        ...
      arm*-*-linux*)
        ...
      mips*64*-*-linux*)
        ...
      mips*-*-linux*)
        ...
      aarch64*-*-linux*)
        ...
      x86_64-*-darwin[1]* | i?86-*-darwin[1]*)
        ...
      x86_64-*-solaris2.11* | i?86-*-solaris2.11*)
        ...
      *)
        UNSUPPORTED=1
        ;;
    esac
    

    请注意,Clang 支持它(需要付出一些努力 - 详情请参阅 wiki),并且许多人已经成功使用它。

    【讨论】:

    • 我可以读到这个ASAN, TSAN and USAN are great technologies which are available in GCC. Unfortunately they are not completely usable on Windows. A proper review and tests are needed before anything.here。你能确认它不能使用,所以我将你的答案标记为正确吗?
    • @JosuGoñi 我添加了一些证明链接。请注意,在 GCC 中添加支持应该不难,只是没有主要贡献者对此感兴趣。
    • @JosuGoñi 摘录现在住在mingw-w64.org/contribute/…
    猜你喜欢
    • 2013-06-07
    • 1970-01-01
    • 2014-10-13
    • 2012-03-03
    • 2019-11-05
    • 1970-01-01
    • 1970-01-01
    • 2016-11-15
    • 1970-01-01
    相关资源
    最近更新 更多