Skip to content

Commit dacb6ee

Browse files
committed
add powerpc64-unknown-openbsd support
1 parent 908ac84 commit dacb6ee

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed

compiler/rustc_target/src/spec/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -894,6 +894,7 @@ supported_targets! {
894894
("aarch64-unknown-openbsd", aarch64_unknown_openbsd),
895895
("i686-unknown-openbsd", i686_unknown_openbsd),
896896
("powerpc-unknown-openbsd", powerpc_unknown_openbsd),
897+
("powerpc64-unknown-openbsd", powerpc64_unknown_openbsd),
897898
("sparc64-unknown-openbsd", sparc64_unknown_openbsd),
898899
("x86_64-unknown-openbsd", x86_64_unknown_openbsd),
899900

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
use crate::abi::Endian;
2+
use crate::spec::{LinkerFlavor, Target, TargetOptions};
3+
4+
pub fn target() -> Target {
5+
let mut base = super::openbsd_base::opts();
6+
base.cpu = "ppc64".into();
7+
base.add_pre_link_args(LinkerFlavor::Gcc, &["-m64"]);
8+
base.max_atomic_width = Some(64);
9+
10+
Target {
11+
llvm_target: "powerpc64-unknown-openbsd".into(),
12+
pointer_width: 64,
13+
data_layout: "E-m:e-i64:64-n32:64".into(),
14+
arch: "powerpc64".into(),
15+
options: TargetOptions { endian: Endian::Big, mcount: "_mcount".into(), ..base },
16+
}
17+
}

src/doc/rustc/src/platform-support.md

+1
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ target | std | host | notes
277277
`powerpc64-unknown-linux-musl` | ? | |
278278
`powerpc64-wrs-vxworks` | ? | |
279279
`powerpc64le-unknown-linux-musl` | ? | |
280+
[`powerpc64-unknown-openbsd`](platform-support/openbsd.md) | ✓ | ✓ | OpenBSD/powerpc64
280281
`riscv32gc-unknown-linux-gnu` | | | RISC-V Linux (kernel 5.4, glibc 2.33)
281282
`riscv32gc-unknown-linux-musl` | | | RISC-V Linux (kernel 5.4, musl + RISCV32 support patches)
282283
`riscv32im-unknown-none-elf` | * | | Bare RISC-V (RV32IM ISA)

src/doc/rustc/src/platform-support/openbsd.md

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ The target names follow this format: `$ARCH-unknown-openbsd`, where `$ARCH` spec
1212
|--------------------------------|-------------|------------------|
1313
| `aarch64-unknown-openbsd` | libc++ | [64-bit ARM systems](https://www.openbsd.org/arm64.html) |
1414
| `i686-unknown-openbsd` | libc++ | [Standard PC and clones based on the Intel i386 architecture and compatible processors](https://www.openbsd.org/i386.html) |
15+
| `powerpc64-unknown-openbsd` | libc++ | [IBM POWER-based PowerNV systems](https://www.openbsd.org/powerpc64.html) |
1516
| `sparc64-unknown-openbsd` | estdc++ | [Sun UltraSPARC and Fujitsu SPARC64 systems](https://www.openbsd.org/sparc64.html) |
1617
| `x86_64-unknown-openbsd` | libc++ | [AMD64-based systems](https://www.openbsd.org/amd64.html) |
1718

0 commit comments

Comments
 (0)