Closed williballenthin closed 2 years ago
I will attempt this fix on a fork and see how it goes, reporting back here.
PR in #27. With this patch, my project builds on both x86 and ARM: https://github.com/williballenthin/lancelot/runs/4215615280?check_suite_focus=true
When cross compiling for armv7/aarch64 a crate that depends on zydis-rs, the compilation fails with a
mismatched types
error:https://github.com/williballenthin/lancelot/runs/4215259537?check_suite_focus=true
Line 202 is https://github.com/zyantific/zydis-rs/blob/2089243f0610089e3f70ccf766a4a8413f41c746/src/ffi.rs#L200-L204
We see the
buffer
parameters toZyanStringInitCustomBuffer
should be a*mut c_char
: https://github.com/zyantific/zydis-rs/blob/2089243f0610089e3f70ccf766a4a8413f41c746/src/ffi.rs#L1143-L1147and the buffer above is casted to a
*mut i8
. This is correct on x64 but not arm:https://github.com/rust-lang/rust/blob/eab2d7519a3f1c11ddaff3d19f8b7727354c6362/library/std/src/os/raw/mod.rs#L48-L55
I think this can be fixed on lines 202 and 245 with a change like here: https://github.com/jeaye/ncurses-rs/pull/100/files