Reputation: 71
I've so far only seen PowerPC in the target lists in the rustc book for operating systems such as Linux, but not for embedded.
From the LLVM docs, it implies they support embedded PowerPC, so in theory, Rust should be able to compile with a custom target right?
One problem I have seen though is it doesn't seem LLVM supports VLE, which means programs may be significantly larger in flash.
Upvotes: 3
Views: 467
Reputation: 33
From the LLVM docs, it implies they support embedded PowerPC, so in theory, Rust should be able to compile with a custom target right?
Yes.
LLVM does indeed support embedded PowerPC. For any target that llvm supports, you can define a corresponding custom target for rust using a json file. Just tweak the settings to match your specific processor.
Here's an example for the Nintendo Wii's PowerPC 750CL-based cpu:
{
"arch": "powerpc",
"cpu": "750",
"data-layout": "E-m:e-p:32:32-i64:64-n32",
"dynamic-linking": false,
"env": "newlib",
"executables": true,
"has-rpath": true,
"llvm-target": "powerpc-unknown-eabi",
"linker": "powerpc-eabi-gcc",
"linker-flavor": "gcc",
"linker-is-gnu": true,
"os": "rvl-ios",
"pre-link-args": {
"gcc": [
"-mrvl",
"-meabi",
"-mhard-float"
]
},
"panic-strategy": "abort",
"relocation-model": "static",
"target-endian": "big",
"target-family": "none",
"target-mcount": "_mcount",
"target-c-int-width": "32",
"target-pointer-width": "32",
"vendor": "nintendo"
}
Upvotes: 3
Reputation: 22051
fwiw, there is a crate with Platform-specific intrinsics for the PowerPC platform
I'm also interested in figuring out embedded Rust support for PowerPC e200, specifically, the ST SPC58NE84E7
Upvotes: 0