Skip to content

Commit c813545

Browse files
committed
Auto merge of #80088 - operutka:fix-cmsg-len-uclibc, r=dtolnay
Fix failing build of std on armv5te-unknown-linux-uclibceabi due to missing cmsg_len_zero I'm getting the following error when trying to build `std` on `armv5te-unknown-linux-uclibceabi`: ``` error[E0425]: cannot find value `cmsg_len_zero` in this scope --> /home/operutka/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/unix/ext/net/ancillary.rs:376:47 | 376 | let data_len = (*cmsg).cmsg_len - cmsg_len_zero; | ^^^^^^^^^^^^^ not found in this scope ``` Obviously, this branch: ```rust cfg_if::cfg_if! { if #[cfg(any(target_os = "android", all(target_os = "linux", target_env = "gnu")))] { let cmsg_len_zero = libc::CMSG_LEN(0) as libc::size_t; } else if #[cfg(any( target_os = "dragonfly", target_os = "emscripten", target_os = "freebsd", all(target_os = "linux", target_env = "musl",), target_os = "netbsd", target_os = "openbsd", ))] { let cmsg_len_zero = libc::CMSG_LEN(0) as libc::socklen_t; } } ``` does not cover the case `all(target_os = "linux", target_env = "uclibc")`.
2 parents c609b2e + ec07815 commit c813545

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

library/std/src/sys/unix/ext/net/ancillary.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,11 @@ impl<'a> AncillaryData<'a> {
360360
fn try_from_cmsghdr(cmsg: &'a libc::cmsghdr) -> Result<Self, AncillaryError> {
361361
unsafe {
362362
cfg_if::cfg_if! {
363-
if #[cfg(any(target_os = "android", all(target_os = "linux", target_env = "gnu")))] {
363+
if #[cfg(any(
364+
target_os = "android",
365+
all(target_os = "linux", target_env = "gnu"),
366+
all(target_os = "linux", target_env = "uclibc"),
367+
))] {
364368
let cmsg_len_zero = libc::CMSG_LEN(0) as libc::size_t;
365369
} else if #[cfg(any(
366370
target_os = "dragonfly",

0 commit comments

Comments
 (0)