about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndrew Paseltiner <apaseltiner@gmail.com>2015-09-18 20:24:43 -0400
committerAndrew Paseltiner <apaseltiner@gmail.com>2015-09-18 22:07:15 -0400
commita6c8c7d0db7f4d13960b0270419285d3e1fbf5ac (patch)
treebccfba96f61c6ff155b1eecbb77e1fc520db65e8
parentfb5de8ce57a36e504af2dd6626365d94b5f4262d (diff)
downloadrust-a6c8c7d0db7f4d13960b0270419285d3e1fbf5ac.tar.gz
rust-a6c8c7d0db7f4d13960b0270419285d3e1fbf5ac.zip
Always pass `/DEBUG` flag to MSVC linker
Closes #28448.
-rw-r--r--src/librustc_trans/back/linker.rs15
-rw-r--r--src/test/run-make/output-type-permutations/Makefile8
2 files changed, 9 insertions, 14 deletions
diff --git a/src/librustc_trans/back/linker.rs b/src/librustc_trans/back/linker.rs
index a4333dc10d6..9610620b7af 100644
--- a/src/librustc_trans/back/linker.rs
+++ b/src/librustc_trans/back/linker.rs
@@ -19,7 +19,6 @@ use back::archive;
 use metadata::csearch;
 use middle::dependency_format::Linkage;
 use session::Session;
-use session::config::DebugInfoLevel::{NoDebugInfo, LimitedDebugInfo, FullDebugInfo};
 use session::config::CrateTypeDylib;
 use session::config;
 use syntax::ast;
@@ -286,17 +285,9 @@ impl<'a> Linker for MsvcLinker<'a> {
     }
 
     fn debuginfo(&mut self) {
-        match self.sess.opts.debuginfo {
-            NoDebugInfo => {
-                // Do nothing if debuginfo is disabled
-            },
-            LimitedDebugInfo |
-            FullDebugInfo    => {
-                // This will cause the Microsoft linker to generate a PDB file
-                // from the CodeView line tables in the object files.
-                self.cmd.arg("/DEBUG");
-            }
-        }
+        // This will cause the Microsoft linker to generate a PDB file
+        // from the CodeView line tables in the object files.
+        self.cmd.arg("/DEBUG");
     }
 
     fn whole_archives(&mut self) {
diff --git a/src/test/run-make/output-type-permutations/Makefile b/src/test/run-make/output-type-permutations/Makefile
index e3c36b9c0b7..a785e916cf7 100644
--- a/src/test/run-make/output-type-permutations/Makefile
+++ b/src/test/run-make/output-type-permutations/Makefile
@@ -5,12 +5,13 @@ all:
 	$(call REMOVE_RLIBS,bar)
 	$(call REMOVE_DYLIBS,bar)
 	rm $(TMPDIR)/libbar.a
-	rm -f $(TMPDIR)/bar.{exp,lib}
+	rm -f $(TMPDIR)/bar.{exp,lib,pdb}
 	# Check that $(TMPDIR) is empty.
 	[ "$$(ls -1 $(TMPDIR) | wc -l)" -eq "0" ]
 
 	$(RUSTC) foo.rs --crate-type=bin
 	rm $(TMPDIR)/$(call BIN,bar)
+	rm -f $(TMPDIR)/bar.pdb
 	[ "$$(ls -1 $(TMPDIR) | wc -l)" -eq "0" ]
 
 	$(RUSTC) foo.rs --emit=asm,llvm-ir,llvm-bc,obj,link
@@ -19,6 +20,7 @@ all:
 	rm $(TMPDIR)/bar.s
 	rm $(TMPDIR)/bar.o
 	rm $(TMPDIR)/$(call BIN,bar)
+	rm -f $(TMPDIR)/bar.pdb
 	[ "$$(ls -1 $(TMPDIR) | wc -l)" -eq "0" ]
 
 	$(RUSTC) foo.rs --emit=asm -o $(TMPDIR)/foo
@@ -39,6 +41,7 @@ all:
 
 	$(RUSTC) foo.rs --emit=link -o $(TMPDIR)/$(call BIN,foo)
 	rm $(TMPDIR)/$(call BIN,foo)
+	rm -f $(TMPDIR)/foo.pdb
 	[ "$$(ls -1 $(TMPDIR) | wc -l)" -eq "0" ]
 
 	$(RUSTC) foo.rs --crate-type=rlib -o $(TMPDIR)/foo
@@ -47,7 +50,7 @@ all:
 
 	$(RUSTC) foo.rs --crate-type=dylib -o $(TMPDIR)/$(call BIN,foo)
 	rm $(TMPDIR)/$(call BIN,foo)
-	rm -f $(TMPDIR)/foo.{exp,lib}
+	rm -f $(TMPDIR)/foo.{exp,lib,pdb}
 	[ "$$(ls -1 $(TMPDIR) | wc -l)" -eq "0" ]
 
 	$(RUSTC) foo.rs --crate-type=staticlib -o $(TMPDIR)/foo
@@ -56,6 +59,7 @@ all:
 
 	$(RUSTC) foo.rs --crate-type=bin -o $(TMPDIR)/$(call BIN,foo)
 	rm $(TMPDIR)/$(call BIN,foo)
+	rm -f $(TMPDIR)/foo.pdb
 	[ "$$(ls -1 $(TMPDIR) | wc -l)" -eq "0" ]
 
 	$(RUSTC) foo.rs --emit=asm,llvm-ir,llvm-bc,obj,link --crate-type=staticlib