Skip to content

Commit 4db04bd

Browse files
committed
Greatly decrease the size of rustc_driver.so when debuginfo is enabled
- Don't include extra unnecessary debuginfo when only debuginfo-level=1 is set - Compress debuginfo sections to reduce the size of debuginfo on disk.
1 parent 51b891c commit 4db04bd

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/bootstrap/builder.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1621,6 +1621,17 @@ impl<'a> Builder<'a> {
16211621
SplitDebuginfo::Off => rustflags.arg("-Csplit-debuginfo=off"),
16221622
};
16231623

1624+
// Decrease the amount of debuginfo we generate for `debuginfo_level = 1`.
1625+
// See #64405 for context.
1626+
// cfg(not(bootstrap))
1627+
if compiler.stage > 0 {
1628+
rustflags.arg("-Zforce-full-debuginfo=no");
1629+
}
1630+
// Decrease the size of the debuginfo we generate. zlib has incomplete support on some
1631+
// platforms, but that's ok because `thorin` can read it and we don't ship debuginfo to
1632+
// users.
1633+
rustflags.arg("-Clink-args=-Wl,--compress-debug-sections=zlib");
1634+
16241635
if self.config.cmd.bless() {
16251636
// Bless `expect!` tests.
16261637
cargo.env("UPDATE_EXPECT", "1");

0 commit comments

Comments
 (0)