Hi everyone,
I'm using for development Arietta G25 very nice little board (http://www.acmesystems.it).
It is using ARM 9 @ 400 MHz SoC from Atmel that is fully supported by Linux mainline kernel.
However I can't create any rust binary that would work on this platform, where simple C hello world cross-compiled on other box works perfectly. Rust code is just simple "Hello World".
Here are my steps - what I'm doing wrong here ? Anyone can give me a hint ?
My environment:
spock@fx160:~/devel$ cat ~/.cargo/config
[target.arm-unknown-linux-gnueabi]
linker = "arm-linux-gnueabi-gcc"
spock@fx160:~/devel$ rustup show|grep arm
arm-unknown-linux-gnueabi
arm-unknown-linux-gnueabihf
Cross compilation seems to work for rust and C program:
spock@fx160:~/devel/titleparser$ cargo build --target arm-unknown-linux-gnueabi
Compiling titleparser v0.1.0 (file:///home/spock/devel/titleparser)
spock@fx160:~/devel/titleparser$ file target/arm-unknown-linux-gnueabi/debug/titleparser
target/arm-unknown-linux-gnueabi/debug/titleparser: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=e636aa3692e8e0d7c0554fae6ae9e86774fae70d, not stripped
spock@fx160:~/devel$ arm-linux-gnueabi-gcc -o arm-test arm-test.c
spock@fx160:~/devel$ file arm-test
arm-test: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=8ef02e1e69d7141825d25b310ade15ebebc14cba, not stripped
Let copy both binaries to target system:
spock@fx160:~/devel$ scp arm-test g25.lan:.
arm-test
spock@fx160:~/devel$ scp titleparser/target/arm-unknown-linux-gnueabi/debug/titleparser g25.lan:
titleparser
spock@fx160:~/devel$ ssh g25.lan
Linux arietta 4.4.4 #3 Sun Mar 6 13:49:08 CET 2016 armv5tejl
Last login: Tue Aug 30 10:16:27 2016 from router.lan
spock@arietta:~$ uname -a
Linux arietta 4.4.4 #3 Sun Mar 6 13:49:08 CET 2016 armv5tejl GNU/Linux
And here is result
spock@arietta:~$ ./arm-test
Hello world !
spock@arietta:~$ ./titleparser
Illegal instruction
spock@arietta:~$
Last thing you can see when running with strace is
getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0
readlink("/etc/malloc.conf", 0xbe9ab5dc, 4096) = -1 EINVAL (Invalid argument)
brk(0) = 0x7f645000
--- SIGILL {si_signo=SIGILL, si_code=ILL_ILLOPC, si_addr=0x7f615140} ---
+++ killed by SIGILL +++
Illegal instruction
Thanks in advance !