From bcabd372b7ffdbb5e72d22d4b15a75031f96f302 Mon Sep 17 00:00:00 2001 From: clubby789 Date: Sun, 22 Dec 2024 22:01:37 +0000 Subject: [PATCH] Don't inherit the `/Oy` flag for 64-bit targets --- src/flags.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/flags.rs b/src/flags.rs index 81834cf6..7040a3d8 100644 --- a/src/flags.rs +++ b/src/flags.rs @@ -296,8 +296,11 @@ impl<'this> RustcCodegenFlags<'this> { } // https://learn.microsoft.com/en-us/cpp/build/reference/oy-frame-pointer-omission if let Some(value) = self.force_frame_pointers { - let cc_flag = if value { "/Oy-" } else { "/Oy" }; - push_if_supported(cc_flag.into()); + // Flag is unsupported on 64-bit arches + if !target.arch.contains("64") { + let cc_flag = if value { "/Oy-" } else { "/Oy" }; + push_if_supported(cc_flag.into()); + } } } }