Skip to content

Enable non-leaf Frame Pointers for Arm64 Windows #140828

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

Merged
merged 1 commit into from
May 9, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
use crate::spec::{LinkerFlavor, Lld, Target, TargetMetadata, base};
use crate::spec::{FramePointer, LinkerFlavor, Lld, Target, TargetMetadata, base};

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

// 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;

// MSVC emits a warning about code that may trip "Cortex-A53 MPCore processor bug #843419" (see
// https://developer.arm.com/documentation/epm048406/latest) which is sometimes emitted by LLVM.
// Since Arm64 Windows 10+ isn't supported on that processor, it's safe to disable the warning.