Rename sunos to solaris

This commit is contained in:
Nikita Baksalyar 2016-01-28 14:02:31 +03:00
parent 6d07b68f5e
commit e5da5d59f8
No known key found for this signature in database
GPG Key ID: 3EEA378A0EA758DA
29 changed files with 55 additions and 57 deletions

View File

@ -25,7 +25,7 @@ const OS_TABLE: &'static [(&'static str, &'static str)] = &[
("openbsd", "openbsd"),
("win32", "windows"),
("windows", "windows"),
("solaris", "sunos"),
("solaris", "solaris"),
];
const ARCH_TABLE: &'static [(&'static str, &'static str)] = &[

View File

@ -48,7 +48,7 @@ snapshot_files = {
"macos": ["bin/rustc"],
"netbsd": ["bin/rustc"],
"openbsd": ["bin/rustc"],
"sunos": ["bin/rustc"],
"solaris": ["bin/rustc"],
"winnt": ["bin/rustc.exe"],
}

View File

@ -59,7 +59,7 @@ mod freebsd_base;
mod linux_base;
mod openbsd_base;
mod netbsd_base;
mod sunos_base;
mod solaris_base;
mod windows_base;
mod windows_msvc_base;
@ -159,7 +159,7 @@ pub struct TargetOptions {
/// Whether the target toolchain is like Solaris's.
/// Only useful for compiling against Illumos/Solaris,
/// as they have a different set of linker flags. Defaults to false.
pub is_like_sunos: bool,
pub is_like_solaris: bool,
/// Whether the target toolchain is like Windows'. Only useful for compiling against Windows,
/// only really used for figuring out how to find libraries, since Windows uses its own
/// library naming convention. Defaults to false.
@ -232,7 +232,7 @@ impl Default for TargetOptions {
staticlib_suffix: ".a".to_string(),
target_family: None,
is_like_osx: false,
is_like_sunos: false,
is_like_solaris: false,
is_like_windows: false,
is_like_android: false,
is_like_msvc: false,

View File

@ -17,7 +17,7 @@ pub fn opts() -> TargetOptions {
dynamic_linking: true,
executables: true,
has_rpath: true,
is_like_sunos: true,
is_like_solaris: true,
archive_format: "gnu".to_string(),
exe_allocation_crate: super::maybe_jemalloc(),

View File

@ -11,15 +11,15 @@
use target::Target;
pub fn target() -> Target {
let mut base = super::sunos_base::opts();
let mut base = super::solaris_base::opts();
base.pre_link_args.push("-m64".to_string());
Target {
llvm_target: "x86_64-pc-solaris2.11".to_string(),
llvm_target: "x86_64-pc-solaris".to_string(),
target_endian: "little".to_string(),
target_pointer_width: "64".to_string(),
arch: "x86_64".to_string(),
target_os: "sunos".to_string(),
target_os: "solaris".to_string(),
target_env: "".to_string(),
target_vendor: "sun".to_string(),
options: base,

View File

@ -131,7 +131,7 @@ impl<'a> Linker for GnuLinker<'a> {
// insert it here.
if self.sess.target.target.options.is_like_osx {
self.cmd.arg("-Wl,-dead_strip");
} else if self.sess.target.target.options.is_like_sunos {
} else if self.sess.target.target.options.is_like_solaris {
self.cmd.arg("-Wl,-z");
self.cmd.arg("-Wl,ignore");

View File

@ -111,7 +111,7 @@ mod imp {
pub const F_SETLKW: libc::c_int = 9;
}
#[cfg(target_os = "sunos")]
#[cfg(target_os = "solaris")]
mod os {
use libc;
@ -122,8 +122,6 @@ mod imp {
pub l_len: libc::off_t,
pub l_sysid: libc::c_int,
pub l_pid: libc::pid_t,
// __unused1: [libc::c_long; 4]
}
pub const F_WRLCK: libc::c_short = 2;

View File

@ -173,7 +173,7 @@ mod tests {
target_os = "bitrig",
target_os = "netbsd",
target_os = "openbsd",
target_os = "sunos"))]
target_os = "solaris"))]
#[allow(deprecated)]
fn test_errors_do_not_crash() {
use path::Path;
@ -197,7 +197,7 @@ mod tests {
target_os = "bitrig",
target_os = "netbsd",
target_os = "openbsd",
target_os = "sunos"))]
target_os = "solaris"))]
mod dl {
use prelude::v1::*;

View File

@ -642,7 +642,7 @@ pub mod consts {
/// - bitrig
/// - netbsd
/// - openbsd
/// - sunos
/// - solaris
/// - android
/// - windows
#[stable(feature = "env", since = "1.0.0")]
@ -803,10 +803,10 @@ mod os {
pub const EXE_EXTENSION: &'static str = "";
}
#[cfg(target_os = "sunos")]
#[cfg(target_os = "solaris")]
mod os {
pub const FAMILY: &'static str = "unix";
pub const OS: &'static str = "sunos";
pub const OS: &'static str = "solaris";
pub const DLL_PREFIX: &'static str = "lib";
pub const DLL_SUFFIX: &'static str = ".so";
pub const DLL_EXTENSION: &'static str = "so";

View File

@ -1066,11 +1066,11 @@ impl f64 {
0.5 * ((2.0 * self) / (1.0 - self)).ln_1p()
}
// Illumos requires a wrapper around log, log2, and log10 functions
// Solaris/Illumos requires a wrapper around log, log2, and log10 functions
// because of their non-standard behavior (e.g. log(-n) returns -Inf instead
// of expected NaN).
fn log_wrapper<F: Fn(f64) -> f64>(self, log_fn: F) -> f64 {
if !cfg!(target_os = "sunos") {
if !cfg!(target_os = "solaris") {
log_fn(self)
} else {
if self.is_finite() {

View File

@ -30,6 +30,6 @@ pub use sys::ext as windows;
#[cfg(target_os = "nacl")] pub mod nacl;
#[cfg(target_os = "netbsd")] pub mod netbsd;
#[cfg(target_os = "openbsd")] pub mod openbsd;
#[cfg(target_os = "sunos")] pub mod sunos;
#[cfg(target_os = "solaris")] pub mod solaris;
pub mod raw;

View File

@ -39,7 +39,7 @@ extern {}
#[link(name = "pthread")]
extern {}
#[cfg(target_os = "sunos")]
#[cfg(target_os = "solaris")]
#[link(name = "socket")]
#[link(name = "posix4")]
#[link(name = "pthread")]

View File

@ -39,7 +39,7 @@ pub fn clone() -> Option<Vec<Vec<u8>>> { imp::clone() }
target_os = "bitrig",
target_os = "netbsd",
target_os = "openbsd",
target_os = "sunos"))]
target_os = "solaris"))]
mod imp {
use prelude::v1::*;

View File

@ -102,7 +102,7 @@ pub type _Unwind_Exception_Cleanup_Fn =
#[cfg_attr(any(all(target_os = "linux", not(target_env = "musl")),
target_os = "freebsd",
target_os = "sunos",
target_os = "solaris",
all(target_os = "linux", target_env = "musl", not(target_arch = "x86_64"))),
link(name = "gcc_s"))]
#[cfg_attr(all(target_os = "linux", target_env = "musl", target_arch = "x86_64", not(test)),

View File

@ -50,14 +50,14 @@ impl FileDesc {
Ok(ret as usize)
}
#[cfg(not(any(target_env = "newlib", target_os = "sunos")))]
#[cfg(not(any(target_env = "newlib", target_os = "solaris")))]
pub fn set_cloexec(&self) {
unsafe {
let ret = libc::ioctl(self.fd, libc::FIOCLEX);
debug_assert_eq!(ret, 0);
}
}
#[cfg(any(target_env = "newlib", target_os = "sunos"))]
#[cfg(any(target_env = "newlib", target_os = "solaris"))]
pub fn set_cloexec(&self) {
unsafe {
let previous = libc::fcntl(self.fd, libc::F_GETFD);

View File

@ -24,9 +24,9 @@ use sys::platform::raw;
use sys::{cvt, cvt_r};
use sys_common::{AsInner, FromInner};
use vec::Vec;
#[cfg(target_os = "sunos")]
#[cfg(target_os = "solaris")]
use core_collections::borrow::ToOwned;
#[cfg(target_os = "sunos")]
#[cfg(target_os = "solaris")]
use boxed::Box;
pub struct File(FileDesc);
@ -53,7 +53,7 @@ pub struct DirEntry {
// on Solaris because a) it uses a zero-length array to
// store the name, b) its lifetime between readdir calls
// is not guaranteed.
#[cfg(target_os = "sunos")]
#[cfg(target_os = "solaris")]
name: Box<[u8]>
}
@ -141,7 +141,7 @@ impl FromInner<raw::mode_t> for FilePermissions {
impl Iterator for ReadDir {
type Item = io::Result<DirEntry>;
#[cfg(target_os = "sunos")]
#[cfg(target_os = "solaris")]
fn next(&mut self) -> Option<io::Result<DirEntry>> {
unsafe {
loop {
@ -170,7 +170,7 @@ impl Iterator for ReadDir {
}
}
#[cfg(not(target_os = "sunos"))]
#[cfg(not(target_os = "solaris"))]
fn next(&mut self) -> Option<io::Result<DirEntry>> {
unsafe {
let mut ret = DirEntry {
@ -213,12 +213,12 @@ impl DirEntry {
lstat(&self.path())
}
#[cfg(target_os = "sunos")]
#[cfg(target_os = "solaris")]
pub fn file_type(&self) -> io::Result<FileType> {
stat(&self.path()).map(|m| m.file_type())
}
#[cfg(not(target_os = "sunos"))]
#[cfg(not(target_os = "solaris"))]
pub fn file_type(&self) -> io::Result<FileType> {
match self.entry.d_type {
libc::DT_CHR => Ok(FileType { mode: libc::S_IFCHR }),
@ -235,7 +235,7 @@ impl DirEntry {
#[cfg(any(target_os = "macos",
target_os = "ios",
target_os = "linux",
target_os = "sunos"))]
target_os = "solaris"))]
pub fn ino(&self) -> raw::ino_t {
self.entry.d_ino
}
@ -280,7 +280,7 @@ impl DirEntry {
CStr::from_ptr(self.entry.d_name.as_ptr()).to_bytes()
}
}
#[cfg(target_os = "sunos")]
#[cfg(target_os = "solaris")]
fn name_bytes(&self) -> &[u8] {
&*self.name
}

View File

@ -25,7 +25,7 @@ use ops::Neg;
#[cfg(target_os = "nacl")] pub use os::nacl as platform;
#[cfg(target_os = "netbsd")] pub use os::netbsd as platform;
#[cfg(target_os = "openbsd")] pub use os::openbsd as platform;
#[cfg(target_os = "sunos")] pub use os::sunos as platform;
#[cfg(target_os = "solaris")] pub use os::solaris as platform;
pub mod backtrace;
pub mod condvar;

View File

@ -45,7 +45,7 @@ pub fn errno() -> i32 {
target_os = "android",
target_env = "newlib"),
link_name = "__errno")]
#[cfg_attr(target_os = "sunos", link_name = "___errno")]
#[cfg_attr(target_os = "solaris", link_name = "___errno")]
#[cfg_attr(target_os = "dragonfly", link_name = "__dfly_error")]
#[cfg_attr(any(target_os = "macos",
target_os = "ios",
@ -258,7 +258,7 @@ pub fn current_exe() -> io::Result<PathBuf> {
}
}
#[cfg(any(target_os = "sunos"))]
#[cfg(any(target_os = "solaris"))]
pub fn current_exe() -> io::Result<PathBuf> {
extern {
fn getexecname() -> *const c_char;
@ -384,7 +384,7 @@ pub fn args() -> Args {
target_os = "bitrig",
target_os = "netbsd",
target_os = "openbsd",
target_os = "sunos",
target_os = "solaris",
target_os = "nacl"))]
pub fn args() -> Args {
use sys_common;
@ -507,7 +507,7 @@ pub fn home_dir() -> Option<PathBuf> {
fallback()
}).map(PathBuf::from);
#[cfg(not(target_os = "sunos"))]
#[cfg(not(target_os = "solaris"))]
unsafe fn getpwduid_r(me: libc::uid_t, passwd: &mut libc::passwd,
buf: &mut Vec<c_char>) -> Option<()> {
let mut result = ptr::null_mut();
@ -519,7 +519,7 @@ pub fn home_dir() -> Option<PathBuf> {
}
}
#[cfg(target_os = "sunos")]
#[cfg(target_os = "solaris")]
unsafe fn getpwduid_r(me: libc::uid_t, passwd: &mut libc::passwd,
buf: &mut Vec<c_char>) -> Option<()> {
// getpwuid_r semantics is different on Illumos/Solaris:

View File

@ -93,7 +93,7 @@ fn os2c(s: &OsStr) -> CString {
pub struct ExitStatus(c_int);
#[cfg(any(target_os = "linux", target_os = "android",
target_os = "nacl", target_os = "sunos"))]
target_os = "nacl", target_os = "solaris"))]
mod status_imp {
pub fn WIFEXITED(status: i32) -> bool { (status & 0xff) == 0 }
pub fn WEXITSTATUS(status: i32) -> i32 { (status >> 8) & 0xff }

View File

@ -39,7 +39,7 @@ impl Drop for Handler {
target_os = "bitrig",
target_os = "dragonfly",
target_os = "freebsd",
target_os = "sunos",
target_os = "solaris",
all(target_os = "netbsd", not(target_vendor = "rumprun")),
target_os = "openbsd"))]
mod imp {
@ -168,7 +168,7 @@ mod imp {
target_os = "bitrig",
target_os = "dragonfly",
target_os = "freebsd",
target_os = "sunos",
target_os = "solaris",
all(target_os = "netbsd", not(target_vendor = "rumprun")),
target_os = "openbsd")))]
mod imp {

View File

@ -12,7 +12,7 @@ use prelude::v1::*;
use alloc::boxed::FnBox;
use cmp;
#[cfg(not(any(target_env = "newlib", target_os = "sunos")))]
#[cfg(not(any(target_env = "newlib", target_os = "solaris")))]
use ffi::CString;
use io;
use libc;
@ -122,7 +122,7 @@ impl Thread {
carg.as_ptr() as *mut libc::c_void);
}
}
#[cfg(any(target_env = "newlib", target_os = "sunos"))]
#[cfg(any(target_env = "newlib", target_os = "solaris"))]
pub fn set_name(_name: &str) {
// Newlib and Illumos has no way to set a thread name.
}
@ -171,7 +171,7 @@ impl Drop for Thread {
not(target_os = "bitrig"),
not(all(target_os = "netbsd", not(target_vendor = "rumprun"))),
not(target_os = "openbsd"),
not(target_os = "sunos")))]
not(target_os = "solaris")))]
#[cfg_attr(test, allow(dead_code))]
pub mod guard {
pub unsafe fn current() -> Option<usize> { None }
@ -184,7 +184,7 @@ pub mod guard {
target_os = "bitrig",
all(target_os = "netbsd", not(target_vendor = "rumprun")),
target_os = "openbsd",
target_os = "sunos"))]
target_os = "solaris"))]
#[cfg_attr(test, allow(dead_code))]
pub mod guard {
use prelude::v1::*;
@ -197,7 +197,7 @@ pub mod guard {
#[cfg(any(target_os = "macos",
target_os = "bitrig",
target_os = "openbsd",
target_os = "sunos"))]
target_os = "solaris"))]
unsafe fn get_stack_start() -> Option<*mut libc::c_void> {
current().map(|s| s as *mut libc::c_void)
}
@ -256,7 +256,7 @@ pub mod guard {
Some(stackaddr as usize + offset * psize)
}
#[cfg(target_os = "sunos")]
#[cfg(target_os = "solaris")]
pub unsafe fn current() -> Option<usize> {
let mut current_stack: libc::stack_t = mem::zeroed();
assert_eq!(libc::stack_getbounds(&mut current_stack), 0);

View File

@ -28,7 +28,7 @@ pub enum Os {
OsNetbsd,
OsOpenbsd,
OsNaCl,
OsSunos,
OsSolaris,
}
#[derive(PartialEq, Eq, Hash, RustcEncodable, RustcDecodable, Clone, Copy, Debug)]
@ -148,7 +148,7 @@ impl fmt::Display for Os {
OsNetbsd => "netbsd".fmt(f),
OsOpenbsd => "openbsd".fmt(f),
OsNaCl => "nacl".fmt(f),
OsSunos => "sunos".fmt(f),
OsSolaris => "solaris".fmt(f),
}
}
}

View File

@ -928,7 +928,7 @@ fn get_concurrency() -> usize {
target_os = "macos",
target_os = "ios",
target_os = "android",
target_os = "sunos"))]
target_os = "solaris"))]
fn num_cpus() -> usize {
unsafe { libc::sysconf(libc::_SC_NPROCESSORS_ONLN) as usize }
}

View File

@ -9,7 +9,7 @@
// except according to those terms.
// ignore-bitrig
// ignore-sunos
// ignore-solaris
// ignore-windows failing on win32 bot
// ignore-freebsd: gdb package too new
// ignore-tidy-linelength

View File

@ -24,7 +24,7 @@ mod rusti {
target_os = "dragonfly",
target_os = "netbsd",
target_os = "openbsd",
target_os = "sunos"))]
target_os = "solaris"))]
mod m {
#[main]
#[cfg(target_arch = "x86")]

View File

@ -42,7 +42,7 @@ struct Outer {
target_os = "dragonfly",
target_os = "netbsd",
target_os = "openbsd",
target_os = "sunos"))]
target_os = "solaris"))]
mod m {
#[cfg(target_arch = "x86")]
pub mod m {

View File

@ -38,5 +38,5 @@ pub fn main() {
target_os = "netbsd",
target_os = "openbsd",
target_os = "android",
target_os = "sunos"))]
target_os = "solaris"))]
pub fn main() { }