git clone https://github.com/riscv/riscv-gnu-toolchain
create folder /home/uty/riscv32i
[uty@u riscv-gnu-toolchain]$ ./configure --prefix=/home/uty/riscv32i --with-arch=rv32ia --with-abi=ilp32
[uty@u riscv-gnu-toolchain]$ make linux
I only need riscv32i, but, to successfully compile the toolchain, the minimal instruction set must be rv32ia