Skip to content

Always pass /DEBUG flag to MSVC linker #28505

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 25, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 3 additions & 12 deletions src/librustc_trans/back/linker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down
8 changes: 6 additions & 2 deletions src/test/run-make/output-type-permutations/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down