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

Tracking Issue for -Zregparm #131749

Open
1 of 7 tasks
azhogin opened this issue Oct 15, 2024 · 0 comments
Open
1 of 7 tasks

Tracking Issue for -Zregparm #131749

azhogin opened this issue Oct 15, 2024 · 0 comments
Labels
A-ABI Area: Concerning the application binary interface (ABI) A-CLI Area: Command-line interface (CLI) to the compiler A-rust-for-linux Relevant for the Rust-for-Linux project C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. O-x86_32 Target: x86 processors, 32 bit (like i686-*) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@azhogin
Copy link
Contributor

azhogin commented Oct 15, 2024

This is a tracking issue for the -Zregparm flag for x86. It is the equivalent of Clang's/GCC's -mregparm=3. The kernel needs it to support the x86 32-bit architecture, together with -Zreg-struct-return.

It could potentially be a "global target feature", i.e. a target feature that is required to be set the same way for all compilation units.

About tracking issues

Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Discussion comments will get marked as off-topic or deleted.
Repeated discussions on the tracking issue may lead to the tracking issue getting locked.

Steps

Unresolved Questions & Answers

  • Q: Should it affect the Rust ABI? It cannot be documented as doing such, because the Rust ABI is unstable, but should it do so anyways as a quality-of-implementation matter?
    • Currently: No.
    • Alternatives:
      • Maybe yes?
      • Maybe we want to have a modification equivalent to "fastcall" or -Zregparm=3 apply to the Rust ABI implicitly, without -Zregparm affecting it?
  • Q: Should it affect any other ABIs than "C", "cdecl", and "stdcall"?
    • Currently: No.
    • Alternatives: It's not yet clear what ABIs this affects for gcc and clang.
  • Q: Should it be accepted on any other architecture than x86_32?
    • Currently: No.
  • Q: Does MSVC code use this? extern "fastcall" does something equivalent to -Zregparm=2, so do MSVC targets even use it, or do they just use fastcall?
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 15, 2024
@fmease fmease added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Oct 15, 2024
@workingjubilee workingjubilee added A-ABI Area: Concerning the application binary interface (ABI) O-x86_32 Target: x86 processors, 32 bit (like i686-*) A-rust-for-linux Relevant for the Rust-for-Linux project A-CLI Area: Command-line interface (CLI) to the compiler labels Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ABI Area: Concerning the application binary interface (ABI) A-CLI Area: Command-line interface (CLI) to the compiler A-rust-for-linux Relevant for the Rust-for-Linux project C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. O-x86_32 Target: x86 processors, 32 bit (like i686-*) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants