Skip to content

Commit

Permalink
Rollup merge of rust-lang#61761 - lzutao:target-tuple-solaris, r=varkor
Browse files Browse the repository at this point in the history
Add an alias for x86_64-sun-solaris target tuple

Closes rust-lang#40531

r? @varkor
  • Loading branch information
Centril authored Jun 12, 2019
2 parents 4cbae09 + 7c8644d commit b03ffbc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/librustc_target/spec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,16 +268,16 @@ pub type LinkArgs = BTreeMap<LinkerFlavor, Vec<String>>;
pub type TargetResult = Result<Target, String>;

macro_rules! supported_targets {
( $(($triple:expr, $module:ident),)+ ) => (
$(mod $module;)*
( $(($( $triple:literal, )+ $module:ident ),)+ ) => {
$(mod $module;)+

/// List of supported targets
const TARGETS: &[&str] = &[$($triple),*];
const TARGETS: &[&str] = &[$($($triple),+),+];

fn load_specific(target: &str) -> Result<Target, LoadTargetError> {
match target {
$(
$triple => {
$($triple)|+ => {
let mut t = $module::target()
.map_err(LoadTargetError::Other)?;
t.options.is_builtin = true;
Expand Down Expand Up @@ -307,7 +307,7 @@ macro_rules! supported_targets {
mod test_json_encode_decode {
use serialize::json::ToJson;
use super::Target;
$(use super::$module;)*
$(use super::$module;)+

$(
#[test]
Expand All @@ -322,9 +322,9 @@ macro_rules! supported_targets {
assert_eq!(original, parsed);
});
}
)*
)+
}
)
};
}

supported_targets! {
Expand Down Expand Up @@ -426,7 +426,9 @@ supported_targets! {
("armv7r-none-eabi", armv7r_none_eabi),
("armv7r-none-eabihf", armv7r_none_eabihf),

("x86_64-sun-solaris", x86_64_sun_solaris),
// `x86_64-pc-solaris` is an alias for `x86_64_sun_solaris` for backwards compatibility reasons.
// (See <https://github.com/rust-lang/rust/issues/40531>.)
("x86_64-sun-solaris", "x86_64-pc-solaris", x86_64_sun_solaris),
("sparcv9-sun-solaris", sparcv9_sun_solaris),

("x86_64-pc-windows-gnu", x86_64_pc_windows_gnu),
Expand Down
1 change: 1 addition & 0 deletions src/tools/build-manifest/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ static TARGETS: &[&str] = &[
"x86_64-pc-windows-msvc",
"x86_64-rumprun-netbsd",
"x86_64-sun-solaris",
"x86_64-pc-solaris",
"x86_64-unknown-cloudabi",
"x86_64-unknown-freebsd",
"x86_64-unknown-linux-gnu",
Expand Down

0 comments on commit b03ffbc

Please sign in to comment.