]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #69080 - eddyb:one-billion-dwarves-walk-into-a-bar, r=michaelwoerister
authorMazdak Farrokhzad <twingoow@gmail.com>
Mon, 23 Mar 2020 09:29:05 +0000 (10:29 +0100)
committerGitHub <noreply@github.com>
Mon, 23 Mar 2020 09:29:05 +0000 (10:29 +0100)
rustc_codegen_llvm: don't generate any type debuginfo for -Cdebuginfo=1.

Works towards #69074 by adding more checks for `DebugInfo::Full` in a few places in `rustc_codegen_llvm`, bringing us in line with what `clang -g1` generates (no debuginfo types, nor debuginfo for `static`s).

<hr/>

My local build's (`debuginfo-level=1`, `debug-assertions=1`) `librustc_driver-*.so` went from just over 1GiB (1019MiB) down to 402MiB.

It's still bad, but the `.debug_*` sections themselves (as reported by `objdump`) went from something like 853MiB down to 236MiB, i.e. roughly a 3.6x reduction.

<hr/>

Sadly, I don't think this is enough to justify *shipping* all of this debuginfo, but now it's more plausible that we could at least *build* with `debuginfo-level=1` *then* strip it.
That would give us real backtraces for e.g. ICEs during builds, but I don't know how often that's relevant.

We could also look into split DWARF, and maybe have a `rustc-debuginfo` component in `rustup`.

There's also the possibility of making it slimmer by omitting parameters to functions, or perhaps some deduplication (I think right now there is no DWARF reuse across CGUs? maybe ThinLTO helps?).

r? @michaelwoerister cc @rust-lang/wg-codegen @alexcrichton @Mark-Simulacrum


Trivial merge