0

I was trying to build a project from https://github.com/cetic/6lbr/wiki/COOJA-Interface

But when I am trying to launch cooja interface with command make cooja-small it fails with this error log:

 INFO [AWT-EventQueue-0] (MessageListUI.java:257) - slip-net.c:50:12: warning: unused variable 'i' [-Wunused-variable]
 INFO [AWT-EventQueue-0] (MessageListUI.java:257) -    uint16_t i;
 INFO [AWT-EventQueue-0] (MessageListUI.java:257) -             ^
 INFO [AWT-EventQueue-0] (MessageListUI.java:257) -   CC        no-framer.c
 INFO [AWT-EventQueue-0] (MessageListUI.java:257) -   CC        slip-radio-cooja.c
 INFO [AWT-EventQueue-0] (MessageListUI.java:257) -   CC        ../../../apps/slip-cmd/cmd.c
 INFO [AWT-EventQueue-0] (MessageListUI.java:257) -   CC        ../../../apps/slip-cmd/packetutils.c
 INFO [AWT-EventQueue-0] (MessageListUI.java:257) -   CC        ../../../platform/cooja/lib/simEnvChange.c
 INFO [AWT-EventQueue-0] (MessageListUI.java:257) -   CC        ../../../platform/cooja/sys/cooja_mt.c
 INFO [AWT-EventQueue-0] (MessageListUI.java:257) -   CC        ../../../platform/cooja/sys/cooja_mtarch.c
 INFO [AWT-EventQueue-0] (MessageListUI.java:257) - /tmp/ccHLzKYb.s: Assembler messages:
 INFO [AWT-EventQueue-0] (MessageListUI.java:257) - /tmp/ccHLzKYb.s:142: Error: bad instruction `pushl %eax'
 INFO [AWT-EventQueue-0] (MessageListUI.java:257) - /tmp/ccHLzKYb.s:143: Error: bad instruction `pushl %ebx'
 INFO [AWT-EventQueue-0] (MessageListUI.java:257) - /tmp/ccHLzKYb.s:144: Error: bad instruction `pushl %ecx'
 INFO [AWT-EventQueue-0] (MessageListUI.java:257) - /tmp/ccHLzKYb.s:145: Error: bad instruction `pushl %edx'
 INFO [AWT-EventQueue-0] (MessageListUI.java:257) - /tmp/ccHLzKYb.s:146: Error: bad instruction `pushl %esi'
 INFO [AWT-EventQueue-0] (MessageListUI.java:257) - /tmp/ccHLzKYb.s:147: Error: bad instruction `pushl %edi'
 INFO [AWT-EventQueue-0] (MessageListUI.java:257) - /tmp/ccHLzKYb.s:148: Error: bad instruction `pushl %ebp'
 INFO [AWT-EventQueue-0] (MessageListUI.java:257) - /tmp/ccHLzKYb.s:149: Error: bad instruction `pushl %ebp'
 INFO [AWT-EventQueue-0] (MessageListUI.java:257) - /tmp/ccHLzKYb.s:156: Error: bad instruction `movl [r3],%eax'
 INFO [AWT-EventQueue-0] (MessageListUI.java:257) - /tmp/ccHLzKYb.s:161: Error: bad instruction `movl (%eax),%ebx'
 INFO [AWT-EventQueue-0] (MessageListUI.java:257) - /tmp/ccHLzKYb.s:162: Error: bad instruction `movl %esp,(%eax)'
 INFO [AWT-EventQueue-0] (MessageListUI.java:257) - /tmp/ccHLzKYb.s:163: Error: bad instruction `movl %ebx,%esp'
 INFO [AWT-EventQueue-0] (MessageListUI.java:257) - /tmp/ccHLzKYb.s:168: Error: bad instruction `popl %ebp'
 INFO [AWT-EventQueue-0] (MessageListUI.java:257) - /tmp/ccHLzKYb.s:169: Error: bad instruction `popl %ebp'
 INFO [AWT-EventQueue-0] (MessageListUI.java:257) - /tmp/ccHLzKYb.s:170: Error: bad instruction `popl %edi'
 INFO [AWT-EventQueue-0] (MessageListUI.java:257) - /tmp/ccHLzKYb.s:171: Error: bad instruction `popl %esi'
 INFO [AWT-EventQueue-0] (MessageListUI.java:257) - /tmp/ccHLzKYb.s:172: Error: bad instruction `popl %edx'
 INFO [AWT-EventQueue-0] (MessageListUI.java:257) - /tmp/ccHLzKYb.s:173: Error: bad instruction `popl %ecx'
 INFO [AWT-EventQueue-0] (MessageListUI.java:257) - /tmp/ccHLzKYb.s:174: Error: bad instruction `popl %ebx'
 INFO [AWT-EventQueue-0] (MessageListUI.java:257) - /tmp/ccHLzKYb.s:175: Error: bad instruction `popl %eax'
 INFO [AWT-EventQueue-0] (MessageListUI.java:257) - /tmp/ccHLzKYb.s:176: Error: bad instruction `leave'
 INFO [AWT-EventQueue-0] (MessageListUI.java:257) - /tmp/ccHLzKYb.s:177: Error: bad instruction `ret'
 INFO [AWT-EventQueue-0] (MessageListUI.java:257) - ../../../Makefile.include:240: recipe for target 'obj_cooja/cooja_mtarch.o' failed
 INFO [AWT-EventQueue-0] (MessageListUI.java:257) - Process returned error code 2
 INFO [AWT-EventQueue-0] (MessageListUI.java:257) - make: *** [obj_cooja/cooja_mtarch.o] Error 1

I've installed the arm-none-eabi-gcc -v toolchain

RAspberry details Linux raspberrypi 4.1.19-v7+ #858 SMP Tue Mar 15 15:56:00 GMT 2016 armv7l GNU/Linux

What might be the cause???

NTP
  • 91
  • 1
  • 8
  • Using x86 instruction set on ARMv7 based processor? I assume you intend to cross compile from an x86/x86-64 proc to the Pi target; but what is the host machine? – InfinitelyManic Mar 23 '17 at 15:37

1 Answers1

0

It seems like this code is meant for 64bits compiling while the raspberry pi 2 has a 32bits processor (ARM is 32bits). The popl instruction is 64bits. The 32bits equivalent is popq.

Referring to x86 Assembly pushl/popl don't work with "Error: suffix or operands invalid" and https://www.raspberrypi.org/forums/viewtopic.php?f=30&t=27761

Community
  • 1
  • 1
yanneke
  • 106
  • 7