2010-11-19 4 views
8

I mit der folgenden Option konfigurieren lief:Valgrind Cross-Compilierung für ARMv5tel

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

lief dann

machen begegnete ich den folgenden Fehler:

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 

bin ich etwas fehlt?

swathi

+0

Können Sie valgrind x kompilieren? –

Antwort

18

Ihre configure Argumente sind nicht richtig für Cross-Kompilierung. Um mit dem letzten autoconf zu kompilieren, geben Sie einfach den Host an und lassen Sie den Rest herausfinden. So wäre es mehr wie folgt aus:

configure --host = arm-linux-gnueabi

Ich hatte auch durch Ersetzen "ARMv7 *" mit "Arm *" das configure-Skript zu ändern. Du wirst sehen, wo.

Es gibt jedoch ein anderes Problem. Die ARM-Unterstützung in Valgrind deckt alle ARMv5-Anweisungen und eine ausgewählte Teilmenge der v6- und v7-Anweisungen ab. ABER, und es ist ein großes aber, um RUN valgrind tatsächlich zu verwenden, müssen Sie eine CPU verwenden, die ARMv7-Code ausführen kann. Das bedeutet Cortex-A oder besser.

Wenn Sie Valgrind auf einem ARMv5-Klasse-Prozessor (wie XScale) ausführen möchten, wird es nicht funktionieren und das Zielprogramm wird mit einem ungültigen Opcode Fehler.

Traurig aber wahr. Kein Valgrind für mich.

HTH.

+3

Es gibt noch ein anderes Element - in der obersten Ebene Makefile * .am gibt es spezifische Zusätze von '-mcpu = cortex8', ich ersetzte sie durch '-march = armv5te -mtune = arm926ej-s -mno-thumb-interwork - mno-thumb -g '(Für meine Marvell MV7600 CPU, YMMV) - und das hat mich an den Punkt gebracht, wo coregrind/m_dispatch/dispatch-arm-linux.S nun der Roadblock ist, da er Cortex-spezifische Anweisungen hat (movw, movt) die nicht mit meiner CPU funktionieren. Nur um zu sehen, habe ich sie auskommentiert und die Binärdatei läuft ohne den Ausnahmefehler, aber offensichtlich läuft es nicht richtig. Etwas näher. – synthesizerpatel

+0

Vielen Dank für das Teilen dieser Fakten. Als ich Valgrind 3.12.0 für einen iMX25 kompilierte und ausführte (ARM926EJ-S mit ARMv5TEJ-Anweisungen), war die einzige Ausgabezeile, die ich sah: "Illegal instruction". Gibt es ein Valgrind-Äquivalent, mit dem ich arbeiten könnte? –

3
  1. machen sauber
  2. configure CC = "Ihr Weg von gcc" --target = arm-none-linux-gnueabi --host = ARMv7-none-linux-gnueabi
  3. machen
  4. sudo make install