【问题标题】:valgrind not building 32 bit rpm on 64 bit machinevalgrind 不在 64 位机器上构建 32 位 rpm
【发布时间】:2013-11-07 06:44:16
【问题描述】:

我有 32 位 C 应用程序(在 64 位系统上运行)泄漏内存。

调试它我已经从http://valgrind.org/downloads/ 下载了 valgrind 3.8.1。 是否 ./configure、make 和 make install 来安装 valgrind。

但是 valgrind 只构建 64 位 memcheck-amd64-linux 二进制文件。 未构建 32 位 memcheck。

结果我得到以下错误

# valgrind --tool=memcheck --time-stamp=yes -v --track-origins=yes --leak-check=yes /home/test_code32 --error-limit=no
valgrind: failed to start tool 'memcheck' for platform 'x86-linux': No such file or directory

跟踪 valgrind 给了我:

execve("/usr/local/lib/valgrind/memcheck-x86-linux", ["valgrind", "--tool=memcheck", "--time-stamp=yes", "-v", "--track-origins=yes", "--leak-check=yes", "/home/test_code32", "--error-limit=no"], [/* 60 vars */]) = -1 ENOENT (No such file or directory)
write(2, "valgrind: failed to start tool '"..., 94valgrind: failed to start tool 'memcheck' for platform 'x86-linux': No such file or directory
) = 94

我检查了 ./configure 输出,它说:

checking for 32 bit build support... no

我正在使用 gcc (SUSE Linux) 4.3.4。

知道如何让 valgrind 在 64 位机器上构建 32 位 memcheck 吗?

【问题讨论】:

    标签: valgrind


    【解决方案1】:

    尝试使用 --enable-only32bit 选项重新运行您的 configure 脚本:

     ./configure --enable-only32bit
    

    【讨论】:

    • 感谢 troydj 的回复。我已经尝试了所有这些方法,但没有任何帮助。
    • 在哪里可以找到该脚本?我已经用 dnf 安装了它
    【解决方案2】:

    我已经解决了这个问题。 我安装了 32 位 gcc 支持,然后再次构建 valgrind,它创建了 32 位 memcheck。

    【讨论】:

      【解决方案3】:

      我遇到了同样的问题,通过设置环境变量解决了:

      export VALGRIND_LIB=/YourValgrindInstallDirectory/lib/valgrind
      

      这是valgrind缺少lib的目录。

      【讨论】:

        【解决方案4】:

        我安装了 32 位版本的 valgrind,现在看来它可以工作了。安装32位版本的资料我从here拿到的

        【讨论】:

          猜你喜欢
          • 2014-11-27
          • 2012-03-08
          • 2011-12-17
          • 2012-07-20
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2013-06-13
          • 2016-12-02
          相关资源
          最近更新 更多