From 792a2eac93eb85b6ff90cb7386b9ea27a5b373bd Mon Sep 17 00:00:00 2001 From: Vadim Chugunov Date: Mon, 8 Sep 2014 18:00:54 -0700 Subject: [PATCH 1/4] Disable ASLR on Windows, for now. --- src/librustc/back/link.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/librustc/back/link.rs b/src/librustc/back/link.rs index bf026560c6afd..63a8e9d13b882 100644 --- a/src/librustc/back/link.rs +++ b/src/librustc/back/link.rs @@ -1014,7 +1014,8 @@ fn link_args(cmd: &mut Command, cmd.arg("-Wl,--nxcompat"); // Mark all dynamic libraries and executables as compatible with ASLR - cmd.arg("-Wl,--dynamicbase"); + // FIXME #17098: ASLR breaks gdb + // cmd.arg("-Wl,--dynamicbase"); // Mark all dynamic libraries and executables as compatible with the larger 4GiB address // space available to x86 Windows binaries on x86_64. From 127c75e5bbc283643637892c9f7bc801b11409ee Mon Sep 17 00:00:00 2001 From: Vadim Chugunov Date: Sun, 7 Sep 2014 13:19:33 -0700 Subject: [PATCH 2/4] Escape backslashes in debugger scripts. --- src/compiletest/runtest.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/compiletest/runtest.rs b/src/compiletest/runtest.rs index 32671722ba728..122a241ef0c74 100644 --- a/src/compiletest/runtest.rs +++ b/src/compiletest/runtest.rs @@ -482,12 +482,12 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) { // GDB's script auto loading safe path ... script_str.push_str( format!("add-auto-load-safe-path {}\n", - rust_pp_module_abs_path.as_slice()) + rust_pp_module_abs_path.replace("\\", "\\\\").as_slice()) .as_slice()); // ... and also the test directory script_str.push_str( format!("add-auto-load-safe-path {}\n", - config.build_base.as_str().unwrap()) + config.build_base.as_str().unwrap().replace("\\", "\\\\")) .as_slice()); } } @@ -499,7 +499,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) { // Load the target executable script_str.push_str(format!("file {}\n", - exe_file.as_str().unwrap()) + exe_file.as_str().unwrap().replace("\\", "\\\\")) .as_slice()); script_str.push_str(cmds.as_slice()); From f2c78dabf5260f426d9b0faeebae02522a99b8f7 Mon Sep 17 00:00:00 2001 From: Vadim Chugunov Date: Sun, 7 Sep 2014 13:19:55 -0700 Subject: [PATCH 3/4] Use DWARF4 on Windows. --- src/librustc/middle/trans/debuginfo.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustc/middle/trans/debuginfo.rs b/src/librustc/middle/trans/debuginfo.rs index b640f9ef5af11..7600e40edc034 100644 --- a/src/librustc/middle/trans/debuginfo.rs +++ b/src/librustc/middle/trans/debuginfo.rs @@ -739,7 +739,7 @@ pub fn finalize(cx: &CrateContext) { cx.sess().targ_cfg.os == abi::OsiOS { "Dwarf Version".with_c_str( |s| llvm::LLVMRustAddModuleFlag(cx.llmod(), s, 2)); - } else { + } else if cx.sess().targ_cfg.os == abi::OsLinux { // FIXME(#13611) this is a kludge fix because the Linux bots have // gdb 7.4 which doesn't understand dwarf4, we should // do something more graceful here. From d08441b9d67c791ea233632552ea47c0795498ec Mon Sep 17 00:00:00 2001 From: Vadim Chugunov Date: Wed, 10 Sep 2014 16:50:24 -0700 Subject: [PATCH 4/4] Fix #17156 --- mk/tests.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk/tests.mk b/mk/tests.mk index d95f886e07889..d89a29b549760 100644 --- a/mk/tests.mk +++ b/mk/tests.mk @@ -283,7 +283,7 @@ tidy: | xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py $(Q)echo $(ALL_HS) \ | xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py - $(Q)find $(S)src -type f -perm +111 \ + $(Q)find $(S)src -type f -perm a+x \ -not -name '*.rs' -and -not -name '*.py' \ -and -not -name '*.sh' \ | grep '^$(S)src/jemalloc' -v \