Change default Solaris x86 target to x86_64-pc-solaris

This commit is contained in:
Jakub Kulik 2021-02-16 15:02:04 +01:00
parent d2731d8e93
commit c615bed387
7 changed files with 28 additions and 24 deletions

View File

@ -1536,7 +1536,7 @@ fn parse_target_triple(matches: &getopts::Matches, error_format: ErrorOutputType
early_error(error_format, &format!("target file {:?} does not exist", path))
})
}
Some(target) => TargetTriple::from_alias(target),
Some(target) => TargetTriple::TargetTriple(target),
_ => TargetTriple::from_triple(host_triple()),
}
}

View File

@ -736,9 +736,8 @@ supported_targets! {
("armv7r-none-eabi", armv7r_none_eabi),
("armv7r-none-eabihf", armv7r_none_eabihf),
// `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),
("x86_64-pc-solaris", x86_64_pc_solaris),
("x86_64-sun-solaris", x86_64_sun_solaris),
("sparcv9-sun-solaris", sparcv9_sun_solaris),
("x86_64-unknown-illumos", x86_64_unknown_illumos),
@ -1986,24 +1985,6 @@ impl TargetTriple {
Ok(TargetTriple::TargetPath(canonicalized_path))
}
/// Creates a target triple from its alias
pub fn from_alias(triple: String) -> Self {
macro_rules! target_aliases {
( $(($alias:literal, $target:literal ),)+ ) => {
match triple.as_str() {
$( $alias => TargetTriple::from_triple($target), )+
_ => TargetTriple::TargetTriple(triple),
}
}
}
target_aliases! {
// `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-pc-solaris", "x86_64-sun-solaris"),
}
}
/// Returns a string triple for this target.
///
/// If this target is a path, the file name (without extension) is returned.

View File

@ -3,7 +3,6 @@ use crate::spec::TargetOptions;
pub fn opts() -> TargetOptions {
TargetOptions {
os: "solaris".to_string(),
vendor: "sun".to_string(),
dynamic_linking: true,
executables: true,
has_rpath: true,

View File

@ -7,6 +7,7 @@ pub fn target() -> Target {
base.pre_link_args.insert(LinkerFlavor::Gcc, vec!["-m64".to_string()]);
// llvm calls this "v9"
base.cpu = "v9".to_string();
base.vendor = "sun".to_string();
base.max_atomic_width = Some(64);
Target {

View File

@ -0,0 +1,19 @@
use crate::spec::{LinkerFlavor, StackProbeType, Target};
pub fn target() -> Target {
let mut base = super::solaris_base::opts();
base.pre_link_args.insert(LinkerFlavor::Gcc, vec!["-m64".to_string()]);
base.cpu = "x86-64".to_string();
base.vendor = "pc".to_string();
base.max_atomic_width = Some(64);
base.stack_probes = StackProbeType::InlineOrCall { min_llvm_version_for_inline: (11, 0, 1) };
Target {
llvm_target: "x86_64-pc-solaris".to_string(),
pointer_width: 64,
data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
.to_string(),
arch: "x86_64".to_string(),
options: base,
}
}

View File

@ -4,6 +4,7 @@ pub fn target() -> Target {
let mut base = super::solaris_base::opts();
base.pre_link_args.insert(LinkerFlavor::Gcc, vec!["-m64".to_string()]);
base.cpu = "x86-64".to_string();
base.vendor = "sun".to_string();
base.max_atomic_width = Some(64);
base.stack_probes = StackProbeType::InlineOrCall { min_llvm_version_for_inline: (11, 0, 1) };

View File

@ -240,13 +240,16 @@ def default_build_triple(verbose):
else:
ostype = 'unknown-linux-gnu'
elif ostype == 'SunOS':
ostype = 'sun-solaris'
ostype = 'pc-solaris'
# On Solaris, uname -m will return a machine classification instead
# of a cpu type, so uname -p is recommended instead. However, the
# output from that option is too generic for our purposes (it will
# always emit 'i386' on x86/amd64 systems). As such, isainfo -k
# must be used instead.
cputype = require(['isainfo', '-k']).decode(default_encoding)
# sparc cpus have sun as a target vendor
if 'sparc' in cputype:
ostype = 'sun-solaris'
elif ostype.startswith('MINGW'):
# msys' `uname` does not print gcc configuration, but prints msys
# configuration. so we cannot believe `uname -m`: