Skip to content

Commit f863e4c

Browse files
committed
Add a template for target-specific documentation
1 parent 10420ef commit f863e4c

File tree

3 files changed

+56
-2
lines changed

3 files changed

+56
-2
lines changed

src/doc/rustc/src/SUMMARY.md

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
- [JSON Output](json.md)
1414
- [Tests](tests/index.md)
1515
- [Platform Support](platform-support.md)
16+
- [Template for target-specific documentation](platform-support/TEMPLATE.md)
1617
- [aarch64-apple-ios-sim](platform-support/aarch64-apple-ios-sim.md)
1718
- [\*-kmc-solid_\*](platform-support/kmc-solid.md)
1819
- [Target Tier Policy](target-tier-policy.md)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# `target-name-here`
2+
3+
**Tier: 3**
4+
5+
One-sentence description of the target (e.g. CPU, OS)
6+
7+
## Target maintainers
8+
9+
- Some Person, `[email protected]`, https://github.com/...
10+
11+
## Requirements
12+
13+
Does the target support host tools, or only cross-compilation? Does the target
14+
support std, or alloc (either with a default allocator, or if the user supplies
15+
an allocator)?
16+
17+
Document the expectations of binaries built for the target. Do they assume
18+
specific minimum features beyond the baseline of the CPU/environment/etc? What
19+
version of the OS or environment do they expect?
20+
21+
Are there notable `#[target_feature(...)]` or `-C target-feature=` values that
22+
programs may wish to use?
23+
24+
What calling convention does `extern "C"` use on the target?
25+
26+
What format do binaries use by default? ELF, PE, something else?
27+
28+
## Building the target
29+
30+
If Rust doesn't build the target by default, how can users build it? Can users
31+
just add it to the `target` list in `config.toml`?
32+
33+
## Building Rust programs
34+
35+
Rust does not yet ship pre-compiled artifacts for this target. To compile for
36+
this target, you will either need to build Rust with the target enabled (see
37+
"Building the target" above), or build your own copy of `core` by using
38+
`build-std` or similar.
39+
40+
## Testing
41+
42+
Does the target support running binaries, or do binaries have varying
43+
expectations that prevent having a standard way to run them? If users can run
44+
binaries, can they do so in some common emulator, or do they need native
45+
hardware? Does the target support running the Rust testsuite?
46+
47+
## Cross-compilation toolchains and C code
48+
49+
Does the target support C code? If so, what toolchain target should users use
50+
to build compatible C code? (This may match the target triple, or it may be a
51+
toolchain for a different target triple, potentially with specific options or
52+
caveats.)

src/doc/rustc/src/target-tier-policy.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,9 @@ For a list of all supported targets and their corresponding tiers ("tier 3",
7474
Several parts of this policy require providing target-specific documentation.
7575
Such documentation should typically appear in a subdirectory of the
7676
platform-support section of this rustc manual, with a link from the target's
77-
entry in [platform support](platform-support.md). See other documentation in
78-
that directory for examples.
77+
entry in [platform support](platform-support.md). Use
78+
[TEMPLATE.md](platform-support/TEMPLATE.md) as a base, and see other
79+
documentation in that directory for examples.
7980

8081
Note that a target must have already received approval for the next lower tier,
8182
and spent a reasonable amount of time at that tier, before making a proposal

0 commit comments

Comments
 (0)