Set Up Compilation Environment

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

  1. Install the riscv64-linux-gnu-gcc compiler from Ubuntu packages.
    sudo apt update
    sudo apt upgrade
    sudo apt install gcc-riscv64-linux-gnu
    
  2. 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