mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 15:23:46 +00:00
Rollup merge of #39903 - binarycrusader:issue-39901, r=alexcrichton
add solaris sparcv9 support Fixes #39901
This commit is contained in:
commit
a6924177e4
@ -485,6 +485,8 @@ class RustBuild(object):
|
||||
ostype += 'abi64'
|
||||
elif cputype in {'powerpc', 'ppc', 'ppc64'}:
|
||||
cputype = 'powerpc'
|
||||
elif cputype == 'sparcv9':
|
||||
pass
|
||||
elif cputype in {'amd64', 'x86_64', 'x86-64', 'x64'}:
|
||||
cputype = 'x86_64'
|
||||
else:
|
||||
|
@ -92,7 +92,15 @@ fn main() {
|
||||
// compiler-rt's build system already
|
||||
cfg.flag("-fno-builtin");
|
||||
cfg.flag("-fvisibility=hidden");
|
||||
cfg.flag("-fomit-frame-pointer");
|
||||
// Accepted practice on Solaris is to never omit frame pointer so that
|
||||
// system observability tools work as expected. In addition, at least
|
||||
// on Solaris, -fomit-frame-pointer on sparcv9 appears to generate
|
||||
// references to data outside of the current stack frame. A search of
|
||||
// the gcc bug database provides a variety of issues surrounding
|
||||
// -fomit-frame-pointer on non-x86 platforms.
|
||||
if !target.contains("solaris") && !target.contains("sparc") {
|
||||
cfg.flag("-fomit-frame-pointer");
|
||||
}
|
||||
cfg.flag("-ffreestanding");
|
||||
cfg.define("VISIBILITY_HIDDEN", None);
|
||||
}
|
||||
|
@ -200,6 +200,7 @@ supported_targets! {
|
||||
("armv7s-apple-ios", armv7s_apple_ios),
|
||||
|
||||
("x86_64-sun-solaris", x86_64_sun_solaris),
|
||||
("sparcv9-sun-solaris", sparcv9_sun_solaris),
|
||||
|
||||
("x86_64-pc-windows-gnu", x86_64_pc_windows_gnu),
|
||||
("i686-pc-windows-gnu", i686_pc_windows_gnu),
|
||||
|
35
src/librustc_back/target/sparcv9_sun_solaris.rs
Normal file
35
src/librustc_back/target/sparcv9_sun_solaris.rs
Normal file
@ -0,0 +1,35 @@
|
||||
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use target::{Target, TargetResult};
|
||||
|
||||
pub fn target() -> TargetResult {
|
||||
let mut base = super::solaris_base::opts();
|
||||
base.pre_link_args.push("-m64".to_string());
|
||||
// llvm calls this "v9"
|
||||
base.cpu = "v9".to_string();
|
||||
base.max_atomic_width = Some(64);
|
||||
|
||||
Ok(Target {
|
||||
llvm_target: "sparcv9-sun-solaris".to_string(),
|
||||
target_endian: "big".to_string(),
|
||||
target_pointer_width: "64".to_string(),
|
||||
data_layout: "E-m:e-i64:64-n32:64-S128".to_string(),
|
||||
// Use "sparc64" instead of "sparcv9" here, since the former is already
|
||||
// used widely in the source base. If we ever needed ABI
|
||||
// differentiation from the sparc64, we could, but that would probably
|
||||
// just be confusing.
|
||||
arch: "sparc64".to_string(),
|
||||
target_os: "solaris".to_string(),
|
||||
target_env: "".to_string(),
|
||||
target_vendor: "sun".to_string(),
|
||||
options: base,
|
||||
})
|
||||
}
|
Loading…
Reference in New Issue
Block a user