Appendix
Building the GNU Toolchain
General Information
This chapter explains how to install a version of the GNU Toolchain that includes a version of GDB (GNU Debugger) in which the text user interface (tui) is enabled.
Prerequisites:
libncurses-dev to be able to compile GDB with tui
The packages listed here: RISC-V Collab Github
a symbolic link “python” that points to “python3”
Information:
GCC Version:
12.2.0
Buildtime with the
-j4
option: 22 minutesSize required for the repository: 11 GB
Site required for installed Toolchain: 1.4 GB
Installs the complete “riscv-gnu-toolchain” with an multilb newlib
Installation
Install libncurses (on debian):
$ sudo apt install libncurses-dev
If the “python” command is not available on your system you need to create a symbolic link named “python” pointing to the “python3” executable.
Download the source code from the GitHub repository.
$ git clone https://github.com/riscv/riscv-gnu-toolchain
Change directory into the newly downloaded repository.
$ cd riscv-gnu-toolchain
Checkout the Version “2023.01.04” (GCC 12.2.0) with the following command
$ git checkout 2023.01.04
Configuring the toolchain with the following command (remove the \from the command):
$ ./configure --prefix=/home/<username>/toolchain \
--with-multilib-generator="rv32i-ilp32--;rv32im-ilp32--;rv32ima-ilp32--"
Note
Note that the given prefix path is only a sugestion and can be changed by the user.
Compile and install the toolchain.
$ make
Note
Running the make
command builds and installs the toolchain. If writing to the
directory specified with --prefix=
requires root privileges, these need to be
given in order to successfully run the make
command.