powerpc64-fsl-linux-gcc : Cross compilation tool cannot be used

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

powerpc64-fsl-linux-gcc : Cross compilation tool cannot be used

Jump to solution
198 Views
hongyuanzhao
Contributor I

install Cross compilation :

./fsl-toolchain/fsl-qoriq-glibc-x86_64-ppc64e6500-toolchain-2.0.sh

source /opt/fsl-qoriq/2.0/environment-setup-ppc64e6500-fsl-linux

 

 

linux$ powerpc64-fsl-linux-gcc test.c
test.c:1:19: fatal error: stdio.h: No such file or directory
#include <stdio.h>
^
compilation terminated.

0 Kudos
Reply
1 Solution
182 Views
June_Lu
NXP TechSupport
NXP TechSupport

Share the general steps, please check the steps below:

Use toolchain from Linux SDK BSP for QorIQ processor:

https://www.nxp.com/design/design-center/software/embedded-software/linux-software-and-development-t...,

 

This SDK supports toolchain for standalone compiling.

See the Section 3.3.7 (Install the Standalone Toolchain) in the SDK 2.0-1703 documentation:

Install the Standalone Toolchain | QorIQ SDK v2.0-1703 Documentation | NXP Semiconductors

 

Use similar command sequence for your program compiling:

 

  1. Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g.

 $ . /opt/fsl-qoriq/2.0/environment-setup-aarch64-fsl-linux

  1. sudo chmod 777 /opt/fsl-qoriq/2.0/environment-setup-aarch64-fsl-linux
  2. source /opt/fsl-qoriq/2.0/environment-setup-aarch64-fsl-linux

Check result of "source" command. Use "$PATH" command. The "source" command should add path to gcc compiler.

You should see similar message:

echo $PATH

bash: /opt/fsl-qoriq/1.9/sysroots/x86_64-fslsdk-linux/usr/bin:/opt/fsl-qoriq/1.9/sysroots/x86_64-fslsdk-linux/usr/bin/powerpc-fsl-linux-gnuspe:

 

  1. $CC test.c -o test.elf

Thanks

View solution in original post

0 Kudos
Reply
2 Replies
183 Views
June_Lu
NXP TechSupport
NXP TechSupport

Share the general steps, please check the steps below:

Use toolchain from Linux SDK BSP for QorIQ processor:

https://www.nxp.com/design/design-center/software/embedded-software/linux-software-and-development-t...,

 

This SDK supports toolchain for standalone compiling.

See the Section 3.3.7 (Install the Standalone Toolchain) in the SDK 2.0-1703 documentation:

Install the Standalone Toolchain | QorIQ SDK v2.0-1703 Documentation | NXP Semiconductors

 

Use similar command sequence for your program compiling:

 

  1. Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g.

 $ . /opt/fsl-qoriq/2.0/environment-setup-aarch64-fsl-linux

  1. sudo chmod 777 /opt/fsl-qoriq/2.0/environment-setup-aarch64-fsl-linux
  2. source /opt/fsl-qoriq/2.0/environment-setup-aarch64-fsl-linux

Check result of "source" command. Use "$PATH" command. The "source" command should add path to gcc compiler.

You should see similar message:

echo $PATH

bash: /opt/fsl-qoriq/1.9/sysroots/x86_64-fslsdk-linux/usr/bin:/opt/fsl-qoriq/1.9/sysroots/x86_64-fslsdk-linux/usr/bin/powerpc-fsl-linux-gnuspe:

 

  1. $CC test.c -o test.elf

Thanks

0 Kudos
Reply
177 Views
hongyuanzhao
Contributor I

thank you 

This compilation is also possible:

powerpc64-fsl-linux-gcc -mhard-float -m64 -mcpu=e6500 --sysroot=/opt/fsl-qoriq/t2080/sysroots/ppc64e6500-fsl-linux  test.c   -o test 

 

0 Kudos
Reply