ER1_TRIGGERelse echo "no file exit
"$US
ER1_TRIGGERfi
7.3 Cross-compiling
A user's own c/ C ++ program can be cross-compiled by using the cross-compilation
toolchain on the development machine, and then the object file is uploaded to the
EC300 device for execution.
Cross-compilation tool zip package: gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-
gnu.tar.gz
Here's how to configure the environment variables for the cross-compilation
toolchain:
1. Unzip gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu.tar.gz to /opt on your
development machine (you can also unzip it to any other PATH, adjust the path
environment variable in step 2)
2. Edit the ~/.bashrc file and add a line PATH=$PATH:/opt/gcc-linaro-6.3.1-
2017.05-x86_64_aarch64-linux-gnu/bin at the end of the file
3. Execute source ~/.bashrc to make the environment variables work in the current
terminal; The newly opened terminal will take effect automatically.
Using the classic hello world program as an example, create the following
directories and files
mkdir ~/example
touch ~/example/hello.c
touch ~/example/Makefile
The contents of the ~/example/hello.c file are as follows: