-
Notifications
You must be signed in to change notification settings - Fork 266
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
can't not build at aarch64 #121
Comments
I've done some digging. It seems to come from the definition of It may just be a matter of casting all of these with |
@flavray I try to solve this problem. use the |
I have the same problem for armv7. The pull request seems to fix it. |
When I built on arm (aarch64), I got this compiler error: ``` Compiling sudo-rs v0.2.0-dev.20230703 (/sudo-rs) error[E0308]: mismatched types --> src/pam/mod.rs:217:44 | 217 | let cstr = unsafe { CStr::from_ptr(data as *const i8) }; | -------------- ^^^^^^^^^^^^^^^^^ expected `*const u8`, found `*const i8` | | | arguments to this function are incorrect | = note: expected raw pointer `*const u8` found raw pointer `*const i8` note: associated function defined here --> /home/build/rustc-1.70.0-src/library/core/src/ffi/c_str.rs:260:25 For more information about this error, try `rustc --explain E0308`. ``` After some research, I learned that this is an architecture issue - on many platforms char is mapped to i8, but not on aarch64. Here's a source: fede1024/rust-rdkafka#121 With this change it now builds successfully on arm! Signed-off-by: Dan Lorenc <dlorenc@chainguard.dev>
When I built on arm (aarch64), I got this compiler error: ``` Compiling sudo-rs v0.2.0-dev.20230703 (/sudo-rs) error[E0308]: mismatched types --> src/pam/mod.rs:217:44 | 217 | let cstr = unsafe { CStr::from_ptr(data as *const i8) }; | -------------- ^^^^^^^^^^^^^^^^^ expected `*const u8`, found `*const i8` | | | arguments to this function are incorrect | = note: expected raw pointer `*const u8` found raw pointer `*const i8` note: associated function defined here --> /home/build/rustc-1.70.0-src/library/core/src/ffi/c_str.rs:260:25 For more information about this error, try `rustc --explain E0308`. ``` After some research, I learned that this is an architecture issue - on many platforms char is mapped to i8, but not on aarch64. Here's a source: fede1024/rust-rdkafka#121 With this change it now builds successfully on arm! Signed-off-by: Dan Lorenc <dlorenc@chainguard.dev>
I have project need to build for aarch64 Architecture.
when build rust-rdkafka-0.20. I got some error.
The text was updated successfully, but these errors were encountered: