Repository navigation
Add RISC-V 32-bit support - #258
Conversation
lalinsky
commented
Jan 29, 2026
- Add riscv32 coroutine context switching and CI testing
- Simplify ARM/Thumb context switching by removing explicit LR handling
- Add Linux syscall compatibility for 32-bit architectures (time64, renameat2)
- Remove sentinel frames from coroutine entry points
- Add riscv32 coroutine context switching and CI testing - Simplify ARM/Thumb context switching by removing explicit LR handling - Add Linux syscall compatibility for 32-bit architectures (time64, renameat2) - Remove sentinel frames from coroutine entry points
📝 WalkthroughWalkthroughAdds riscv32 coroutine support and related assembly paths, centralizes libc linking in the build module, introduces syscall fallbacks on Linux, adds a CI matrix entry to run riscv32 tests under QEMU, and adds a release mode flag to the check script. (49 words) Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/os/system/linux.zig`:
- Around line 309-327: The renameat implementation should handle the case where
linux.syscall5(.renameat2, ...) returns ENOSYS (kernel doesn't implement
renameat2) by detecting the syscall failure and errno == linux.ENOSYS and then
falling back to calling linux.syscall4(.renameat, ...) with the same arguments;
modify the renameat function to invoke renameat2 via linux.syscall5, check the
error indicator and errno, and only call linux.syscall4 when the syscall failed
with ENOSYS so the no-flags case behaves like the traditional renameat.
🧹 Nitpick comments (1)
src/coro/coroutines.zig (1)
1148-1150: Consider dumping stack traces only on failure.Unconditional stack traces will spam successful test runs; gating this behind the failure path keeps CI logs clean.
The attempt to remove LR handling was causing stack unwinder crashes in release mode. The compiler's clobber list (r14 = true) was not sufficient to preserve LR across context switches, likely due to an LLVM bug with register aliases (similar to the lr vs x30 issue on aarch64). Also add --release flag to check.sh for testing with ReleaseFast optimization.