Jump to content
Sign in to follow this  

Cross Compilation Errors from x86 to PcDuino

Recommended Posts

I am trying to compile C++ code on an x86 based computer using the gnueabi cross compiler for x86 to ARM platforms version 4.4 on the eclipse CDT IDE. I compile the code on the x86 and the goal is to just transfer the executable file generated from eclipse on to the pcDuino and just run that file but I run in to issues here.  The first problem is permissions, when the executable gets transferred over it loses it's executable permissions.  After changing the permissions to be executable, and attempting to run the file, which as of right now is a simple "Hello Word" program intended to just print out that statement, no output appears and no errors show up, any idea of why this happens?

Share this post

Link to post
Share on other sites

Here is the output:
ubuntu@ubuntu:~/Downloads$ sudo strace /home/ubuntu/Downloads/test8
execve("/home/ubuntu/Downloads/test8", ["/home/ubuntu/Downloads/test8"], [/* 17 vars */]) = -1 ENOENT (No such file or directory)
dup(2)                                  = 3
fcntl64(3, F_GETFL)                     = 0x2 (flags O_RDWR)
fstat64(3, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 1), ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6fb6000
_llseek(3, 0, 0xbe9de388, SEEK_CUR)     = -1 ESPIPE (Illegal seek)
write(3, "strace: exec: No such file or di"..., 40strace: exec: No such file or directory
) = 40
close(3)                                = 0
munmap(0xb6fb6000, 4096)                = 0
exit_group(1)                           = ?

Share this post

Link to post
Share on other sites

To me it looks like it is dynamically linked, and some libraries are missing on pcDuino3 ... don't know why, but I remember seeing the "No such file or directory" when I was cross compiling binaries for Android and forgot to statically link the glibc library.

I think it is better to just compile on a virtual machine that runs the same image that pcDuino3 instead of fighting with the compiler. Unless you necessarily have to, it can be very complicated to pinpoint the culprit.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this