Skip to content

Commit 705eda2

Browse files
committed
Enable non-leaf Frame Pointers for Arm64EC Windows
1 parent dcecb99 commit 705eda2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

compiler/rustc_target/src/spec/targets/arm64ec_pc_windows_msvc.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::spec::{LinkerFlavor, Lld, Target, TargetMetadata, add_link_args, base};
1+
use crate::spec::{FramePointer, LinkerFlavor, Lld, Target, TargetMetadata, add_link_args, base};
22

33
pub(crate) fn target() -> Target {
44
let mut base = base::windows_msvc::opts();
@@ -10,6 +10,12 @@ pub(crate) fn target() -> Target {
1010
&["/machine:arm64ec", "softintrin.lib"],
1111
);
1212

13+
// Microsoft recommends enabling frame pointers on Arm64 Windows.
14+
// From https://learn.microsoft.com/en-us/cpp/build/arm64-windows-abi-conventions?view=msvc-170#integer-registers
15+
// "The frame pointer (x29) is required for compatibility with fast stack walking used by ETW
16+
// and other services. It must point to the previous {x29, x30} pair on the stack."
17+
base.frame_pointer = FramePointer::NonLeaf;
18+
1319
Target {
1420
llvm_target: "arm64ec-pc-windows-msvc".into(),
1521
metadata: TargetMetadata {

0 commit comments

Comments
 (0)