Cannot compile for target x86_64-unknown-linux-musl
lasiotus opened this issue · comments
Running
cargo build --release --target=x86_64-unknown-linux-musl
results in a bunch of compile errors like
error[E0308]: mismatched types
--> alioth/src/utils/ioctls.rs:57:17
|
55 | $crate::ffi!(::libc::ioctl(
| ------------- arguments to this function are incorrect
56 | fd.as_raw_fd(),
57 | $crate::utils::ioctls::ioctl_io($type_, $nr),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `u64`
|
::: alioth/src/hv/kvm/ioctls.rs:23:1
|
23 | ioctl_none!(kvm_get_api_version, KVMIO, 0x00, 0);
| ------------------------------------------------ in this macro invocation
|
note: function defined here
--> /[...]/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.153/src/unix/linux_like/linux/musl/mod.rs:850:12
|
850 | pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int;
| ^^^^^
= note: this error originates in the macro `ioctl_none` (in Nightly builds, run with -Z macro-backtrace for more info)
help: you can convert a `u64` to an `i32` and panic if the converted value doesn't fit
|
57 | $crate::utils::ioctls::ioctl_io($type_, $nr).try_into().unwrap(),
| ++++++++++++++++++++