From 8911d6176f91fd47b0d32d7af12100e6c474e15d Mon Sep 17 00:00:00 2001 From: Thomas de Zeeuw Date: Sun, 9 Jun 2024 17:57:20 +0200 Subject: [PATCH] Support NTO without RUSTFLAGS Removes the need for --cfg mio_unsupported_force_poll_poll. --- src/poll.rs | 11 ++++++++++- src/sys/unix/mod.rs | 7 ++++--- src/sys/unix/selector/mod.rs | 3 +++ src/sys/unix/uds/mod.rs | 2 ++ src/sys/unix/waker.rs | 7 +++++++ 5 files changed, 26 insertions(+), 4 deletions(-) diff --git a/src/poll.rs b/src/poll.rs index 8b0da06f9..bf91bfed7 100644 --- a/src/poll.rs +++ b/src/poll.rs @@ -4,6 +4,7 @@ not(any( target_os = "espidf", target_os = "hermit", + target_os = "nto", target_os = "solaris", target_os = "vita" )), @@ -438,6 +439,7 @@ impl Poll { not(any( target_os = "espidf", target_os = "hermit", + target_os = "nto", target_os = "solaris", target_os = "vita" )), @@ -734,6 +736,7 @@ impl fmt::Debug for Registry { not(any( target_os = "espidf", target_os = "hermit", + target_os = "nto", target_os = "solaris", target_os = "vita" )), @@ -748,7 +751,13 @@ cfg_os_poll! { #[cfg(all( unix, not(mio_unsupported_force_poll_poll), - not(any(target_os = "espidf", target_os = "hermit", target_os = "solaris", target_os = "vita")), + not(any( + target_os = "espidf", + target_os = "hermit", + target_os = "nto", + target_os = "solaris", + target_os = "vita" + )), ))] #[test] pub fn as_raw_fd() { diff --git a/src/sys/unix/mod.rs b/src/sys/unix/mod.rs index dc53b4341..ad411a625 100644 --- a/src/sys/unix/mod.rs +++ b/src/sys/unix/mod.rs @@ -36,7 +36,7 @@ cfg_os_poll! { cfg_io_source! { // Both `kqueue` and `epoll` don't need to hold any user space state. - #[cfg(not(any(mio_unsupported_force_poll_poll, target_os = "espidf", target_os = "hermit", target_os = "solaris", target_os = "vita")))] + #[cfg(not(any(mio_unsupported_force_poll_poll, target_os = "espidf", target_os = "hermit", target_os = "nto", target_os = "solaris", target_os = "vita")))] mod stateless_io_source { use std::io; use std::os::fd::RawFd; @@ -88,10 +88,10 @@ cfg_os_poll! { } } - #[cfg(not(any(mio_unsupported_force_poll_poll, target_os = "espidf", target_os = "hermit", target_os = "solaris", target_os = "vita")))] + #[cfg(not(any(mio_unsupported_force_poll_poll, target_os = "espidf", target_os = "hermit", target_os = "nto", target_os = "solaris", target_os = "vita")))] pub(crate) use self::stateless_io_source::IoSourceState; - #[cfg(any(mio_unsupported_force_poll_poll, target_os = "espidf", target_os = "hermit", target_os = "solaris", target_os = "vita"))] + #[cfg(any(mio_unsupported_force_poll_poll, target_os = "espidf", target_os = "hermit", target_os = "nto", target_os = "solaris", target_os = "vita"))] pub(crate) use self::selector::IoSourceState; } @@ -104,6 +104,7 @@ cfg_os_poll! { target_os = "dragonfly", target_os = "illumos", target_os = "netbsd", + target_os = "nto", target_os = "openbsd", target_os = "redox", target_os = "solaris", diff --git a/src/sys/unix/selector/mod.rs b/src/sys/unix/selector/mod.rs index b9be0e1d7..e1ec12155 100644 --- a/src/sys/unix/selector/mod.rs +++ b/src/sys/unix/selector/mod.rs @@ -24,6 +24,7 @@ pub(crate) use self::epoll::{event, Event, Events, Selector}; mio_unsupported_force_poll_poll, target_os = "espidf", target_os = "hermit", + target_os = "nto", target_os = "solaris", target_os = "vita", ))] @@ -33,6 +34,7 @@ mod poll; mio_unsupported_force_poll_poll, target_os = "espidf", target_os = "hermit", + target_os = "nto", target_os = "solaris", target_os = "vita", ))] @@ -43,6 +45,7 @@ cfg_io_source! { mio_unsupported_force_poll_poll, target_os = "espidf", target_os = "hermit", + target_os = "nto", target_os = "solaris", target_os = "vita", ))] diff --git a/src/sys/unix/uds/mod.rs b/src/sys/unix/uds/mod.rs index 42508612b..e9cc82b7d 100644 --- a/src/sys/unix/uds/mod.rs +++ b/src/sys/unix/uds/mod.rs @@ -89,6 +89,7 @@ where target_os = "aix", target_os = "ios", target_os = "macos", + target_os = "nto", target_os = "tvos", target_os = "watchos", target_os = "espidf", @@ -110,6 +111,7 @@ where target_os = "aix", target_os = "ios", target_os = "macos", + target_os = "nto", target_os = "tvos", target_os = "watchos", target_os = "espidf", diff --git a/src/sys/unix/waker.rs b/src/sys/unix/waker.rs index a77ee2270..10141aadd 100644 --- a/src/sys/unix/waker.rs +++ b/src/sys/unix/waker.rs @@ -13,6 +13,7 @@ not(any( target_os = "espidf", target_os = "hermit", + target_os = "nto", target_os = "solaris", target_os = "vita" )), @@ -72,6 +73,7 @@ mod fdbased { not(any( target_os = "espidf", target_os = "hermit", + target_os = "nto", target_os = "solaris", target_os = "vita" )), @@ -230,6 +232,7 @@ pub use self::kqueue::Waker; target_os = "dragonfly", target_os = "illumos", target_os = "netbsd", + target_os = "nto", target_os = "openbsd", target_os = "redox", target_os = "solaris", @@ -282,6 +285,7 @@ mod pipe { #[cfg(any( mio_unsupported_force_poll_poll, target_os = "espidf", + target_os = "nto", target_os = "solaris", target_os = "vita", ))] @@ -322,6 +326,7 @@ mod pipe { target_os = "redox", ) ), + target_os = "nto", target_os = "solaris", target_os = "vita", ))] @@ -331,6 +336,7 @@ pub(crate) use self::pipe::WakerInternal; mio_unsupported_force_poll_poll, target_os = "espidf", target_os = "hermit", + target_os = "nto", target_os = "solaris", target_os = "vita", ))] @@ -363,6 +369,7 @@ mod poll { mio_unsupported_force_poll_poll, target_os = "espidf", target_os = "hermit", + target_os = "nto", target_os = "solaris", target_os = "vita", ))]