tar xvf valgrind-3.14.0.tar.bz2
cd valgrind-3.14.0
apt-get install automake
./autogen.sh
4. 修改支持arm
修改configure
armv7*) 改成 armv7*|arm)
5. configure 和 make 和 make install
./configure --host=arm-linux CC=/opt_WQ/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc CPP=/opt_WQ/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-cpp CXX=/opt_WQ/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-c++ --prefix=/opt/valgrind
make
sudo make install
6 .拷贝交叉编译好的valgrind到开发板上
注意:–prefix=/opt/Valgrind指定的目录要与开发板上放置的目录一致,不然运行valgrind时可能会出现“valgrind: failed to start tool ‘memcheck’ for platform ‘arm-linux’: No such file or directory”错误。