Skip to content

Commit 170ef62

Browse files
committed
powerpc/rust: Add target.json for ppc64le
Based on the x86 and arm64 versions, as well as output from: $ rustc +nightly -Z unstable-options --target=powerpc64le-unknown-linux-gnu --print target-spec-json Notably disables altivec, vsx and hard-float. The very cryptic data-layout: "data-layout": "e-m:e-i64:64-n32:64-S128", Has the following meaning: e: little endian m:e ELF name mangling i64:64 64-bit integers 64-bit aligned n32:64 Native integer widths, 32-bit and 64-bit. S128 16-byte stack alignment Those all come from the rustc output, with the exception of the stack alignment. We obviously do have 8-bit & 16-bit integer types, but I'm not sure if there's any need to specify that. ppc64le only for now. We'll eventually need to come up with some way to change the target.json that's used based on more than just $(ARCH). Signed-off-by: Michael Ellerman <[email protected]>
1 parent 63df29c commit 170ef62

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

arch/powerpc/rust/target.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"arch": "powerpc64",
3+
"code-mode": "kernel",
4+
"cpu": "ppc64le",
5+
"data-layout": "e-m:e-i64:64-n32:64",
6+
"env": "gnu",
7+
"features": "-altivec,-vsx,-hard-float",
8+
"function-sections": false,
9+
"is-builtin": true,
10+
"linker-flavor": "gcc",
11+
"linker-is-gnu": true,
12+
"llvm-target": "powerpc64le-elf",
13+
"max-atomic-width": 64,
14+
"os": "none",
15+
"panic-strategy": "abort",
16+
"position-independent-executables": true,
17+
"pre-link-args": {
18+
"gcc": [
19+
"-Wl,--as-needed",
20+
"-Wl,-z,noexecstack",
21+
"-m64"
22+
]
23+
},
24+
"relocation-model": "static",
25+
"relro-level": "full",
26+
"target-family": "unix",
27+
"target-mcount": "_mcount",
28+
"target-endian": "little",
29+
"target-pointer-width": "64"
30+
}

0 commit comments

Comments
 (0)