assembly-llvm/riscv-redundant-memory-stores.rs hardcodes riscv64 target triple
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
tests/assembly-llvm/riscv-redundant-memory-stores.rs currently contains:
//@ compile-flags: -Copt-level=3 --target riscv64gc-unknown-linux-gnu
In downstream bootstrap environments such as Yocto, compiletest may already be configured with a vendor-specific RISC-V target (e.g. riscv64-poky-linux-gnu).
The hardcoded target override causes rustc to require core/std artifacts for riscv64gc-unknown-linux-gnu, which may not exist in the stage2 sysroot.
As a result, the test fails before codegen:
error[E0463]: can't find crate for std``
Other nearby assembly tests (for example riscv-float-struct-abi.rs) avoid this issue by being self-contained no_std/no_core tests.
This test appears to only validate generated RISC-V assembly and does not seem to require a specific vendor triple.
Removing the explicit --target riscv64gc-unknown-linux-gnu and relying on the compiletest-configured riscv64 target makes the test pass in this environment.
Would it make sense to avoid hardcoding the target triple here?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with tests/assembly-llvm/riscv-redundant-memory-stores.rs and compare its compile flags with nearby riscv-float-struct-abi.rs. Check how compiletest supplies the configured RISC-V target, then verify the assembly test no longer requests a separate target triple and passes without requiring unavailable std artifacts.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers, testing-qa
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 76/100