Skip to content

Commit

Permalink
Merge #987
Browse files Browse the repository at this point in the history
987: Fix builds on sparc64-unknown-linux-gnu r=asomers a=Susurrus



Co-authored-by: Bryant Mairs <[email protected]>
  • Loading branch information
bors[bot] and Susurrus committed Dec 3, 2018
2 parents 2f6196c + 4066476 commit f278094
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/sys/ioctl/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub const NRBITS: ioctl_num_type = 8;
#[doc(hidden)]
pub const TYPEBITS: ioctl_num_type = 8;

#[cfg(any(target_arch = "mips", target_arch = "mips64", target_arch = "powerpc", target_arch = "powerpc64"))]
#[cfg(any(target_arch = "mips", target_arch = "mips64", target_arch = "powerpc", target_arch = "powerpc64", target_arch = "sparc64"))]
mod consts {
#[doc(hidden)]
pub const NONE: u8 = 1;
Expand Down
2 changes: 1 addition & 1 deletion src/sys/ptrace/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use sys::signal::Signal;
pub type AddressType = *mut ::libc::c_void;

cfg_if! {
if #[cfg(any(all(target_os = "linux", arch = "s390x"),
if #[cfg(any(all(target_os = "linux", target_arch = "s390x"),
all(target_os = "linux", target_env = "gnu")))] {
#[doc(hidden)]
pub type RequestType = ::libc::c_uint;
Expand Down
10 changes: 5 additions & 5 deletions src/sys/signal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ libc_enum!{
SIGALRM,
SIGTERM,
#[cfg(all(any(target_os = "android", target_os = "emscripten", target_os = "linux"),
not(any(target_arch = "mips", target_arch = "mips64"))))]
not(any(target_arch = "mips", target_arch = "mips64", target_arch = "sparc64"))))]
SIGSTKFLT,
SIGCHLD,
SIGCONT,
Expand Down Expand Up @@ -84,7 +84,7 @@ impl FromStr for Signal {
"SIGALRM" => Signal::SIGALRM,
"SIGTERM" => Signal::SIGTERM,
#[cfg(all(any(target_os = "android", target_os = "emscripten", target_os = "linux"),
not(any(target_arch = "mips", target_arch = "mips64"))))]
not(any(target_arch = "mips", target_arch = "mips64", target_arch = "sparc64"))))]
"SIGSTKFLT" => Signal::SIGSTKFLT,
"SIGCHLD" => Signal::SIGCHLD,
"SIGCONT" => Signal::SIGCONT,
Expand Down Expand Up @@ -130,7 +130,7 @@ impl AsRef<str> for Signal {
Signal::SIGALRM => "SIGALRM",
Signal::SIGTERM => "SIGTERM",
#[cfg(all(any(target_os = "android", target_os = "emscripten", target_os = "linux"),
not(any(target_arch = "mips", target_arch = "mips64"))))]
not(any(target_arch = "mips", target_arch = "mips64", target_arch = "sparc64"))))]
Signal::SIGSTKFLT => "SIGSTKFLT",
Signal::SIGCHLD => "SIGCHLD",
Signal::SIGCONT => "SIGCONT",
Expand Down Expand Up @@ -164,7 +164,7 @@ impl fmt::Display for Signal {

pub use self::Signal::*;

#[cfg(all(any(target_os = "linux", target_os = "android", target_os = "emscripten"), not(any(target_arch = "mips", target_arch = "mips64"))))]
#[cfg(all(any(target_os = "linux", target_os = "android", target_os = "emscripten"), not(any(target_arch = "mips", target_arch = "mips64", target_arch = "sparc64"))))]
const SIGNALS: [Signal; 31] = [
SIGHUP,
SIGINT,
Expand Down Expand Up @@ -197,7 +197,7 @@ const SIGNALS: [Signal; 31] = [
SIGIO,
SIGPWR,
SIGSYS];
#[cfg(all(any(target_os = "linux", target_os = "android", target_os = "emscripten"), any(target_arch = "mips", target_arch = "mips64")))]
#[cfg(all(any(target_os = "linux", target_os = "android", target_os = "emscripten"), any(target_arch = "mips", target_arch = "mips64", target_arch = "sparc64")))]
const SIGNALS: [Signal; 30] = [
SIGHUP,
SIGINT,
Expand Down
23 changes: 13 additions & 10 deletions src/sys/termios.rs
Original file line number Diff line number Diff line change
Expand Up @@ -366,13 +366,13 @@ libc_enum!{
B1500000,
#[cfg(any(target_os = "android", target_os = "linux"))]
B2000000,
#[cfg(any(target_os = "android", target_os = "linux"))]
#[cfg(any(target_os = "android", all(target_os = "linux", not(target_arch = "sparc64"))))]
B2500000,
#[cfg(any(target_os = "android", target_os = "linux"))]
#[cfg(any(target_os = "android", all(target_os = "linux", not(target_arch = "sparc64"))))]
B3000000,
#[cfg(any(target_os = "android", target_os = "linux"))]
#[cfg(any(target_os = "android", all(target_os = "linux", not(target_arch = "sparc64"))))]
B3500000,
#[cfg(any(target_os = "android", target_os = "linux"))]
#[cfg(any(target_os = "android", all(target_os = "linux", not(target_arch = "sparc64"))))]
B4000000,
}
}
Expand All @@ -383,8 +383,9 @@ impl From<libc::speed_t> for BaudRate {
use libc::{B0, B50, B75, B110, B134, B150, B200, B300, B600, B1200, B1800, B2400, B4800,
B9600, B19200, B38400, B57600, B115200, B230400};
#[cfg(any(target_os = "android", target_os = "linux"))]
use libc::{B500000, B576000, B1000000, B1152000, B1500000, B2000000, B2500000, B3000000,
B3500000, B4000000};
use libc::{B500000, B576000, B1000000, B1152000, B1500000, B2000000};
#[cfg(any(target_os = "android", all(target_os = "linux", not(target_arch = "sparc64"))))]
use libc::{B2500000, B3000000, B3500000, B4000000};
#[cfg(any(target_os = "dragonfly",
target_os = "freebsd",
target_os = "macos",
Expand Down Expand Up @@ -463,13 +464,13 @@ impl From<libc::speed_t> for BaudRate {
B1500000 => BaudRate::B1500000,
#[cfg(any(target_os = "android", target_os = "linux"))]
B2000000 => BaudRate::B2000000,
#[cfg(any(target_os = "android", target_os = "linux"))]
#[cfg(any(target_os = "android", all(target_os = "linux", not(target_arch = "sparc64"))))]
B2500000 => BaudRate::B2500000,
#[cfg(any(target_os = "android", target_os = "linux"))]
#[cfg(any(target_os = "android", all(target_os = "linux", not(target_arch = "sparc64"))))]
B3000000 => BaudRate::B3000000,
#[cfg(any(target_os = "android", target_os = "linux"))]
#[cfg(any(target_os = "android", all(target_os = "linux", not(target_arch = "sparc64"))))]
B3500000 => BaudRate::B3500000,
#[cfg(any(target_os = "android", target_os = "linux"))]
#[cfg(any(target_os = "android", all(target_os = "linux", not(target_arch = "sparc64"))))]
B4000000 => BaudRate::B4000000,
b => unreachable!("Invalid baud constant: {}", b),
}
Expand Down Expand Up @@ -558,6 +559,7 @@ libc_enum! {
VINTR,
VKILL,
VLNEXT,
#[cfg(not(all(target_os = "linux", target_arch = "sparc64")))]
VMIN,
VQUIT,
VREPRINT,
Expand All @@ -574,6 +576,7 @@ libc_enum! {
VSWTC,
#[cfg(target_os = "haiku")]
VSWTCH,
#[cfg(not(all(target_os = "linux", target_arch = "sparc64")))]
VTIME,
VWERASE,
#[cfg(target_os = "dragonfly")]
Expand Down

0 comments on commit f278094

Please sign in to comment.