-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Binary size regression in dylibs #92013
Comments
The regression comes from the inclusion of the I'm actually confused about how this was working before. Clearly we need rustc metadata to compile against libstd or any other crate. The old DSO doesn't appear to have a section for metadata, but was compiling fine. Was this being shoved in another section (and somehow much smaller)? Or was rustc finding metadata from another libstd file, perhaps the rlib? |
The |
Or did you mean |
Though I see now that |
Okay, that's because the section is created with |
Use debug section for .rustc For a data section, the object crate will set SHF_ALLOC by default, which is exactly what we don't want. Use a debug section instead, the same as we do for .rmeta. I checked with `objdump -h` that this produces the right flags for ELF. Fixes rust-lang#92013.
Use debug section for .rustc For a data section, the object crate will set SHF_ALLOC by default, which is exactly what we don't want. Use a debug section instead, the same as we do for .rmeta. I checked with `objdump -h` that this produces the right flags for ELF. Fixes rust-lang#92013.
Thanks for the fix! and sorry yes, I did mean |
The fuchsia nightly toolchain rolls caught a binary size regression due to commit f9e77f2
Limiting to just binary changes in the rust repo, following the instructions here: https://fuchsia.dev/fuchsia-src/development/build/rust_toolchain?hl=en, we can see that on average the standard library is 3.5 times larger:
Click to expand
I'm currently assuming that our setting of
debuginfo-level-std = 2
in the config of fuchsia rust builds is what causes this to be so noticeable.The effect on fuchsia is very noticeable:
The binary size increases on our debug builds are large enough to prevent the binaries from fitting on the devices we're debugging.
CC @tmandry
@rustbot modify labels: +regression-from-stable-to-nightly -regression-untriaged
The text was updated successfully, but these errors were encountered: