Embedded Linux cross-compilation tool chain build example

Cross-compilation means to compile the program to be run on the embedded board on our computer, because the computer's cpu is much faster and the compilation speed is faster. On the other hand, installing the compiler tool on the embedded board also takes a certain amount Memory, so there is cross-compilation.

Building a cross-compilation environment is mainly divided into 1. Decompression tool chain; 2. Modify environment variables; 3. Verify tool chain; here is the CB6121 chip of Pingtou as an example, the tool chain is gcc-arm-none-eabi-8-2018 -q4-majorlinux.tar.bz2 uses ubuntu under win10. The cross-compilation tool has been downloaded and placed in the home directory. The environment variable modification is to add the toolchain path format in .bashrc as follows: PATH={toolchain_path}/bin :$PATH

1. Unzip Pingtou's cross-compilation tool
tar -jxvf gcc-arm-none-eabi-8-2018-q4-major-linux.tar.bz2
2. Add environment variable
vi ~/.bashrc and
add
PATH=/ at the end home/gcc-arm-none-eabi-8-2018-q4-major/bin:$PATH
save and exit
source ~/.bashrc update environment variables

3. Verify the toolchain
arm-none-eabi-gcc -v
will print out the version information of the toolchain

Attachment: There are many tool chains in normal use, and the method of temporarily specifying cross-compilation tools is generally used, and directly enter export PATH=$PATH:/home/gcc-arm-none-eabi-8-2018-q4-major/bin in the terminal /

Guess you like

Origin blog.csdn.net/u010835747/article/details/108469237