Skip to content

Conversation

@CaffeLatteIV
Copy link
Contributor

@CaffeLatteIV CaffeLatteIV commented Nov 20, 2025

This commit introduces logic to detect and utilize the riscv64-elf-gcc compiler, commonly provided by Arch Linux and other distributions for RISC-V embedded development.

The existing build system logic primarily checks for the riscv32-unknown-linux-gnu-gcc and riscv64-unknown-elf-gcc toolchains.

The modified search priority is:

  1. Risc-V 32 bit: riscv32-unknown-linux-gnu-gcc
  2. Risc-V 64 bit: riscv64-unknown-elf-gcc
  3. Risc-V (arch) 64 bit: riscv64-elf-gcc

I would also suggest that this order can be upgraded by searching for the Risc-V 64 bit (point 2) before searching for the 32 bit one (point 1).

Notes:
The Linux-targeting toolchain, riscv64-linux-gnu-gcc, is also available on arch, further testing is needed to assess its suitability versus the 'elf' variant for specific build configurations.

This commit introduces logic to detect and utilize the 'riscv64-elf-gcc'
compiler, commonly provided by Arch Linux and other distributions for
RISC-V embedded development.

The existing build system logic primarily checks for the
'riscv32-unknown-linux-gnu-gcc' and 'riscv64-unknown-elf-gcc'
toolchains.

The modified search priority is:

1. Risc-V 32 bit: `riscv32-unknown-linux-gnu-gcc`
2. Risc-V 64 bit: `riscv64-unknown-elf-gcc`
3. Risc-V (arch) 64 bit: `riscv64-elf-gcc`

I would also suggest that this order can be upgraded by searching for
the Risc-V 64 bit before searching for the 32 bit one.

**Notes:**
The Linux-targeting toolchain, 'riscv64-linux-gnu-gcc', is also
available on arch, further testing is needed to assess its suitability
versus the 'elf' variant for specific build configurations targeting
full operating systems.
@CaffeLatteIV
Copy link
Contributor Author

I also fixed the CMakeLists.txt configuration for Arch Linux users.

I updated the prefix to riscv64-elf- and the include path to /usr/local/include, as that is the standard location on Arch.

Here is the full file: CMakeLists.txt

Added installation instructions for Arch Linux and emulator usage.
@expuss2000 expuss2000 merged commit ee045f4 into virtualsquare:main Dec 5, 2025
8 checks passed
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.

2 participants