ARMv5tel 的 Valgrind 交叉编译
我使用以下选项运行配置:
./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
我错过了什么吗?
斯瓦蒂
I ran configure with the following option:
./configure --target=armv5tel CC=arm-linux-gnueabi-gcc --host=i686-linux
then ran make
I encountered the following error:
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
Am I missing something?
swathi
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您的配置参数不适合交叉编译。要与最近的 autoconf 进行交叉编译,您只需指定主机并让它计算其余部分。所以它更像是这样的:
./configure --host=arm-linux-gnueabi
我还必须通过用“arm*”替换“armv7*”来修改配置脚本。你会看到在哪里。
然而,还有另一个问题。 valgrind 中的 ARM 支持涵盖所有 ARMv5 指令以及 v6 和 v7 指令的选定子集。但是,这是一个很大的但是,要实际运行 valgrind,您必须使用能够运行 ARMv7 代码的 CPU。这意味着 Cortex-A 或更好。
如果您打算在 ARMv5 类处理器(如 XScale)上运行 valgrind,它将无法工作,并且目标程序将出现非法操作码错误。
悲伤但真实。对我来说没有valgrind。
HTH。
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
I also had to modify the configure script by replacing "armv7*" with "arm*". You'll see where.
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.
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.