From 2eec4dd03d60c10a9932c84cee1014f72e41252c Mon Sep 17 00:00:00 2001 From: Shi Pujin Date: Tue, 1 Aug 2023 15:21:22 +0800 Subject: [PATCH 2/4] fix rust build Signed-off-by: Shi Pujin --- third_party/rust/authenticator/build.rs | 2 ++ .../rust/authenticator/src/linux/ioctl_loongarch64.rs | 5 +++++ third_party/rust/cty/src/lib.rs | 1 + third_party/rust/nix/src/sys/ioctl/linux.rs | 1 + 4 files changed, 9 insertions(+) create mode 100644 third_party/rust/authenticator/src/linux/ioctl_loongarch64.rs diff --git a/third_party/rust/authenticator/build.rs b/third_party/rust/authenticator/build.rs index 299e4df6d7..3e11ad4ba9 100644 --- a/third_party/rust/authenticator/build.rs +++ b/third_party/rust/authenticator/build.rs @@ -45,6 +45,8 @@ fn main() { "ioctl_aarch64be.rs" } else if cfg!(all(target_arch = "s390x", target_endian = "big")) { "ioctl_s390xbe.rs" + } else if cfg!(all(target_arch = "loongarch64", target_endian = "little")) { + "ioctl_loongarch64.rs" } else { panic!("architecture not supported"); }; diff --git a/third_party/rust/authenticator/src/linux/ioctl_loongarch64.rs b/third_party/rust/authenticator/src/linux/ioctl_loongarch64.rs new file mode 100644 index 0000000000..a784e9bf46 --- /dev/null +++ b/third_party/rust/authenticator/src/linux/ioctl_loongarch64.rs @@ -0,0 +1,5 @@ +/* automatically generated by rust-bindgen */ + +pub type __u32 = ::std::os::raw::c_uint; +pub const _HIDIOCGRDESCSIZE: __u32 = 2147764225; +pub const _HIDIOCGRDESC: __u32 = 2416199682; diff --git a/third_party/rust/cty/src/lib.rs b/third_party/rust/cty/src/lib.rs index 971c9cb3a9..80b8f3f291 100644 --- a/third_party/rust/cty/src/lib.rs +++ b/third_party/rust/cty/src/lib.rs @@ -24,6 +24,7 @@ pub use pwd::*; target_arch = "powerpc", target_arch = "powerpc64", target_arch = "s390x", + target_arch = "loongarch64", target_arch = "riscv32", target_arch = "riscv64"))] mod ad { diff --git a/third_party/rust/nix/src/sys/ioctl/linux.rs b/third_party/rust/nix/src/sys/ioctl/linux.rs index 9cdac72a4b..5e293b053f 100644 --- a/third_party/rust/nix/src/sys/ioctl/linux.rs +++ b/third_party/rust/nix/src/sys/ioctl/linux.rs @@ -33,6 +33,7 @@ mod consts { target_arch = "arm", target_arch = "s390x", target_arch = "x86_64", + target_arch = "loongarch64", target_arch = "aarch64"))] mod consts { #[doc(hidden)] -- 2.41.0