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:
commit
88e0ff14a8
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue