Add a template for target-specific documentation

This commit is contained in:
Josh Triplett 2021-11-02 14:07:52 +01:00
parent 10420ef945
commit f863e4cc30
3 changed files with 56 additions and 2 deletions

View File

@ -13,6 +13,7 @@
- [JSON Output](json.md)
- [Tests](tests/index.md)
- [Platform Support](platform-support.md)
- [Template for target-specific documentation](platform-support/TEMPLATE.md)
- [aarch64-apple-ios-sim](platform-support/aarch64-apple-ios-sim.md)
- [\*-kmc-solid_\*](platform-support/kmc-solid.md)
- [Target Tier Policy](target-tier-policy.md)

View File

@ -0,0 +1,52 @@
# `target-name-here`
**Tier: 3**
One-sentence description of the target (e.g. CPU, OS)
## Target maintainers
- Some Person, `email@example.org`, https://github.com/...
## Requirements
Does the target support host tools, or only cross-compilation? Does the target
support std, or alloc (either with a default allocator, or if the user supplies
an allocator)?
Document the expectations of binaries built for the target. Do they assume
specific minimum features beyond the baseline of the CPU/environment/etc? What
version of the OS or environment do they expect?
Are there notable `#[target_feature(...)]` or `-C target-feature=` values that
programs may wish to use?
What calling convention does `extern "C"` use on the target?
What format do binaries use by default? ELF, PE, something else?
## Building the target
If Rust doesn't build the target by default, how can users build it? Can users
just add it to the `target` list in `config.toml`?
## 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
Does the target support running binaries, or do binaries have varying
expectations that prevent having a standard way to run them? If users can run
binaries, can they do so in some common emulator, or do they need native
hardware? Does the target support running the Rust testsuite?
## Cross-compilation toolchains and C code
Does the target support C code? If so, what toolchain target should users use
to build compatible C code? (This may match the target triple, or it may be a
toolchain for a different target triple, potentially with specific options or
caveats.)

View File

@ -74,8 +74,9 @@ For a list of all supported targets and their corresponding tiers ("tier 3",
Several parts of this policy require providing target-specific documentation.
Such documentation should typically appear in a subdirectory of the
platform-support section of this rustc manual, with a link from the target's
entry in [platform support](platform-support.md). See other documentation in
that directory for examples.
entry in [platform support](platform-support.md). Use
[TEMPLATE.md](platform-support/TEMPLATE.md) as a base, and see other
documentation in that directory for examples.
Note that a target must have already received approval for the next lower tier,
and spent a reasonable amount of time at that tier, before making a proposal