Skip to content

Commit 6cbdca2

Browse files
committed
Rollup merge of #48297 - glaubitz:sparc-linux, r=estebank
Fixes #47311. r? @nrc
2 parents 66aa98c + 84aae4e commit 6cbdca2

File tree

5 files changed

+38
-1
lines changed

5 files changed

+38
-1
lines changed

src/bootstrap/bootstrap.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ def default_build_triple():
294294
raise ValueError('unknown byteorder: {}'.format(sys.byteorder))
295295
# only the n64 ABI is supported, indicate it
296296
ostype += 'abi64'
297-
elif cputype == 'sparcv9' or cputype == 'sparc64':
297+
elif cputype == 'sparc' or cputype == 'sparcv9' or cputype == 'sparc64':
298298
pass
299299
else:
300300
err = "unknown cpu type: {}".format(cputype)

src/bootstrap/native.rs

+1
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,7 @@ impl Step for Openssl {
484484
"powerpc64-unknown-linux-gnu" => "linux-ppc64",
485485
"powerpc64le-unknown-linux-gnu" => "linux-ppc64le",
486486
"s390x-unknown-linux-gnu" => "linux64-s390x",
487+
"sparc-unknown-linux-gnu" => "linux-sparcv9",
487488
"sparc64-unknown-linux-gnu" => "linux64-sparcv9",
488489
"sparc64-unknown-netbsd" => "BSD-sparc64",
489490
"x86_64-apple-darwin" => "darwin64-x86_64-cc",

src/librustc_back/target/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ supported_targets! {
147147
("powerpc64-unknown-linux-gnu", powerpc64_unknown_linux_gnu),
148148
("powerpc64le-unknown-linux-gnu", powerpc64le_unknown_linux_gnu),
149149
("s390x-unknown-linux-gnu", s390x_unknown_linux_gnu),
150+
("sparc-unknown-linux-gnu", sparc_unknown_linux_gnu),
150151
("sparc64-unknown-linux-gnu", sparc64_unknown_linux_gnu),
151152
("arm-unknown-linux-gnueabi", arm_unknown_linux_gnueabi),
152153
("arm-unknown-linux-gnueabihf", arm_unknown_linux_gnueabihf),
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
use LinkerFlavor;
12+
use target::{Target, TargetResult};
13+
14+
pub fn target() -> TargetResult {
15+
let mut base = super::linux_base::opts();
16+
base.cpu = "v9".to_string();
17+
base.max_atomic_width = Some(64);
18+
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-mv8plus".to_string());
19+
base.exe_allocation_crate = None;
20+
21+
Ok(Target {
22+
llvm_target: "sparc-unknown-linux-gnu".to_string(),
23+
target_endian: "big".to_string(),
24+
target_pointer_width: "32".to_string(),
25+
target_c_int_width: "32".to_string(),
26+
data_layout: "E-m:e-p:32:32-i64:64-f128:64-n32-S64".to_string(),
27+
arch: "sparc".to_string(),
28+
target_os: "linux".to_string(),
29+
target_env: "gnu".to_string(),
30+
target_vendor: "unknown".to_string(),
31+
linker_flavor: LinkerFlavor::Gcc,
32+
options: base,
33+
})
34+
}

src/tools/build-manifest/src/main.rs

+1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ static TARGETS: &'static [&'static str] = &[
8787
"powerpc64-unknown-linux-gnu",
8888
"powerpc64le-unknown-linux-gnu",
8989
"s390x-unknown-linux-gnu",
90+
"sparc-unknown-linux-gnu",
9091
"sparc64-unknown-linux-gnu",
9192
"sparcv9-sun-solaris",
9293
"wasm32-unknown-emscripten",

0 commit comments

Comments
 (0)