Unable to cross compile Valgrind for ARM

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

I am trying to use Valgrind to detect a memory leak on some binaries that compiled for my device (using Processor: ARM926EJ-S rev 5 (v5l)).

Therefore, I am trying to cross-compile Valgrind using a special toolchain for my device.

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

1 / cd Valgrind-3.13.0

2 / sed "s/armv7/arm/g" configure (so that he does not complain about an unsupported architect).

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

4 / make

The following message will appear:

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

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

Repeat the steps above and another error will appear:

 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?

0
source share
1 answer

ARM9 uses the old ARMv5 instruction set. From the error message, it looks like Valgrind assembler code is expecting a new ARM instruction set (ARMv7) than your processor.

This way you might be out of luck and you need to port the above assembler to ARMv4 to get valgrind working.

+1
source

Source: https://habr.com/ru/post/984845/


All Articles