Solução:
Apenas compile o código estaticamente:
PC:
cleber@cleber:~/test1$ arm-linux-gnueabi-gcc -static test1.c -o test1
cleber@cleber:~/test1$ sftp [email protected]
[email protected]'s password:
Connected to 192.168.7.2.
sftp> put /home/cleber/test1/* /home/debian/test1
Uploading /home/cleber/test1/test1 to /home/debian/test1/test1
/home/cleber/test1/test1 100% 8416 8.2KB/s 00:00
Uploading /home/cleber/test1/test1.c to /home/debian/test1/test1.c
/home/cleber/test1/test1.c 100% 81 0.1KB/s 00:00
sftp> exit
BBB:
debian@beaglebone:~/test1$ ./test1
Hello world !
Como você pode ver, o executável compilado em cross test1
é estático:
test12
foi compilado pelo gcc em BBB apenas para comparar.
debian@beaglebone:~/Desktop/test1$ ldd test1 test12
test1:
not a dynamic executable
test12:
libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb6e12000)
/lib/ld-linux-armhf.so.3 (0xb6f09000)
debian@beaglebone:~/Desktop/test1$ file test1 test12
test1: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, for GNU/Linux 2.6.32, BuildID[sha1]=0x8d34ee7f6f2798fa153dea185f77443d06b6ab61, not stripped
test12: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.26, BuildID[sha1]=0x6a05d95c39cc59d2d407655778dc2ef6f53f02cd, not stripped
Obrigado por ajudar!