You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
28x binary size regression in recent nightly #85519
Also as a note, @japaric tested this with using arm-none-eabi-ld as the linker instead of the default rust-lld, and this issue remained (referring to #85274). He can confirm whether he set the "linker flavor" or similar as well.
Yeah, I was just wondering if we should expand our logic around when we specify the --gc-sections flag or just say that the targets use a gnu-ld-like linker.
It may make sense to set the default for linker_is_gnu to true because ld-style linkers are usually gnu, and it's easier to explicitly list exceptions than to not forget setting it to true for all random embedded targets.
Reacted by Dario Nieuwenhuis, Aaron Hill and Luqman Aden
If the default is not flipped then compiler\rustc_target\src\spec\thumb_base.rs needs to add linker_is_gnu: true + other target specs should probably be audited as well.
Activity
jamesmunns commentedon May 20, 2021
This seems to have been noticed here as well: rust-osdev/bootloader#168
Edit: Fixed link to
rust-osdevrepo instead of this issueEdit 2: This also indicates you can work-around the regression by manually passing
--gc-sectionsas a linker flag.jamesmunns commentedon May 20, 2021
Also as a note, @japaric tested this with using
arm-none-eabi-ldas the linker instead of the default rust-lld, and this issue remained (referring to #85274). He can confirm whether he set the "linker flavor" or similar as well.Dirbaio commentedon May 20, 2021
it's very likely #85274, since adding
-C link-arg=--gc-sectionsto rustflags fixes the bloat.nagisa commentedon May 20, 2021
Is the linker for this target guaranteed to be gnu ld? Doesn't sound like something that we can claim, can we? It does look like we default to
lld.jonas-schievink commentedon May 20, 2021
We do default to LLD, which can also garbage-collect unused sections
nagisa commentedon May 20, 2021
Yeah, I was just wondering if we should expand our logic around when we specify the
--gc-sectionsflag or just say that the targets use a gnu-ld-like linker.jonas-schievink commentedon May 20, 2021
Yeah, in practice I don't think anyone uses a non-GNU-compatible linker there
petrochenkov commentedon May 20, 2021
It may make sense to set the default for
linker_is_gnuto true becauseld-style linkers are usually gnu, and it's easier to explicitly list exceptions than to not forget setting it to true for all random embedded targets.petrochenkov commentedon May 20, 2021
If the default is not flipped then
compiler\rustc_target\src\spec\thumb_base.rsneeds to addlinker_is_gnu: true+ other target specs should probably be audited as well.Auto merge of rust-lang#85531 - luqmana:flip-gc, r=petrochenkov