Skip to content

feat(docker): add rv32 toolchain - #86

Merged
josecm merged 2 commits into
mainfrom
feat/rv32_toolchain
Nov 21, 2025
Merged

feat(docker): add rv32 toolchain#86
josecm merged 2 commits into
mainfrom
feat/rv32_toolchain

Conversation

@danielRep

@danielRep danielRep commented Jul 16, 2025

Copy link
Copy Markdown
Member

This PR adds the riscv32-unknown-elf-gcc v13.2.0 to the dockerfile.

@miguelafsilva5

Copy link
Copy Markdown
Member

Why do we need a rv32 toolchain? the rv64 we have available in https://github.com/bao-project/bao-riscv-toolchain should be able to compile for rv32. Didn't we compile and package our own rv64 toolchain to compile the baremetal application for rv32? @josecm

@yangn0

yangn0 commented Jul 28, 2025

Copy link
Copy Markdown

Why do we need a rv32 toolchain? the rv64 we have available in https://github.com/bao-project/bao-riscv-toolchain should be able to compile for rv32. Didn't we compile and package our own rv64 toolchain to compile the baremetal application for rv32? @josecm

Hi,

I tried to compile the baremetal application for rv32 using rv64 toolchain(bao-riscv-toolchain), and got an error.

tools/riscv64-unknown-elf-13.2.0-ubuntu-22.04/bin/../lib/gcc/riscv64-unknown-elf/13.2.0/../../../../riscv64-unknown-elf/lib/libg_nano.a(libc_a-memset.o): ABI is incompatible with that of the selected emulation:
  target emulation `elf64-littleriscv' does not match `elf32-littleriscv'

@danielRep

Copy link
Copy Markdown
Member Author

Why do we need a rv32 toolchain? the rv64 we have available in https://github.com/bao-project/bao-riscv-toolchain should be able to compile for rv32. Didn't we compile and package our own rv64 toolchain to compile the baremetal application for rv32? @josecm

As discussed in the meeting, we will use both toolchains for better clarity.

@danielRep

Copy link
Copy Markdown
Member Author

Why do we need a rv32 toolchain? the rv64 we have available in https://github.com/bao-project/bao-riscv-toolchain should be able to compile for rv32. Didn't we compile and package our own rv64 toolchain to compile the baremetal application for rv32? @josecm

Hi,

I tried to compile the baremetal application for rv32 using rv64 toolchain(bao-riscv-toolchain), and got an error.

tools/riscv64-unknown-elf-13.2.0-ubuntu-22.04/bin/../lib/gcc/riscv64-unknown-elf/13.2.0/../../../../riscv64-unknown-elf/lib/libg_nano.a(libc_a-memset.o): ABI is incompatible with that of the selected emulation:
  target emulation `elf64-littleriscv' does not match `elf32-littleriscv'

Hi @yangn0 , please create an issue related to this in bao' repository. We'll try to help as soon as possible.

@yangn0

yangn0 commented Jul 28, 2025

Copy link
Copy Markdown

Why do we need a rv32 toolchain? the rv64 we have available in https://github.com/bao-project/bao-riscv-toolchain should be able to compile for rv32. Didn't we compile and package our own rv64 toolchain to compile the baremetal application for rv32? @josecm

Hi,
I tried to compile the baremetal application for rv32 using rv64 toolchain(bao-riscv-toolchain), and got an error.

tools/riscv64-unknown-elf-13.2.0-ubuntu-22.04/bin/../lib/gcc/riscv64-unknown-elf/13.2.0/../../../../riscv64-unknown-elf/lib/libg_nano.a(libc_a-memset.o): ABI is incompatible with that of the selected emulation:
  target emulation `elf64-littleriscv' does not match `elf32-littleriscv'

Hi @yangn0 , please create an issue related to this in bao' repository. We'll try to help as soon as possible.

ok. Thanks!

@miguelafsilva5

Copy link
Copy Markdown
Member

A new toolchain was added to the bao-riscv-toolchain repo for rv32. Here is the link.
https://github.com/bao-project/bao-riscv-toolchain/releases/download/gc891d8dc23e/riscv32-unknown-elf.tar.gz

@danielRep update and test this commit when you can. The toolchain is working as I already tested with qemu-riscv32-virt using bao-demos

Comment thread docker/Dockerfile Outdated
Signed-off-by: Daniel Oliveira <drawnpoetry@gmail.com>
Signed-off-by: Daniel Oliveira <drawnpoetry@gmail.com>
@josecm josecm self-assigned this Nov 21, 2025
@DavidMCerdeira
DavidMCerdeira self-requested a review November 21, 2025 11:45
@josecm
josecm merged commit 4289503 into main Nov 21, 2025
4 checks passed
@josecm
josecm deleted the feat/rv32_toolchain branch November 21, 2025 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants