Valgrind用于ARMv5tel的交叉编译

Valgrind用于ARMv5tel的交叉编译

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

问题描述

我使用以下选项运行配置:

I ran configure with the following option:

./configure --target=armv5tel CC=arm-linux-gnueabi-gcc --host=i686-linux

然后运行make

我遇到以下错误:

m_cpuid.S: Assembler messages:
m_cpuid.S:40: Error: bad instruction `pushl %ebp'
m_cpuid.S:41: Error: bad instruction `movl %esp,%ebp'
m_cpuid.S:42: Error: bad instruction `pushl %ecx'
m_cpuid.S:43: Error: bad instruction `pushfl'
m_cpuid.S:44: Error: bad instruction `pushfl'
m_cpuid.S:45: Error: bad instruction `popl %eax'
m_cpuid.S:46: Error: bad instruction `movl %eax,%ecx'
m_cpuid.S:47: Error: bad instruction `xorl $0x200000,%eax'
m_cpuid.S:48: Error: bad instruction `pushl %eax'
m_cpuid.S:49: Error: bad instruction `popfl'
m_cpuid.S:50: Error: bad instruction `pushfl'
m_cpuid.S:51: Error: bad instruction `popl %eax'
m_cpuid.S:52: Error: bad instruction `popfl'
m_cpuid.S:53: Error: bad instruction `xorl %ecx,%eax'
m_cpuid.S:54: Error: bad instruction `andl $0x200000,%eax'
m_cpuid.S:55: Error: bad instruction `shrl $21,%eax'
m_cpuid.S:56: Error: bad instruction `popl %ecx'
m_cpuid.S:57: Error: bad instruction `movl %ebp,%esp'
m_cpuid.S:58: Error: bad instruction `popl %ebp'
m_cpuid.S:59: Error: bad instruction `ret'
m_cpuid.S:76: Error: bad instruction `pushl %ebp'
m_cpuid.S:77: Error: bad instruction `movl %esp,%ebp'
m_cpuid.S:78: Error: bad instruction `pushl %eax'
m_cpuid.S:79: Error: bad instruction `pushl %ebx'
m_cpuid.S:80: Error: bad instruction `pushl %ecx'
m_cpuid.S:81: Error: bad instruction `pushl %edx'
m_cpuid.S:82: Error: bad instruction `pushl %esi'
m_cpuid.S:83: Error: bad instruction `movl 8(%ebp),%eax'
m_cpuid.S:84: Error: bad instruction `cpuid'
m_cpuid.S:85: Error: bad instruction `movl 12(%ebp),%esi'
m_cpuid.S:86: Error: bad instruction `testl %esi,%esi'
m_cpuid.S:87: Error: bad instruction `jz 1f'
m_cpuid.S:88: Error: bad instruction `movl %eax,(%esi)'
m_cpuid.S:90: Error: bad instruction `movl 16(%ebp),%esi'
m_cpuid.S:91: Error: bad instruction `testl %esi,%esi'
m_cpuid.S:92: Error: bad instruction `jz 2f'
m_cpuid.S:93: Error: bad instruction `movl %ebx,(%esi)'
m_cpuid.S:95: Error: bad instruction `movl 20(%ebp),%esi'
m_cpuid.S:96: Error: bad instruction `testl %esi,%esi'
m_cpuid.S:97: Error: bad instruction `jz 3f'
m_cpuid.S:98: Error: bad instruction `movl %ecx,(%esi)'
m_cpuid.S:100: Error: bad instruction `movl 24(%ebp),%esi'
m_cpuid.S:101: Error: bad instruction `testl %esi,%esi'
m_cpuid.S:102: Error: bad instruction `jz 4f'
m_cpuid.S:103: Error: bad instruction `movl %edx,(%esi)'
m_cpuid.S:105: Error: bad instruction `popl %esi'
m_cpuid.S:106: Error: bad instruction `popl %edx'
m_cpuid.S:107: Error: bad instruction `popl %ecx'
m_cpuid.S:108: Error: bad instruction `popl %ebx'
m_cpuid.S:109: Error: bad instruction `popl %eax'
m_cpuid.S:110: Error: bad instruction `movl %ebp,%esp'
m_cpuid.S:111: Error: bad instruction `popl %ebp'
m_cpuid.S:112: Error: bad instruction `ret'
m_cpuid.S:154: Error: junk at end of line, first unrecognized character is `,'
make[3]: *** [libcoregrind_x86_linux_a-m_cpuid.o] Error 1
make[3]: Leaving directory `/home/swathi/Desktop/valgrind-3.6.0/coregrind'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/swathi/Desktop/valgrind-3.6.0/coregrind'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/swathi/Desktop/valgrind-3.6.0'
make: *** [all] Error 2

我错过了什么吗?

swathi

推荐答案

您的configure参数不适合交叉编译。要使用最新的autoconf进行交叉编译,您只需指定host,然后将其余的数字搞清楚即可。所以它更像是这样:

Your configure arguments are not right for cross-compilation. To cross-compile with recent autoconf you just specify host and let it figure the rest out. So it would be more like this:

./ configure --host = arm-linux-gnueabi

./configure --host=arm-linux-gnueabi

我还必须通过将 armv7 *替换为 arm *来修改配置脚本。您会看到哪里。

I also had to modify the configure script by replacing "armv7*" with "arm*". You'll see where.

但是,还有另一个问题。 valgrind中的ARM支持涵盖所有ARMv5指令以及v6和v7指令的选定子集。但是,这很大,但是要真正运行valgrind,您必须使用能够运行ARMv7代码的CPU。这意味着Cortex-A或更高。

However, there's another problem. The ARM support in valgrind covers all ARMv5 instructions and a select subset of v6 and v7 instructions. BUT, and it's a big but, to actually RUN valgrind you must use a CPU capable of running ARMv7 code. That means Cortex-A or better.

如果您打算在ARMv5类处理器(如XScale)上运行valgrind,它将无法工作,并且目标程序将出现错误。

If you intend to run valgrind on an ARMv5 class processor (like XScale) it will not work and the target program will fault with an illegal opcode.

不幸的是,但确实如此。

Sad but true. No valgrind for me.

HTH。

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

08-06 17:40