Disable debug sections when optimization flags is set for LLD.
This commit is contained in:
parent
54628c8ea8
commit
e9509d78bd
1 changed files with 12 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue