AnsweredAssumed Answered

Cross compilation for P2020RDB-PCA.

Question asked by Pradeep Chl on May 19, 2016
Latest reply on May 27, 2016 by Pavel Chubakov

Our test.c file is:

#include<sys/types.h>

#include<sys/stat.h>

#include<unistd.h>

#include<fcntl.h>

 

void main()

{

int fd;

fd=  open("file1.txt",O_CREAT | O_WRONLY,0600);

// fd= open("/dev/ttyS0",O_RDONLY);

close(fd);

}

 

gcc test.c --sysroot=/opt/fsl-networking/QorIQ-SDK-V1.7/sysroots/ppce500v2-fsl-linux-gnuspe/ -o test.c

 

We compiled the test.c file using the above command, and when trying to execute on the target we are getting the following error:

-sh: ./test: cannot execute binary file: Exec format error

 

When we run this binary on Linux host, it is working(it creates a new file "file1.txt"), does it mean it just compiled not cross-compile?

 

Thanks,

Outcomes