SDK1.3.2 compile files but can not execute?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SDK1.3.2 compile files but can not execute?

810 Views
xuehuili
Contributor I

Hello Sir,

    I run the SDK1.3.2 virtual machine, build the new image for p1020rdb-pc,  then I compile hello.c to hello, download the hello to p1020rdb-pc target board, execute ./hello but can not execute:(its gcc is 4.6.2)

$/opt/fsl/1.2/sysroots/i686-fslsdk-linux/usr/bin/ppce500v2-fsl-linux-gnuspe/powerpc-fsl-linux-gnuspe-gcc hello.c -o hello --sysroot=/opt/fsl/1.2/sysroots/ppce500v2-fsl-linux-gnuspe

root@p1020rdb-pc:~/hello# ls -l

-rwxrwxrwx    1 root     root          7041   May 22    2016   hello

-rwxr-xr-x       1 root     root          8309   May 22   12:53   helloworld

root@p1020rdb-pc:~/hello# ./hello

-sh: ./hello: cannot execute binary file

root@p1020rdb-pc:~/hello# ./helloworld

helloword!

The helloword is OK, it is compiled by SDK1.7 virtual machine on other computer, its gcc is 4.8.1 ,

How to resolve the problem on SDK1.3.2 ?

Thanks!

Labels (1)
0 Kudos
Reply
3 Replies

653 Views
Pavel
NXP Employee
NXP Employee

I have tested the following command sequence under Ubuntu 12.04:

sudo chmod 777 /opt/fsl/1.2/environment-setup-ppce500v2-fsl-linux-gnuspe

source /opt/fsl/1.2/environment-setup-ppce500v2-fsl-linux-gnuspe

echo $PATH

/opt/fsl/1.2/sysroots/i686-fslsdk-linux/usr/bin/ppce500v2-fsl-linux-gnuspe/powerpc-fsl-linux-gnuspe-gcc test.c --sysroot=/opt/fsl/1.2/sysroots/ppce500v2-fsl-linux-gnuspe -o test.elf

Note: use the "echo $PATH" for path checking


Have a great day,
Pavel Chubakov

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

653 Views
Pavel
NXP Employee
NXP Employee

Use the following command sequence for toolchain installing and using.

  1. 1. source ./fsl-setup-poky -m p1020rdb
  2. 2. bitbake fsl-toolchain
  3. 3. change directory to /QorIQ-SDK-V1.3.2-20130325-yocto/build_p1020rdb_release/tmp/deploy/sdk
  4. 4. extract the fsl-eglibc-i686-ppce500v2-toolchain-1.2.tar.bz2 file

This file contains toolchain for extracting to /opt/fsl/1.2 folder

  1. 5. export CROSS_COMPILE=/opt/fsl/1.2/sysroots/x86_64-fslsdk-linux/usr/bin/ppce500v2-fsllinux-gnuspe/powerpc-fsl-linux-gnuspe-
  2. 6. sudo chmod 777 /opt/fsl/1.2/environment-setup-ppce500v2-fsl-linux-gnuspe
  3. 7. /opt/fsl/1.2/sysroots/i686-fslsdk-linux/usr/bin/ppce500v2-fsl-linux-gnuspe/powerpc-fsl-linux-gnuspe-gcc -g -o test test.c


Have a great day,
Pavel Chubakov

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

653 Views
xuehuili
Contributor I

I used the bitbake fsl-toolchain to rebuild and extract toolchain package few days ago, but still hasn't resolved the problem.  Then I reinstall the SDK1.3.2 virtual machine image (QorIQ DPAA SDK v1.3.2 PPCE500V2 with Virtual Host Environment.zip, the file size is 7.4GB), the problem still exist.

Whether the alone gcc of SDK1.3.2 has a problem originally?

Have a great day.

0 Kudos
Reply