Embedded linux: make parameters ARCH and CROSS_COMPILE

ARCH stands for
architecture, which is to choose which type of cpu architecture to compile, which is to compile which subdirectory under the arch/ directory. For example, specify make ARCH=arm to compile the code under arch/arm. If not specified, make will use the cpu of the local machine (whatever machine is used to compile it) as the default ARCH. Note: There are not only arm architecture-specific codes under arch/arm, but also arm-specific kconfig, which is a configuration option , So ARCH=arm must also be specified when make menuconfig and make xxxx_defconfig. ARCH can be understood as a macro, recognized by the cross-compiler (may be arm-linux-gcc here). It means that the running platform of your compiled code is arm.

CROSS_COMPILE

That is, the prefix of the cross-compiler, that is, the tool that chooses to compile the code into the instructions of the target cpu, such as specifying make CROSS_COMPILE=arm-none-linux-gnueabi- is to use arm-none-linux-gnueabi-gcc, arm -none-linux-gnueabi-ld and other tools compile the code into executable instructions for arm. If you do not specify the CROSS_COMPILE parameter, the prefix will be considered empty when make, that is, use gcc to compile. The setting of cross_compile here assumes that the gcc program name of the cross tool chain used is arm-linux-gcc. If the actual gcc name used is some-thing-else-gcc, then fill in some-thing-else- according to the gourd drawing. In short, leave out the last 3 letters of gcc in the name.

Guess you like

Origin blog.csdn.net/lxm920714/article/details/110110605