Skip to content

Discussion issue for customizable targets #792

Open
@jamesmunns

Description

@jamesmunns

Up to now, we've handled targets with differing capabilities and ABI details by defining separate targets, such as thumbv7m-none-eabi and thumbv7em-none-eabihf. For Arm v6m and v7m targets (Cortex-M0 to Cortex-M7), this has worked okay, as the number of options is relatively low.

However, newer v8m targets, as well as architectures like RISC-V, have a much larger volume of potential options.

It is often necessary (or strongly preferrable) for targets to have consistent compilation options for core/alloc/std and the main application, either for ABI reasons (e.g. not mixing hard and soft float ABIs), or for performance reasons (more efficient intrinsics for bit operations, memcpy, etc.)

At RustNL, it was informally discussed whether we could explore options outside of "one target per configuration", including potentially using build-std to recompile the standard library to match selected features for "customizable" targets.

On a Zulip thread regarding ABI-relevant flags, it was also discussed that Rust for Linux may also have uses where the Kernel can be configured with options that affect the ABI (and necessitate building a consistent standard library), such as -Zfixed-x18.

It is not clear yet exactly how this would be specified, what guarantees would be given for stability, etc. This discussion issue is aimed at:

  1. Capturing the concrete facts and potential use cases as of today, for example a list of targets, and the kind of configuration they need (regardless of how we "solve"/"implement" this configuration), or other relevant scenarios
  2. Discussing potential ways to solve this, and any "pre-requisites" for these solutions, such as what would need to be stabilized or implemented in rustc or cargo to enable these options.

It's likely this will need to be discussed with a wider group of Rust teams, but I wanted to start a tracking/discussion issue for now as it has become relevant.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions