Set Up Compilation Environment

You can follow the steps below to set up your cross-compile.

  1. Execute the following commands to install the riscv64-linux-gnu-gcc compiler from Ubuntu packages.
    sudo apt update
    sudo apt upgrade
    sudo apt install gcc-riscv64-linux-gnu
    
  2. Execute the following command to check the version of the riscv64-linux-gnu-gcc.
    riscv64-linux-gnu-gcc -v

    The output will be as follows:

    Result:
    Figure 1. Example Output