Rollup merge of #140862 - dpaoliello:arm64ecfp, r=wesleywiser

Enable non-leaf Frame Pointers for Arm64EC Windows

This was enabled for native Arm64 via #140828

r? `@workingjubilee`
This commit is contained in:
Matthias Krüger 2025-05-11 08:38:48 +02:00 committed by GitHub
commit 4d3c4726d2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 3 deletions

View File

@ -1,4 +1,4 @@
use crate::spec::{LinkerFlavor, Lld, Target, TargetMetadata, add_link_args, base};
use crate::spec::{FramePointer, LinkerFlavor, Lld, Target, TargetMetadata, add_link_args, base};
pub(crate) fn target() -> Target {
let mut base = base::windows_msvc::opts();
@ -10,6 +10,12 @@ pub(crate) fn target() -> Target {
&["/machine:arm64ec", "softintrin.lib"],
);
// Microsoft recommends enabling frame pointers on Arm64 Windows.
// From https://learn.microsoft.com/en-us/cpp/build/arm64-windows-abi-conventions?view=msvc-170#integer-registers
// "The frame pointer (x29) is required for compatibility with fast stack walking used by ETW
// and other services. It must point to the previous {x29, x30} pair on the stack."
base.frame_pointer = FramePointer::NonLeaf;
Target {
llvm_target: "arm64ec-pc-windows-msvc".into(),
metadata: TargetMetadata {

View File

@ -86,10 +86,12 @@ pub unsafe fn sym_static() {
// Regression test for #75761
// CHECK-LABEL: {{("#)?}}issue_75761{{"?}}
// CHECK: str {{.*}}x30
// aarch64: str {{.*}}x30
// arm64ec: stp {{.*}}x30
// CHECK: //APP
// CHECK: //NO_APP
// CHECK: ldr {{.*}}x30
// aarch64: ldr {{.*}}x30
// arm64ec: ldp {{.*}}x30
#[no_mangle]
pub unsafe fn issue_75761() {
asm!("", out("v0") _, out("x30") _);