1. Download valgrind
使用的版本是 valgrind 3.12.0 -- 20 October 2016.
可從此處下載 http://www.valgrind.org/downloads/valgrind-3.12.0.tar.bz2
2. 編譯程式
$ wget http://www.valgrind.org/downloads/valgrind-3.12.0.tar.bz2
$ tar jxvf ./valgrind-3.12.0.tar.bz2
$ cd valgrind-3.12.0/
先修改目錄下的 configure, 尋找 armv7, 取代成 arm
$ CC=arm-none-linux-gnueabi-gcc ./configure --host=arm-none-linux-gnueabi --target=arm-none-linux-gnueabi --prefix=$HOME/test/valgrind CFLAGS=-static
$ make
$ make install
3. 確認檔案編譯正確,並用 qemu-arm 檢查檔案是否可以正確執行
$ file valgrind4. 若安裝路徑有問題,可以使用下列方式安裝
valgrind: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, for GNU/Linux 2.6.16, not stripped
./configure --prefix=/target/board/pathReference:
make install DESTDIR=/local/path
- http://www.valgrind.org/
- https://github.com/svn2github/valgrind/blob/master/README
- http://ottoshare.blogspot.tw/2012/03/valgrind.html
- http://stackoverflow.com/questions/16920581/valgrind-in-arm-cortex-a8-issue-configure-error-unsupported-host-architecture
- http://stackoverflow.com/questions/11307465/destdir-and-prefix-of-make