From d7c117283567fb5bd4d1470aa232f719e9db1fdf Mon Sep 17 00:00:00 2001 From: WANG Rui Date: Mon, 1 Sep 2025 19:06:13 +0800 Subject: [PATCH] Do not define `statx_flags` for LoongArch64 with musl `libc` already defines constants like `STATX_TYPE` for `musl 1.2.3+` [^1], so `statx_flags` is unnecessary in this environment. [^1]: https://docs.rs/libc/latest/src/libc/unix/linux_like/mod.rs.html#1679 Fixes #1502 --- src/backend/libc/c.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/backend/libc/c.rs b/src/backend/libc/c.rs index 567fb7e02..27845a47b 100644 --- a/src/backend/libc/c.rs +++ b/src/backend/libc/c.rs @@ -490,7 +490,11 @@ pub(super) use readwrite_pv64v2::{preadv64v2 as preadv2, pwritev64v2 as pwritev2 #[cfg(all( linux_like, linux_raw_dep, - not(any(target_os = "emscripten", target_env = "gnu")) + not(any( + target_os = "emscripten", + target_env = "gnu", + all(target_arch = "loongarch64", target_env = "musl") + )) ))] mod statx_flags { pub(crate) use linux_raw_sys::general::{ @@ -509,7 +513,11 @@ mod statx_flags { #[cfg(all( linux_like, linux_raw_dep, - not(any(target_os = "emscripten", target_env = "gnu")) + not(any( + target_os = "emscripten", + target_env = "gnu", + all(target_arch = "loongarch64", target_env = "musl") + )) ))] pub(crate) use statx_flags::*;