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

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

问题描述

在Google上有很多与我的问题类似的问题,我已经尝试了所有问题,但都无济于事,所以我必须发布此问题.

我正在尝试使用Valgrind来检测某些二进制文件的内存泄漏,这些二进制文件是为我的设备编译的(使用处理器:ARM926EJ-S修订版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

弹出以下错误:

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

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

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

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

我在做什么错了?

解决方案

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天全站免登陆