Disable debug sections when optimization flags is set for LLD.

This commit is contained in:
Yury Delendik 2018-07-30 19:55:08 -05:00
parent 54628c8ea8
commit e9509d78bd

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