Auto merge of #52887 - yurydelendik:disable-lld-symbols, r=alexcrichton

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.
This commit is contained in:
bors 2018-08-03 12:22:17 +00:00
commit 88e0ff14a8
1 changed files with 12 additions and 0 deletions

View File

@ -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) {