Skip to content

it seems c_char is set to u8, not i8 #74

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sprhawk opened this issue Jun 21, 2020 · 0 comments
Closed

it seems c_char is set to u8, not i8 #74

sprhawk opened this issue Jun 21, 2020 · 0 comments

Comments

@sprhawk
Copy link
Contributor

sprhawk commented Jun 21, 2020

my target is aarch64 (Raspberry Pi 4) host is Debian Buster x86_64.

I'm using poky dunfell branch, use HEAD revision of meta-rust-bin.

My Rust project using bindgen to generate ffi wrapping. it can be build successfully in normal x86_64 environment.

But using yocto + meta-rust-bin + meta-clang(for bindgen), the build failed.

for following reason:

| ffi::receive(*self.client.borrow(), pointer.cast::<i8>(), length, &mut read_length)
|     |                                                                           ^^^^^^^^^^^^^^^^^^^^ expected `u8`, found `i8`

the generated binding for receive is:

receive ( client :client_t , data : * mut :: std :: os :: raw :: c_char , length : u32 , bytes : * mut u32 )

it seems all required c_char is "expected u8"

i saw these issues rust-lang/rust-bindgen#559, rust-lang/rust-bindgen#603, it may be related clang? or rust std?

Should I replace parameters to ffi binding from i8/u8 to just c_char instead?

@sprhawk sprhawk closed this as completed Jun 21, 2020
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

No branches or pull requests

1 participant