Linux Basics and Application Development Series 4: ARM-GCC and Cross Compilation

Three questions:

What is ARM-GCC? How does it relate to GCC?

The compilation toolchain and the target program run on the same architecture platform, which is called local compilation

The compilation toolchain and the target program run on different architecture platforms, which is called cross-compilation

ARM-GCC is a compiler for the arm platform, which is a branch of the GCC compilation tool chain

virtual machine

development board

What are the further classifications of ARM-GCC?

The second item: linux none

The third item: gnu: glibc eabi: application binary standard interface hf: support hard floating point platform

How to install ARM-GCC?

apt install gcc

When using the installation command on different platforms, the gcc tool compilation chain of different platforms will be installed

install arm-gcc on ubuntu

apt install gcc-arm-linux-gnueabihf

Linaro

Two cases:

Here you can see that the development board has recognized the shared folder of ubuntn

 

Now mount the ubuntn shared folder to the development board

 

 

Programs running x86_64 architecture on ARM architecture

 cp the hello executable file of the virtual machine to the shared folder

Switch to superuser on the development board and compile

 

 Executable format errors are found, indicating that executable programs on different platforms cannot be mixed because the executable file formats are different from each other

Run cross-compiled programs on the ARM architecture

The development board can be compiled normally

 

Guess you like

Origin blog.csdn.net/qq_51519091/article/details/132133639