Skip to content

Commit

Permalink
Fix backtraces on i686-pc-windows-gnu by disabling FPO
Browse files Browse the repository at this point in the history
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: rust-lang#28218
  • Loading branch information
segevfiner committed Jan 29, 2017
1 parent f39f273 commit 3f1d394
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 5 deletions.
1 change: 1 addition & 0 deletions src/librustc_back/target/i686_pc_windows_gnu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 0 additions & 1 deletion src/test/run-pass/backtrace-debuginfo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 0 additions & 4 deletions src/test/run-pass/backtrace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> = env::args().collect();
if args.len() >= 2 && args[1] == "fail" {
foo();
Expand Down

0 comments on commit 3f1d394

Please sign in to comment.