]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #53434 - alexcrichton:remove-strip-debug, r=yurydelendik
authorCorey Farwell <coreyf@rwell.org>
Fri, 17 Aug 2018 15:23:45 +0000 (08:23 -0700)
committerGitHub <noreply@github.com>
Fri, 17 Aug 2018 15:23:45 +0000 (08:23 -0700)
wasm: Remove --strip-debug argument to LLD

Originally added in #52887 this commit disables passing `--strip-debug` to LLD
when optimized. This bring back the original bug of emitting broken debuginfo
but currently it *also* strips the `name` section which makes it very difficult
to inspect the final binary. A real fix is happening at
https://reviews.llvm.org/D50729 and we can reevaluate once we've updated LLD to
have that commit.

src/librustc_codegen_llvm/back/linker.rs

index ef98fae9cc7ee46af16dc668a0b2cecf9954a7ee..6311ab7c74c1c787ac8469e2e18d9336a726591b 100644 (file)
@@ -1006,18 +1006,6 @@ fn optimize(&mut self) {
             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) {