无法为 ARM 交叉编译 Valgrind [英] Unable to cross-compile Valgrind for ARM

查看:47
本文介绍了无法为 ARM 交叉编译 Valgrind的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

google 上有很多和我类似的问题,我都试过了,但没有一个有效,所以我必须发布这个问题.

我正在尝试使用 Valgrind 检测一些二进制文件的内存泄漏,这些文件是为我的设备编译的(使用处理器:ARM926EJ-S rev 5 (v5l)).

因此,我正在尝试使用适用于我的设备的特定工具链交叉编译 Valgrind.

这是我的过程:我使用的是 Valgrind 3.13.0 和 Ubuntu 16

1/cd Valgrind-3.13.0

2/sed "s/armv7/arm/g" configure(这样它就不会抱怨不支持的架构师).

3/./configure --host=arm-none-linux-gnueabi(使用我特定的交叉编译器而不是 Linux 的默认编译器)

4/make

弹出如下错误:

错误:-mcpu= 开关的错误值 (cortex-a8)

=> 由于我的设备使用 ARM926EJ-S 处理器,我将 Valgrin-3.13.0 文件夹中所有文件的 cortex-a8 替换为 arm926ej-s.>

再次运行以上步骤,又弹出一个错误:

m_dispatch/dispatch-arm-linux.S:汇编消息:m_dispatch/dispatch-arm-linux.S:104: 错误:选定的处理器不支持`movw r1,#47'm_dispatch/dispatch-arm-linux.S:105: 错误:选定的处理器不支持`movw r2,#0'm_dispatch/dispatch-arm-linux.S:157: 错误:选定的处理器不支持`movw r1,#:lower16:vgPlain_stats__n_xindirs_32'm_dispatch/dispatch-arm-linux.S:158: 错误:选定的处理器不支持`movt r1,#:upper16:vgPlain_stats__n_xindirs_32'm_dispatch/dispatch-arm-linux.S:165: 错误:选定的处理器不支持`movw r1,#(((1<<15))-1)'m_dispatch/dispatch-arm-linux.S:166: 错误:选定的处理器不支持`movw r4,#:lower16:vgPlain_tt_fast'm_dispatch/dispatch-arm-linux.S:169: 错误:选定的处理器不支持`movt r4,#:upper16:vgPlain_tt_fast'm_dispatch/dispatch-arm-linux.S:182:错误:选定的处理器不支持`movw r1,#:lower16:vgPlain_stats__n_xindir_misses_32'm_dispatch/dispatch-arm-linux.S:183:错误:选定的处理器不支持`movt r1,#:upper16:vgPlain_stats__n_xindir_misses_32'Makefile:3224:目标m_dispatch/libcoregrind_arm_linux_a-dispatch-arm-linux.o"的配方失败

我做错了什么?

解决方案

ARM9 使用旧的 ARMv5 指令集.从错误消息来看,Valgrind 的汇编代码似乎需要比您的处理器所拥有的更新的 ARM (ARMv7) 指令集.

因此,您可能不走运,需要将上述汇编程序移植到 ARMv4 才能使 valgrind 工作.

There are many questions similar to mine on google, I have tried them all but none of them works so I have to post this question.

I'm trying to use Valgrind to detect memory leak on some binary files, which are compiled for my device (using Processor: ARM926EJ-S rev 5 (v5l)).

Therefore, I'm trying to cross compile Valgrind using the specific toolchain for my device.

Here is my process: I'm using Valgrind 3.13.0 and Ubuntu 16

1/ cd Valgrind-3.13.0

2/ sed "s/armv7/arm/g" configure (so that it won't complain about unsupported architect).

3/ ./configure --host=arm-none-linux-gnueabi (using my specific cross compiler instead of the default on of Linux)

4/ make

The following error pops up:

error: bad value (cortex-a8) for -mcpu= switch

=> Since my device using ARM926EJ-S processor, I replace cortex-a8 with arm926ej-s of all files in Valgrin-3.13.0 folder.

Running above steps again and another error pops up:

m_dispatch/dispatch-arm-linux.S: Assembler messages:
m_dispatch/dispatch-arm-linux.S:104: Error: selected processor does not support `movw r1,#47'
m_dispatch/dispatch-arm-linux.S:105: Error: selected processor does not support `movw r2,#0'
m_dispatch/dispatch-arm-linux.S:157: Error: selected processor does not support `movw r1,#:lower16:vgPlain_stats__n_xindirs_32'
m_dispatch/dispatch-arm-linux.S:158: Error: selected processor does not support `movt r1,#:upper16:vgPlain_stats__n_xindirs_32'
m_dispatch/dispatch-arm-linux.S:165: Error: selected processor does not support `movw r1,#(((1<<15))-1)'
m_dispatch/dispatch-arm-linux.S:166: Error: selected processor does not support `movw r4,#:lower16:vgPlain_tt_fast'
m_dispatch/dispatch-arm-linux.S:169: Error: selected processor does not support `movt r4,#:upper16:vgPlain_tt_fast'
m_dispatch/dispatch-arm-linux.S:182: Error: selected processor does not support `movw r1,#:lower16:vgPlain_stats__n_xindir_misses_32'
m_dispatch/dispatch-arm-linux.S:183: Error: selected processor does not support `movt r1,#:upper16:vgPlain_stats__n_xindir_misses_32'
Makefile:3224: recipe for target 'm_dispatch/libcoregrind_arm_linux_a-dispatch-arm-linux.o' failed

What am I doing wrong?

解决方案

ARM9 uses the old ARMv5 instruction set. From the error message, it looks like Valgrind's assembly code expects a newer ARM (ARMv7) instruction set than what your processor has.

You therefore may be out of luck and need to port the above assembler to ARMv4 to get valgrind to work.

这篇关于无法为 ARM 交叉编译 Valgrind的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆