[win][arm64] Remove 'Arm64 Hazard' undocumented MSVC option and instead disable problematic test

This commit is contained in:
Daniel Paoliello 2025-05-15 11:15:52 -07:00
parent d163a28381
commit 6128fca0b0
2 changed files with 8 additions and 6 deletions

View file

@ -1,4 +1,4 @@
use crate::spec::{FramePointer, LinkerFlavor, Lld, Target, TargetMetadata, base};
use crate::spec::{FramePointer, Target, TargetMetadata, base};
pub(crate) fn target() -> Target {
let mut base = base::windows_msvc::opts();
@ -11,11 +11,6 @@ pub(crate) fn target() -> Target {
// 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.
base.add_pre_link_args(LinkerFlavor::Msvc(Lld::No), &["/arm64hazardfree"]);
Target {
llvm_target: "aarch64-pc-windows-msvc".into(),
metadata: TargetMetadata {

View file

@ -11,6 +11,13 @@
//@ needs-dynamic-linking
//@ only-nightly (requires unstable rustc flag)
// This test trips a check in the MSVC linker for an outdated processor:
// "LNK1322: cannot avoid potential ARM hazard (Cortex-A53 MPCore processor bug #843419)"
// Until MSVC removes this check:
// https://developercommunity.microsoft.com/t/Remove-checking-for-and-fixing-Cortex-A/10905134
// we'll need to disable this test on Arm64 Windows.
//@ ignore-aarch64-pc-windows-msvc
#![deny(warnings)]
use run_make_support::{dynamic_lib_name, rfs, rust_lib_name, rustc};