我交叉使用與Linaro的工具鏈以下命令編譯Valgrind的(http://valgrind.org/downloads/valgrind-3.8.1.tar.bz2),用於ARM我的Ubuntu 10.04主機(我使用Buildroot裏面)上:Valgrind的用於ARM與Linaro的工具鏈需要的libc6-DBG與Buildroot裏面
export PATH=$PATH:/home/user/toolchain/linaro/bin
CC=arm-linux-gnueabi-gcc CFLAGS=-I/home/user/toolchain/linaro/arm-linux-gnueabi/libc/usr/include LDFLAGS=-L/home/user/toolchain/linaro/arm-linux-gnueabi/libc/usr/lib ./configure --prefix=/opt/valgrind --host=armv7-none-linux-gnueabi --target=arm-none-linux-gnueabi --build=i386-ubuntu-linux
make
sudo make install
當我的二進制文件複製到我的ARM目標板,我得到以下錯誤:
==413== Memcheck, a memory error detector
==413== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==413== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==413== Command: /home/user/testApp
==413==
valgrind: Fatal error at startup: a function redirection
valgrind: which is mandatory for this platform-tool combination
valgrind: cannot be set up. Details of the redirection are:
valgrind:
valgrind: A must-be-redirected function
valgrind: whose name matches the pattern: memcpy
valgrind: in an object with soname matching: ld-linux.so.3
valgrind: was not found whilst processing
valgrind: symbols from the object with soname: ld-linux.so.3
valgrind:
valgrind: Possible fixes: (1, short term): install glibc's debuginfo
valgrind: package on this machine. (2, longer term): ask the packagers
valgrind: for your Linux distribution to please in future ship a non-
valgrind: stripped ld.so (or whatever the dynamic linker .so is called)
valgrind: that exports the above-named function using the standard
valgrind: calling conventions for this platform. The package you need
valgrind: to install for fix (1) is called
valgrind:
valgrind: On Debian, Ubuntu: libc6-dbg
valgrind: On SuSE, openSuSE, Fedora, RHEL: glibc-debuginfo
valgrind:
valgrind: Cannot continue -- exiting now. Sorry.
我Linaro的工具鏈版本是:
gcc version 4.7.1 20120402 (prerelease) (crosstool-NG linaro-1.13.1-2012.04-20120426 - Linaro GCC 2012.04)
我在Google上搜索過,但找不到解決方案。我如何讓Valgrind在我的目標板上工作?我使用Buildroot構建我的系統,但libc6-dbg不是我可以在構建系統中找到的包。是否有一些目錄或文件需要從工具鏈sysroot中複製?謝謝 -
我使用運行Valgrind的命令如下所示:
# which valgrind
/usr/bin/valgrind
# valgrind /home/user/MyQtApp
==216== Memcheck, a memory error detector
...
...
你能指定命令你用對目標運行Valgrind的,這樣我們就可以嘗試重現該問題?謝謝。 –
托馬斯,我已經將我的命令添加到上面的帖子 - 謝謝。 – PhilBot
嗨托馬斯,你能重現嗎?我仍然看到我的Buildroot Valgrind安裝的這個問題。謝謝! – PhilBot