PULP Community

Full Version: Docker image for the RISC-V GNU compiler toolchain
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
That sounds awesome.

Do you mind if we advertise it? Of course feel free to let us know how we should attribute it.
Sure, you can advertise it. It is free to use for everybody. If you like to attribute, you can name our company, Coderitter.