Skip to content

Commit 24055d0

Browse files
committed
Auto merge of #39379 - segevfiner:fix-backtraces-on-i686-pc-windows-gnu, r=alexcrichton
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++. See discussion in: #39234 Closes: #28218
2 parents cd692cc + 3f1d394 commit 24055d0

File tree

3 files changed

+1
-5
lines changed

3 files changed

+1
-5
lines changed

src/librustc_back/target/i686_pc_windows_gnu.rs

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ pub fn target() -> TargetResult {
1414
let mut base = super::windows_base::opts();
1515
base.cpu = "pentium4".to_string();
1616
base.max_atomic_width = Some(64);
17+
base.eliminate_frame_pointer = false; // Required for backtraces
1718

1819
// Mark all dynamic libraries and executables as compatible with the larger 4GiB address
1920
// space available to x86 Windows binaries on x86_64.

src/test/run-pass/backtrace-debuginfo.rs

-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ macro_rules! dump_and_die {
3737
target_os = "ios",
3838
target_os = "android",
3939
all(target_os = "linux", target_arch = "arm"),
40-
all(target_os = "windows", target_pointer_width = "32"),
4140
target_os = "freebsd",
4241
target_os = "dragonfly",
4342
target_os = "bitrig",

src/test/run-pass/backtrace.rs

-4
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,6 @@ fn runtest(me: &str) {
104104
}
105105

106106
fn main() {
107-
if cfg!(windows) && cfg!(target_env = "gnu") && cfg!(target_pointer_width = "32") {
108-
return
109-
}
110-
111107
let args: Vec<String> = env::args().collect();
112108
if args.len() >= 2 && args[1] == "fail" {
113109
foo();

0 commit comments

Comments
 (0)