aarch64 size_t mismatch
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
I encountered the same problem, do you have any solution?
Can anyone post a minimal reproduction? PRs to fix this are welcome
Minimal reproduction step includes, cross compiling for arm64 (aarch64) target on x86 machine. Also, 'build-dependency' set to 'bindgen' crate.
A minimal reproduction would be the smallest type that reproduces the error and could become a unit test, unfortunately not an entire codebase. A snip of the failing test and its related types in both C and Rust would also be useful.
This issue seems pretty similar to the one I opened: https://github.com/rust-lang/rust-bindgen/issues/2776.
In my case, problem was fixed by using proper 'target' header file. While cross compiling, cdefs.h from host was being referred instead of using one from 'target' toolchain. By adjusting the include file path from 'target' via 'sysroot' settings, its working fine.