From 3f1d3948d6d434b34dd47f132c126a6cb6b8a4ab Mon Sep 17 00:00:00 2001 From: Segev Finer Date: Sat, 28 Jan 2017 21:54:59 +0200 Subject: [PATCH] Fix backtraces on i686-pc-windows-gnu by disabling FPO This might have performance implications. But do note that MSVC disables FPO by default nowadays and it's use is limited in exception heavy languages like C++. Closes: #28218 --- src/librustc_back/target/i686_pc_windows_gnu.rs | 1 + src/test/run-pass/backtrace-debuginfo.rs | 1 - src/test/run-pass/backtrace.rs | 4 ---- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/librustc_back/target/i686_pc_windows_gnu.rs b/src/librustc_back/target/i686_pc_windows_gnu.rs index 0c2c5433e6c..29477261392 100644 --- a/src/librustc_back/target/i686_pc_windows_gnu.rs +++ b/src/librustc_back/target/i686_pc_windows_gnu.rs @@ -14,6 +14,7 @@ pub fn target() -> TargetResult { let mut base = super::windows_base::opts(); base.cpu = "pentium4".to_string(); base.max_atomic_width = Some(64); + base.eliminate_frame_pointer = false; // Required for backtraces // Mark all dynamic libraries and executables as compatible with the larger 4GiB address // space available to x86 Windows binaries on x86_64. diff --git a/src/test/run-pass/backtrace-debuginfo.rs b/src/test/run-pass/backtrace-debuginfo.rs index 015ba75d432..626eccfc9ec 100644 --- a/src/test/run-pass/backtrace-debuginfo.rs +++ b/src/test/run-pass/backtrace-debuginfo.rs @@ -37,7 +37,6 @@ macro_rules! dump_and_die { target_os = "ios", target_os = "android", all(target_os = "linux", target_arch = "arm"), - all(target_os = "windows", target_pointer_width = "32"), target_os = "freebsd", target_os = "dragonfly", target_os = "bitrig", diff --git a/src/test/run-pass/backtrace.rs b/src/test/run-pass/backtrace.rs index e892f5e7728..834ce984e66 100644 --- a/src/test/run-pass/backtrace.rs +++ b/src/test/run-pass/backtrace.rs @@ -104,10 +104,6 @@ fn runtest(me: &str) { } fn main() { - if cfg!(windows) && cfg!(target_env = "gnu") && cfg!(target_pointer_width = "32") { - return - } - let args: Vec = env::args().collect(); if args.len() >= 2 && args[1] == "fail" { foo();