2.2 Setup Arm Cross Compiler

  1. Update package lists.

    $ sudo apt update

  2. Install the GCC and G++ cross-compilers.

    $ sudo apt install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf

  3. Set the target architecture as Arm.

    $ export ARCH=arm

  4. Set the prefix for the cross-compilation tools.

    $ export CROSS_COMPILE=arm-linux-gnueabihf-

Important: After configuring the environment variables as described above, please ensure that you use the same terminal window for all subsequent steps, until compiling and building the kernel image has been finished.