Docker image for the RISC-V GNU compiler toolchain
Hello everyone,

to ease the use of the compiler, at least in our company, we created a Docker image of the latest version 7.1.1. that we want to share with the community.

You can use it like this:

In your project, create a shell script for the RISC V compiler executable. You can name the file "riscv32-unknown-elf-gcc" which is the exact name of the RISC V compiler executable inside the Docker container. Put the following content inside of it.

docker run --rm --entrypoint riscv32-unknown-elf-gcc --volume $PWD:/hostdir coderitter/pulp-riscv-gnu-toolchain "$@"

This call to "docker run" will create a temporary Docker container with the current directory mounted into Docker container. It then executes the RISC V compiler executable and forwards any parameters which were made when the script was executed.
The last step is to set the permission of the file so that is executable.

chmod a+x riscv32-unknown-elf-gcc

Now you can use the script as if the compiler itself was installed in your host system.

./riscv32-unknown-elf-gcc -std=c99 -march=rv32imfdcxpulpv2 src -o build/firmware

Messages In This Thread
Docker image for the RISC-V GNU compiler toolchain - by Coderitter GmbH - 02-08-2022, 12:55 PM

Forum Jump:

Users browsing this thread: 1 Guest(s)