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

Use aapcs for efiapi calling convention on arm #104077

Merged
merged 1 commit into from
Nov 10, 2022

Conversation

nicholasbishop
Copy link
Contributor

On arm, llvm treats the C calling convention as aapcs on soft-float targets and aapcs-vfp on hard-float targets. UEFI specifies in the arm calling convention that floating point extensions aren't used, so always translate efiapi to aapcs on arm.

#65815

@rustbot
Copy link
Collaborator

rustbot commented Nov 6, 2022

r? @estebank

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 6, 2022
@rustbot
Copy link
Collaborator

rustbot commented Nov 6, 2022

These commits modify compiler targets.
(See the Target Tier Policy.)

@nagisa
Copy link
Member

nagisa commented Nov 6, 2022

This is correct, but could benefit from a codegen test making sure that we definitely output specifically soft-float aapcs variant of this calling convention for ARM. I’m a little worried that at some future point somebody might argue that aapcs should switch between LLVM’s aapcs and aapcs-vfp variants depending on some factor such as target used. Reliance on this staying soft-float for efiapi seems like a very straightforward thing to miss.

@nagisa
Copy link
Member

nagisa commented Nov 6, 2022

r? @nagisa

@rustbot rustbot assigned nagisa and unassigned estebank Nov 6, 2022
On arm, llvm treats the C calling convention as `aapcs` on soft-float
targets and `aapcs-vfp` on hard-float targets [1]. UEFI specifies in the
arm calling convention that floating point extensions aren't used [2],
so always translate `efiapi` to `aapcs` on arm.

[1]: rust-lang/compiler-builtins#116 (comment)
[2]: https://uefi.org/specs/UEFI/2.10/02_Overview.html#detailed-calling-convention

rust-lang#65815
@nagisa
Copy link
Member

nagisa commented Nov 6, 2022

Perfect.

@bors r+

@bors
Copy link
Contributor

bors commented Nov 6, 2022

📌 Commit 42cbb40 has been approved by nagisa

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 6, 2022
Manishearth added a commit to Manishearth/rust that referenced this pull request Nov 10, 2022
…r=nagisa

Use aapcs for efiapi calling convention on arm

On arm, [llvm treats the C calling convention as `aapcs` on soft-float targets and `aapcs-vfp` on hard-float targets](rust-lang/compiler-builtins#116 (comment)). UEFI specifies in the arm calling convention that [floating point extensions aren't used](https://uefi.org/specs/UEFI/2.10/02_Overview.html#detailed-calling-convention), so always translate `efiapi` to `aapcs` on arm.

rust-lang#65815
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 10, 2022
…earth

Rollup of 9 pull requests

Successful merges:

 - rust-lang#101939 (Add loongarch64 abi support)
 - rust-lang#103863 (Use `TraitEngine` in more places, restrict visibility of `FulfillmentCtxt` constructor)
 - rust-lang#104036 (Suggest `is_some` when we've found `Option` but expected `bool`)
 - rust-lang#104060 (Make `Hash`, `Hasher` and `BuildHasher` `#[const_trait]` and make `Sip` const `Hasher`)
 - rust-lang#104077 (Use aapcs for efiapi calling convention on arm)
 - rust-lang#104186 (Tighten the 'introduce new binding' suggestion)
 - rust-lang#104194 (`EarlyBinder` docs)
 - rust-lang#104233 (Don't ICE when encountering `ConstKind::Error` in `RequiredConstsVisitor`)
 - rust-lang#104235 (Use `const_error_with_guaranteed` more)

Failed merges:

 - rust-lang#104078 (Print "Checking/Building ..." message even when --dry-run is passed)
 - rust-lang#104169 (Migrate `:target` rules to use CSS variables)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 8f2c1f8 into rust-lang:master Nov 10, 2022
@rustbot rustbot added this to the 1.67.0 milestone Nov 10, 2022
@nicholasbishop nicholasbishop deleted the bishop-uefi-aapcs branch November 10, 2022 19:37
@workingjubilee workingjubilee added O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state O-UEFI UEFI labels Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state O-UEFI UEFI S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants