Skip to content

sys: let bindgen handle target triple mapping#669

Merged
richarddd merged 1 commit intoDelSkayn:masterfrom
amaanq:fix-bindgen-target
Apr 15, 2026
Merged

sys: let bindgen handle target triple mapping#669
richarddd merged 1 commit intoDelSkayn:masterfrom
amaanq:fix-bindgen-target

Conversation

@amaanq
Copy link
Copy Markdown
Contributor

@amaanq amaanq commented Apr 14, 2026

Description of changes

The build script manually passed --target={rust_triple} to clang via .clang_args(), bypassing bindgen's rust_to_clang_target() which correctly maps Rust triples to clang-compatible ones (e.g. riscv64gc-unknown-linux-gnu to riscv64-unknown-linux-gnu, and *-windows-gnullvm to *-windows-gnu). This broke builds on riscv64 because clang does not recognize the gc ISA extension suffix in the target triple.

The manual --target and the gnullvm workaround from #506 are both unnecessary since bindgen 0.65+ handles these mappings internally.

(My use case is getting riscv64 bindings generated for tree-sitter now that we have a risc-v runner in theory)

Checklist

  • Added change to the changelog
  • Created unit tests for my feature if needed

The build script manually passed `--target={rust_triple}` to clang via
`.clang_args()`, bypassing bindgen's `rust_to_clang_target()` which
correctly maps Rust triples to clang-compatible ones (e.g.
`riscv64gc-unknown-linux-gnu` to `riscv64-unknown-linux-gnu`, and
`*-windows-gnullvm` to `*-windows-gnu`). This broke builds on riscv64
because clang does not recognize the `gc` ISA extension suffix in the
target triple.

The manual `--target` and the gnullvm workaround from DelSkayn#506 are both
unnecessary since bindgen 0.65+ handles these mappings internally.
@amaanq amaanq force-pushed the fix-bindgen-target branch from c9b7c9e to 6e91fb7 Compare April 14, 2026 23:42
Copy link
Copy Markdown
Collaborator

@richarddd richarddd left a comment

Choose a reason for hiding this comment

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

LGTM

@richarddd richarddd merged commit d0afdfa into DelSkayn:master Apr 15, 2026
33 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