Skip to content

Commit d951c41

Browse files
committed
Enable non-leaf Frame Pointers for Arm64 Windows
1 parent fe348cd commit d951c41

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

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

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

33
pub(crate) fn target() -> Target {
44
let mut base = base::windows_msvc::opts();
55
base.max_atomic_width = Some(128);
66
base.features = "+v8a,+neon,+fp-armv8".into();
77

8+
// Microsoft recommends enabling frame pointers on Arm64 Windows.
9+
// From https://learn.microsoft.com/en-us/cpp/build/arm64-windows-abi-conventions?view=msvc-170#integer-registers
10+
// "The frame pointer (x29) is required for compatibility with fast stack walking used by ETW
11+
// and other services. It must point to the previous {x29, x30} pair on the stack."
12+
base.frame_pointer = FramePointer::NonLeaf;
13+
814
// MSVC emits a warning about code that may trip "Cortex-A53 MPCore processor bug #843419" (see
915
// https://developer.arm.com/documentation/epm048406/latest) which is sometimes emitted by LLVM.
1016
// Since Arm64 Windows 10+ isn't supported on that processor, it's safe to disable the warning.

0 commit comments

Comments
 (0)