forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#127905 - BKPepe:powerpc-muslspe, r=wesleywiser Add powerpc-unknown-linux-muslspe compile target This is almost identical to already existing targets: - powerpc_unknown_linux_musl.rs - powerpc_unknown_linux_gnuspe.rs It has support for PowerPC SPE (muslspe), which can be used with GCC version up to 8. It is useful for Freescale or IBM cores like e500. This was verified to be working with OpenWrt build system for CZ.NIC's Turris 1.x routers, which are using Freescale P2020, e500v2, so add it as a Tier 3 target. Follow-up of rust-lang#100860
- Loading branch information
Showing
6 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_muslspe.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
use crate::abi::Endian; | ||
use crate::spec::{base, Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions}; | ||
|
||
pub fn target() -> Target { | ||
let mut base = base::linux_musl::opts(); | ||
base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-mspe"]); | ||
base.max_atomic_width = Some(32); | ||
base.stack_probes = StackProbeType::Inline; | ||
|
||
Target { | ||
llvm_target: "powerpc-unknown-linux-muslspe".into(), | ||
metadata: crate::spec::TargetMetadata { | ||
description: Some("PowerPC SPE Linux with musl".into()), | ||
tier: Some(3), | ||
host_tools: Some(false), | ||
std: Some(true), | ||
}, | ||
pointer_width: 32, | ||
data_layout: "E-m:e-p:32:32-Fn32-i64:64-n32".into(), | ||
arch: "powerpc".into(), | ||
options: TargetOptions { | ||
abi: "spe".into(), | ||
endian: Endian::Big, | ||
mcount: "_mcount".into(), | ||
..base | ||
}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
src/doc/rustc/src/platform-support/powerpc-unknown-linux-muslspe.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# powerpc-unknown-linux-muslspe | ||
|
||
**Tier: 3** | ||
|
||
This target is very similar to already existing ones like `powerpc_unknown_linux_musl` and `powerpc_unknown_linux_gnuspe`. | ||
This one has PowerPC SPE support for musl. Unfortunately, the last supported gcc version with PowerPC SPE is 8.4.0. | ||
|
||
## Target maintainers | ||
|
||
- [@BKPepe](https://github.com/BKPepe) | ||
|
||
## Requirements | ||
|
||
This target is cross-compiled. There is no support for `std`. There is no | ||
default allocator, but it's possible to use `alloc` by supplying an allocator. | ||
|
||
This target generated binaries in the ELF format. | ||
|
||
## Building the target | ||
|
||
This target was tested and used within the `OpenWrt` build system for CZ.NIC Turris 1.x routers using Freescale P2020. | ||
|
||
## Building Rust programs | ||
|
||
Rust does not yet ship pre-compiled artifacts for this target. To compile for | ||
this target, you will either need to build Rust with the target enabled (see | ||
"Building the target" above), or build your own copy of `core` by using | ||
`build-std` or similar. | ||
|
||
## Testing | ||
|
||
This is a cross-compiled target and there is no support to run rustc test suite. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters