tools/[Rust|D]: Fix the Rust and D Builds for QEMU RISC-V #70
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes the build for Rust Apps on QEMU RISC-V 64-bit. Previously the Rust Build selected the incorrect Rust Target riscv64i-unknown-none-elf. Now the Rust Build selects the correct Rust Target: riscv64gc-unknown-none-elf.
To validate the fix, we create a new NuttX Config
rv-virt:leds64_rust
that builds theleds_rust
example for QEMU RISC-V 64-bit.leds_rust
will be compiled for every run of NuttX CI.Note that Rust Apps won't build correctly for QEMU RISC-V 32-bit. This requires a Rust Custom Target for riscv32gc, which will make the NuttX Makefiles much more complicated.
This PR also fixes the 32-bit RISC-V Target for D Apps. D Targets ("riscv32") are named differently from Rust Targets ("riscv32gc"), this PR restores the correct Target Names.
Modified Files
tools/Rust.defs
: Rename the RISC-V ISAimafdc
togc
for Rust Targetstools/D.defs
: Exclude the RISC-V ISA for D Targetstools/ci/platforms/ubuntu.sh
: Add Rust Targetriscv64gc-unknown-none-elf
for CINew Files
boards/risc-v/qemu-rv/rv-virt/configs/leds64_rust/defconfig
: Add new NuttX Configrv-virt:leds64_rust
Updated Docs
applications/examples/leds_rust/index.rst
: Addleds_rust
example appplatforms/risc-v/qemu-rv/boards/rv-virt/index.rst
: Addrv-virt:leds64_rust
configImpact
Previously, Rust and D Apps failed to build for QEMU RISC-V due to the incorrect target. With this PR, they will build correctly. There is no impact on C Apps.
Testing
For Rust Apps: We tested the
leds_rust
example app onrv-virt:leds64_rust
(QEMU RISC-V 64-bit): Test LogNote that
leds_rust
won't build correctly for 32-bitrv-virt:leds
. To date, NuttX has never supported Rust Apps for QEMU RISC-V 32-bit, because the Rust Custom Target for riscv32gc is missing: Build LogFor D Apps: We tested the
hello_d
example app onrv-virt:nsh
(QEMU RISC-V 32-bit): Test LogNote that
hello_d
won't build correctly for 64-bitrv-virt:nsh64
. To date, NuttX has never supported 64-bit RISC-V for D Apps: Build Log