Skip to content

Commit 75ca6c6

Browse files
committed
[win][arm64] Disable MSVC Linker 'Arm Hazard' warning
1 parent f5d3fe2 commit 75ca6c6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1-
use crate::spec::{Target, TargetMetadata, base};
1+
use crate::spec::{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+
// MSVC emits a warning about code that may trip "Cortex-A53 MPCore processor bug #843419" (see
9+
// https://developer.arm.com/documentation/epm048406/latest) which is sometimes emitted by LLVM.
10+
// Since Arm64 Windows 10+ isn't supported on that processor, it's safe to disable the warning.
11+
base.add_pre_link_args(LinkerFlavor::Msvc(Lld::No), &["/arm64hazardfree"]);
12+
813
Target {
914
llvm_target: "aarch64-pc-windows-msvc".into(),
1015
metadata: TargetMetadata {

0 commit comments

Comments
 (0)