Skip to content

Commit 7277fe9

Browse files
committed
auto merge of #17161 : vadimcn/rust/fix-debuginfo, r=alexcrichton
This PR fixes debuginfo tests on Windows.
2 parents 079951e + d08441b commit 7277fe9

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

mk/tests.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ tidy:
283283
| xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
284284
$(Q)echo $(ALL_HS) \
285285
| xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
286-
$(Q)find $(S)src -type f -perm +111 \
286+
$(Q)find $(S)src -type f -perm a+x \
287287
-not -name '*.rs' -and -not -name '*.py' \
288288
-and -not -name '*.sh' \
289289
| grep '^$(S)src/jemalloc' -v \

src/compiletest/runtest.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -482,12 +482,12 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
482482
// GDB's script auto loading safe path ...
483483
script_str.push_str(
484484
format!("add-auto-load-safe-path {}\n",
485-
rust_pp_module_abs_path.as_slice())
485+
rust_pp_module_abs_path.replace("\\", "\\\\").as_slice())
486486
.as_slice());
487487
// ... and also the test directory
488488
script_str.push_str(
489489
format!("add-auto-load-safe-path {}\n",
490-
config.build_base.as_str().unwrap())
490+
config.build_base.as_str().unwrap().replace("\\", "\\\\"))
491491
.as_slice());
492492
}
493493
}
@@ -499,7 +499,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
499499

500500
// Load the target executable
501501
script_str.push_str(format!("file {}\n",
502-
exe_file.as_str().unwrap())
502+
exe_file.as_str().unwrap().replace("\\", "\\\\"))
503503
.as_slice());
504504

505505
script_str.push_str(cmds.as_slice());

src/librustc/back/link.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1017,7 +1017,8 @@ fn link_args(cmd: &mut Command,
10171017
cmd.arg("-Wl,--nxcompat");
10181018

10191019
// Mark all dynamic libraries and executables as compatible with ASLR
1020-
cmd.arg("-Wl,--dynamicbase");
1020+
// FIXME #17098: ASLR breaks gdb
1021+
// cmd.arg("-Wl,--dynamicbase");
10211022

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

src/librustc/middle/trans/debuginfo.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ pub fn finalize(cx: &CrateContext) {
739739
cx.sess().targ_cfg.os == abi::OsiOS {
740740
"Dwarf Version".with_c_str(
741741
|s| llvm::LLVMRustAddModuleFlag(cx.llmod(), s, 2));
742-
} else {
742+
} else if cx.sess().targ_cfg.os == abi::OsLinux {
743743
// FIXME(#13611) this is a kludge fix because the Linux bots have
744744
// gdb 7.4 which doesn't understand dwarf4, we should
745745
// do something more graceful here.

0 commit comments

Comments
 (0)