Skip to content

Commit 81303d7

Browse files
committed
Add powerpc-unknown-linux-musl target
1 parent 99e3fca commit 81303d7

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

src/librustc_target/spec/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ supported_targets! {
297297
("mipsel-unknown-linux-gnu", mipsel_unknown_linux_gnu),
298298
("powerpc-unknown-linux-gnu", powerpc_unknown_linux_gnu),
299299
("powerpc-unknown-linux-gnuspe", powerpc_unknown_linux_gnuspe),
300+
("powerpc-unknown-linux-musl", powerpc_unknown_linux_musl),
300301
("powerpc64-unknown-linux-gnu", powerpc64_unknown_linux_gnu),
301302
("powerpc64le-unknown-linux-gnu", powerpc64le_unknown_linux_gnu),
302303
("powerpc64le-unknown-linux-musl", powerpc64le_unknown_linux_musl),
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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 spec::{LinkerFlavor, Target, TargetResult};
12+
13+
pub fn target() -> TargetResult {
14+
let mut base = super::linux_musl_base::opts();
15+
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m32".to_string());
16+
base.max_atomic_width = Some(32);
17+
18+
Ok(Target {
19+
llvm_target: "powerpc-unknown-linux-musl".to_string(),
20+
target_endian: "big".to_string(),
21+
target_pointer_width: "32".to_string(),
22+
target_c_int_width: "32".to_string(),
23+
data_layout: "E-m:e-p:32:32-i64:64-n32".to_string(),
24+
arch: "powerpc".to_string(),
25+
target_os: "linux".to_string(),
26+
target_env: "musl".to_string(),
27+
target_vendor: "unknown".to_string(),
28+
linker_flavor: LinkerFlavor::Gcc,
29+
options: base,
30+
})
31+
}

0 commit comments

Comments
 (0)