rust-lang / rust-lang/rust-bindgen

aarch64 size_t mismatch

Open
#2,687 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
5.3k
Forks
829
Avg merge
1d 1h
Merged PRs (30d)
15

Description

Input C/C++ Header

https://github.com/cloudflare/boring/blob/2ab71411c19ef6136174152c605cf3511fbbb336/boring-sys/build/main.rs#L688-L718

Bindgen Invocation

https://github.com/cloudflare/boring/blob/2ab71411c19ef6136174152c605cf3511fbbb336/boring-sys/build/main.rs#L648-L671

and

cargo build --target aarch64-unknown-linux-gnu
Actual Results
  thread 'main' panicked at 'assertion failed: `(left == right)`
    left: `4`,
   right: `8`: Target platform requires `--no-size_t-is-usize`. The size of `ssize_t` (4) does not match the target pointer size (8)', /home/wtf/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bindgen-0.68.1/codegen/mod.rs:908:25
Expected Results

Hi,

I'm trying to build for 64 bit arm but it complains the size t is 32 bit and mismatch.

what could be missed?

ty

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with cargo build --target aarch64-unknown-linux-gnu, then inspect the bindgen invocation in boring-sys/build/main.rs at the linked lines. Read bindgen's size_t assertion near codegen/mod.rs:908 and compare the target's pointer and ssize_t sizes. Done means aarch64 binding generation completes without the panic with correct size_t handling.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, cpp, rust
Domain
compilers, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.