diff --git a/Cargo.toml b/Cargo.toml index 0462155b32..da93af5fbd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -91,7 +91,7 @@ rand_jitter = "0.6" memchr = { version = "2.2.0", default-features = false } plain.workspace = true unicode-width = "0.1" -__libc_only_for_layout_checks = { package = "libc", version = "0.2.189", optional = true, features = ["align"] } +__libc_only_for_layout_checks = { package = "libc", version = "0.2.149", optional = true } md5-crypto = { package = "md-5", version = "0.10.6", default-features = false } sha-crypt = { version = "0.5", default-features = false } base64ct = { version = "1.6", default-features = false, features = ["alloc"] } diff --git a/src/ld_so/dso.rs b/src/ld_so/dso.rs index 034e562805..8d0440478b 100644 --- a/src/ld_so/dso.rs +++ b/src/ld_so/dso.rs @@ -4,9 +4,12 @@ use object::{ NativeEndian, Object, StringTable, SymbolIndex, U32, elf, - read::elf::{ - Dyn as _, GnuHashTable, HashTable as SysVHashTable, ProgramHeader as _, Rel as _, - Rela as _, Sym as _, Version, VersionTable, + read::{ + elf::{ + Dyn as _, GnuHashTable, HashTable as SysVHashTable, ProgramHeader as _, + Rel as _, Rela as _, Sym as _, Version, VersionTable, + }, + ReadError, }, }; @@ -1127,7 +1130,10 @@ impl DSO { self.do_tlsdesc_reloc(reloc, ptr.cast::(), global_scope) } _ => { - panic!("static_relocate: unsupported relocation type {:?}", reloc.kind); + None::<()>.read_error(concat!( + "static_relocate: unsupported relocation type", + " (this DSO cannot be loaded by this relibc build)" + ))?; } } @@ -1202,11 +1208,11 @@ impl DSO { } _ => { - panic!( - "lazy_relocate: unsupported relocation type {:?} with resolve {:?}", - reloc.kind, - resolve - ); + None::<()>.read_error(concat!( + "lazy_relocate: unsupported relocation type with \ + non-Lazy resolve (DSO cannot be loaded by this \ + relibc build)" + ))?; } } } diff --git a/src/platform/redox/socket.rs b/src/platform/redox/socket.rs index 7b5b75a3eb..58a756db56 100644 --- a/src/platform/redox/socket.rs +++ b/src/platform/redox/socket.rs @@ -1120,10 +1120,11 @@ unsafe { unsafe { serialize_ancillary_data_to_stream(msg, mhdr, socket, &mut msg_stream) })?; } - // Send the message stream. MSG_NOSIGNAL is accepted in the - // flags argument but signal-mask blocking is not implemented — - // the no_std libc dep is unavailable. Kernel-side MSG_NOSIGNAL - // is the proper long-term fix. + // Send the message stream. MSG_NOSIGNAL is forwarded to the netstack + // scheme via metadata[1]; the netstack performs SIGPIPE blocking + // (base netstack tcp.rs:66-98). relibc itself cannot do signal + // masking — it is the libc implementation and must not depend + // on the libc crate at runtime. let metadata = [SocketCall::SendMsg as u64, flags as u64]; let call_flags = CallFlags::empty(); let _written = redox_rt::sys::sys_call_rw( @@ -1144,10 +1145,9 @@ unsafe { serialize_ancillary_data_to_stream(msg, mhdr, socket, &mut msg_stream) dest_addr: *const sockaddr, dest_len: socklen_t, ) -> Result { - // MSG_NOSIGNAL handling lives in Self::sendmsg (see sigprocmask - // block there). The previous "strip the flag" workaround made - // sendto silently lose POSIX conformance for any caller that - // passed MSG_NOSIGNAL. Forward the original flags. + // MSG_NOSIGNAL is forwarded to the netstack scheme daemon which + // performs SIGPIPE blocking — the previous "strip the flag" + // workaround lost POSIX conformance for callers that passed it. // // (The "TCP lacks SocketCall::SendMsg handling" TODO is also // stale: the netstack scheme handler at