1
Fork 0

Rollup merge of #61761 - lzutao:target-tuple-solaris, r=varkor

Add an alias for x86_64-sun-solaris target tuple

Closes #40531

r? @varkor
This commit is contained in:
Mazdak Farrokhzad 2019-06-13 01:49:32 +02:00 committed by GitHub
commit b03ffbc69a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 8 deletions

View file

@ -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;
@ -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]
@ -322,9 +322,9 @@ macro_rules! supported_targets {
assert_eq!(original, parsed);
});
}
)*
)+
}
)
};
}
supported_targets! {
@ -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),

View file

@ -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",