首先在官网下载源码:https://valgrind.org/downloads/current.html
解压后进入valgrind目录,配置makefile
./configure --host=arm-hard-linux-gnueabihf \
CC=arm-hard-linux-gnueabihf-gcc \
--prefix=/root/code/valgrind-3.24.0/install \
CFLAGS="-march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard -static" \
CXXFLAGS="-march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard -static" \
--enable-static \
--disable-shared
–host 填编译链名称即可,并指定arm架构,并且静态编译
查看CPU架构:cat /proc/cpuinfo
查看编译链支持的浮点,可以在编译指定此硬浮点:
arm-hard-linux-gnueabihf-gcc -march=armv7-a+fp -Q --help=target | grep march
-march= armv7-a+fp
install 目录中的libexec和bin 拷贝到目标机器
部署环境:
chmod 755 /mnt/xxxxx/ -R
export PATH=/mnt/xxxxx/bin:$PATH
export VALGRIND_LIB=/mnt/xxxxx/libexec/valgrind