Skip to content

Commit

Permalink
Auto merge of #52887 - yurydelendik:disable-lld-symbols, r=alexcrichton
Browse files Browse the repository at this point in the history
Disable debug sections when optimization flags is set for LLD.

Currently LLD does not error when optimization is set and debugging information sections are present. (See discussion at https://reviews.llvm.org/D47901)

Using `--strip-debug` along with the `-O` option.
  • Loading branch information
bors committed Aug 3, 2018
2 parents e415b5e + e9509d7 commit 88e0ff1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/librustc_codegen_llvm/back/linker.rs
Expand Up @@ -1006,6 +1006,18 @@ impl<'a> Linker for WasmLd<'a> {
OptLevel::Size => "-O2",
OptLevel::SizeMin => "-O2"
});
match self.sess.opts.optimize {
OptLevel::No => (),
OptLevel::Less |
OptLevel::Default |
OptLevel::Aggressive |
OptLevel::Size |
OptLevel::SizeMin => {
// LLD generates incorrect debugging information when
// optimization is applied: strip debug sections.
self.cmd.arg("--strip-debug");
}
}
}

fn pgo_gen(&mut self) {
Expand Down

0 comments on commit 88e0ff1

Please sign in to comment.