Jump to content


Photo

Cross Compilation Errors from x86 to PcDuino


  • Please log in to reply
3 replies to this topic

#1 jim

jim

    Advanced Member

  • Administrators
  • 3,385 posts

Posted 13 February 2015 - 07:12 PM

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?



#2 jim

jim

    Advanced Member

  • Administrators
  • 3,385 posts

Posted 13 February 2015 - 07:12 PM

Could you please invoke your code with strace ?
I'm curious what the output is ...
 


#3 jim

jim

    Advanced Member

  • Administrators
  • 3,385 posts

Posted 13 February 2015 - 07:12 PM

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)                           = ?



#4 jim

jim

    Advanced Member

  • Administrators
  • 3,385 posts

Posted 13 February 2015 - 07:12 PM

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.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users