Skip to content

fix: support riscv64gc bindgen target#4

Merged
KKRainbow merged 1 commit into
mainfrom
fix-riscv64gc-bindgen
May 22, 2026
Merged

fix: support riscv64gc bindgen target#4
KKRainbow merged 1 commit into
mainfrom
fix-riscv64gc-bindgen

Conversation

@fanyang89
Copy link
Copy Markdown
Member

Summary

  • map Rust's riscv64gc target triple to clang-compatible riscv64 for bindgen
  • pass rv64gc CPU features to bindgen via -march=rv64gc
  • add riscv64gc-unknown-linux-musl to the zigbuild CI matrix

Verification

  • cargo fmt --check
  • cargo check
  • cargo zigbuild --target riscv64gc-unknown-linux-musl --release
  • EasyTier: cargo zigbuild --release --target riscv64gc-unknown-linux-musl --package=easytier --features=mimalloc

@fanyang89 fanyang89 requested review from KKRainbow and Copilot May 22, 2026 15:25
@fanyang89 fanyang89 added the bug Something isn't working label May 22, 2026
@fanyang89 fanyang89 self-assigned this May 22, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves cross-compilation support for the Rust riscv64gc target by ensuring bindgen/libclang is invoked with a clang-compatible target triple and appropriate RISC-V ISA flags, and extends CI to build the new target via cargo-zigbuild.

Changes:

  • Normalize riscv64gc to riscv64 for clang/bindgen target handling.
  • Pass -march=rv64gc to bindgen when targeting riscv64gc-*.
  • Add riscv64gc-unknown-linux-musl (debug/release) to the zigbuild CI matrix.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
build.rs Adds clang-target normalization and target-specific clang args for bindgen, including RISC-V -march.
.github/workflows/rust.yml Expands cross-compilation matrix to include riscv64gc-unknown-linux-musl builds.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread build.rs
Comment on lines 5 to 15
@@ -15,17 +15,46 @@ fn zig_target(target: &str) -> String {
}
@KKRainbow KKRainbow merged commit d7427c2 into main May 22, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants