Skip to content

Commit

Permalink
Support NTO without RUSTFLAGS
Browse files Browse the repository at this point in the history
Removes the need for --cfg mio_unsupported_force_poll_poll.
  • Loading branch information
Thomasdezeeuw committed Jun 9, 2024
1 parent 5200f6c commit 8911d61
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 4 deletions.
11 changes: 10 additions & 1 deletion src/poll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
not(any(
target_os = "espidf",
target_os = "hermit",
target_os = "nto",
target_os = "solaris",
target_os = "vita"
)),
Expand Down Expand Up @@ -438,6 +439,7 @@ impl Poll {
not(any(
target_os = "espidf",
target_os = "hermit",
target_os = "nto",
target_os = "solaris",
target_os = "vita"
)),
Expand Down Expand Up @@ -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"
)),
Expand All @@ -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() {
Expand Down
7 changes: 4 additions & 3 deletions src/sys/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

Expand All @@ -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",
Expand Down
3 changes: 3 additions & 0 deletions src/sys/unix/selector/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
))]
Expand All @@ -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",
))]
Expand All @@ -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",
))]
Expand Down
2 changes: 2 additions & 0 deletions src/sys/unix/uds/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
7 changes: 7 additions & 0 deletions src/sys/unix/waker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
not(any(
target_os = "espidf",
target_os = "hermit",
target_os = "nto",
target_os = "solaris",
target_os = "vita"
)),
Expand Down Expand Up @@ -72,6 +73,7 @@ mod fdbased {
not(any(
target_os = "espidf",
target_os = "hermit",
target_os = "nto",
target_os = "solaris",
target_os = "vita"
)),
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
))]
Expand Down Expand Up @@ -322,6 +326,7 @@ mod pipe {
target_os = "redox",
)
),
target_os = "nto",
target_os = "solaris",
target_os = "vita",
))]
Expand All @@ -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",
))]
Expand Down Expand Up @@ -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",
))]
Expand Down

0 comments on commit 8911d61

Please sign in to comment.