Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tier 3 target proposal: riscv64gc-linux-android (Android target for riscv64gc) #472

Closed
17 of 19 tasks
liushuyu opened this issue Nov 22, 2021 · 4 comments
Closed
17 of 19 tasks
Labels
major-change A proposal to make a major change to rustc major-change-accepted A major change proposal that was accepted T-compiler Add this label so rfcbot knows to poll the compiler team

Comments

@liushuyu
Copy link

Proposal

This compiler MCP proposes a new target: riscv64gc-linux-android for RISC-V 64 bit Android target. The object file format for this target is ELF. In addition, there will be an std implementation for this target, just like all the Linux/Android targets.

This target is intended to develop Android applications or AOSP itself on RISC-V 64 bit (w/ +g +c CPU features).

This target is very similar to the riscv64gc-unknown-linux-gnu and shares almost all the code generation processes and features with some changes to the linking step.

This target is also very similar to the aarch64-linux-android because both are Android targets, and the linking step is the same.

There is currently no plan to promote this target to Tier 2 as the necessary work on the official AOSP part has yet to begin. Thus, this target will be based upon the current effort made by the https://github.com/aosp-riscv organization.

Tier 3 Requirements Check

  • A tier 3 target must have a designated developer or developers (the "target maintainers") on record to be CCed when issues arise regarding the target. (The mechanism to track and CC such developers may evolve over time.)

Zixing Liu, liushuyu011@gmail.com, https://github.com/liushuyu

  • Targets must use naming consistent with any existing targets; for instance, a target for the same CPU or OS as an existing Rust target should use the same name for that CPU or OS. Targets should normally use the same names and naming conventions as used elsewhere in the broader ecosystem beyond Rust (such as in other toolchains), unless they have a very good reason to diverge. Changing the name of a target can be highly disruptive, especially once the target reaches a higher tier, so getting the name right is important even for a tier 3 target.

The target name is derived from riscv64gc-unknown-linux-gnu (a Tier 2 w/ Host target) and aarch64-linux-android (a Tier 2 w/o Host target). So the target name is consistent with the current naming scheme.

  • Tier 3 targets may have unusual requirements to build or use, but must not create legal issues or impose onerous legal terms for the Rust project or for Rust developers or users.

This target will/only use a modified version of Android NDK to build and link the binary. The modified Android NDK is licensed under the same license as the official AOSP Android SDK per the requirement (Apache License 2.0).

  • The target must not introduce license incompatibilities.

The new code will not introduce license incompatibilities since no new libraries or dependencies will be introduced to the Rust compiler itself or the standard library.

  • Anything added to the Rust repository must be under the standard Rust license (MIT OR Apache-2.0).

The new code will be licensed under MIT OR Apache-2.0.

  • The target must not cause the Rust tools or libraries built for any other host (even when supporting cross-compilation to the target) to depend on any new dependency less permissive than the Rust licensing policy. This applies whether the dependency is a Rust crate that would require adding new license exceptions (as specified by the tidy tool in the rust-lang/rust repository), or whether the dependency is a native library or binary. In other words, the introduction of the target must not cause a user installing or running a version of Rust or the Rust tools to be subject to any new license requirements.

As no new libraries or dependencies will be introduced to the Rust compiler itself or the standard library, there should be no new license requirements introduced.

  • If the target supports building host tools (such as rustc or cargo), those host tools must not depend on proprietary (non-FOSS) libraries, other than ordinary runtime libraries supplied by the platform and commonly used by other binaries built for the target. For instance, rustc built for the target may depend on a common proprietary C runtime library or console output library, but must not depend on a proprietary code generation library or code optimization library. Rust's license permits such combinations, but the Rust project has no interest in maintaining such combinations within the scope of Rust itself, even at tier 3.

The code generation is done purely using the existing Rust compiler's infrastructure (LLVM). No code generation modification is required.

  • Targets should not require proprietary (non-FOSS) components to link a functional binary or library.

The target uses lld from the LLVM project to link a binary or library, so there is no proprietary component requirement.

  • "onerous" here is an intentionally subjective term. At a minimum, "onerous" legal/licensing terms include but are not limited to: non-disclosure requirements, non-compete requirements, contributor license agreements (CLAs) or equivalent, "non-commercial"/"research-only"/etc terms, requirements conditional on the employer or employment of any particular Rust developers, revocable terms, any requirements that create liability for the Rust project or its developers or users, or any requirements that adversely affect the livelihood or prospects of the Rust project or its developers or users.

I have reviewed the code changes and determined (to my best knowledge) that there should be no onerous legal issues to either the Rust project or its developers/users.

  • Neither this policy nor any decisions made regarding targets shall create any binding agreement or estoppel by any party. If any member of an approving Rust team serves as one of the maintainers of a target, or has any legal or employment requirement (explicit or implicit) that might affect their decisions regarding a target, they must recuse themselves from any approval decisions regarding the target's tier status, though they may otherwise participate in discussions.

Affiliation: I am currently an intern at PLCT Laboratory.
N/A: I am not a Rust maintainer.

  • This requirement does not prevent part or all of this policy from being cited in an explicit contract or work agreement (e.g. to implement or maintain support for a target). This requirement exists to ensure that a developer or team responsible for reviewing and approving a target does not face any legal threats or obligations that would prevent them from freely exercising their judgment in such approval, even if such judgment involves subjective matters or goes beyond the letter of these requirements.

N/A: I don't have the approval privilege either on this MCP or target approval/promotion.

  • Tier 3 targets should attempt to implement as much of the standard libraries as possible and appropriate (core for most targets, alloc for targets that can support dynamic memory allocation, std for targets with an operating system or equivalent layer of system-provided functionality), but may leave some code unimplemented (either unavailable or stubbed out as appropriate), whether because the target makes it impossible to implement or challenging to implement. The authors of pull requests are not obligated to avoid calling any portions of the standard library on the basis of a tier 3 target not implementing those portions.

An std implementation will be provided as part of the target addition.

  • The target must provide documentation for the Rust community explaining how to build for the target, using cross-compilation if possible. If the target supports running tests (even if they do not pass), the documentation must explain how to run tests for the target, using emulation if possible or dedicated hardware if necessary.

Documentation explaining how to build and use the compiler for this target will be provided (to the best of my abilities) as part of the target addition.

  • Tier 3 targets must not impose burden on the authors of pull requests, or other developers in the community, to maintain the target. In particular, do not post comments (automated or manual) on a PR that derail or suggest a block on the PR based on a tier 3 target. Do not send automated messages or notifications (via any medium, including via @) to a PR author or others involved with a PR regarding a tier 3 target, unless they have opted into such messages.

Acknowledged.

  • Patches adding or updating tier 3 targets must not break any existing tier 2 or tier 1 target, and must not knowingly break another tier 3 target without approval of either the compiler team or the maintainers of the other tier 3 target.

I will make sure this target will not interfere or even break any other targets that the Rust compiler currently supports.

  • If a tier 3 target stops meeting these requirements, or the target maintainers no longer have interest or time, or the target shows no signs of activity and has not built for some time, or removing the target would improve the quality of the Rust codebase, we may post a PR to remove it; any such PR will be CCed to the target maintainers (and potentially other people who have previously worked on the target), to check potential interest in improving the situation.

Acknowledged.

Mentors or Reviewers

If you have a reviewer or mentor in mind for this work, mention then
here. You can put your own name here if you are planning to mentor the
work.

Process

The main points of the Major Change Process are as follows:

  • File an issue describing the proposal.
  • A compiler team member or contributor who is knowledgeable in the area can second by writing @rustbot second.
    • Finding a "second" suffices for internal changes. If however, you are proposing a new public-facing feature, such as a -C flag, then full team check-off is required.
    • Compiler team members can initiate a check-off via @rfcbot fcp merge on either the MCP or the PR.
  • Once an MCP is seconded, the Final Comment Period begins. If no objections are raised after 10 days, the MCP is considered approved.

You can read more about Major Change Proposals on forge.

Comments

This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed.

@liushuyu liushuyu added major-change A proposal to make a major change to rustc T-compiler Add this label so rfcbot knows to poll the compiler team labels Nov 22, 2021
@rustbot
Copy link
Collaborator

rustbot commented Nov 22, 2021

This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed.

cc @rust-lang/compiler @rust-lang/compiler-contributors

@rustbot rustbot added the to-announce Announce this issue on triage meeting label Nov 22, 2021
@apiraino apiraino removed the to-announce Announce this issue on triage meeting label Dec 9, 2021
@apiraino
Copy link
Contributor

apiraino commented Jun 9, 2022

MCP will be closed next week (reason: lack of seconding from a member of T-compiler). See MCP process.

@wesleywiser
Copy link
Member

@rustbot second

@rustbot rustbot added the final-comment-period The FCP has started, most (if not all) team members are in agreement label Jun 9, 2022
@apiraino
Copy link
Contributor

@rustbot label -final-comment-period +major-change-accepted

@rustbot rustbot added major-change-accepted A major change proposal that was accepted to-announce Announce this issue on triage meeting and removed final-comment-period The FCP has started, most (if not all) team members are in agreement labels Jun 22, 2022
@apiraino apiraino removed the to-announce Announce this issue on triage meeting label Jun 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
major-change A proposal to make a major change to rustc major-change-accepted A major change proposal that was accepted T-compiler Add this label so rfcbot knows to poll the compiler team
Projects
None yet
Development

No branches or pull requests

4 participants