-
Notifications
You must be signed in to change notification settings - Fork 13.5k
llvm-strip --strip-debug on riscv64 produces unusually large binaries #89524
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
Comments
@llvm/issue-subscribers-tools-llvm-objcopy-strip Author: q66 (q66)
I started noticing that in my distribution binaries on riscv64 come out roughly 3.5 times larger than they should be. We compile with `-g2` by default and then process everything with `llvm-strip --strip-debug`. On all other architectures (x86_64, aarch64, ppc64le, ppc64) things come out more or less the same as before.
The set of flags used does not matter, other than the debug level. Dropping debug level to For instance, a build of Lua 5.4 package has an installed size of 3.5MB instead of 1MB on riscv64 now. It seems to apply to all packages in general. |
More information: it does not seem to be related to the tools. Using binutils strip exhibits the same behavior with overbloated binaries with |
here is after processing with after processing with |
Since clang 18 we get unstrippable junk in binaries when building with debuginfo, inflating stripped binaries roughly 3.5x on avg, so drop debug until this is solved. Ref llvm/llvm-project#89524
it seems the issue has been present for much longer, actually; this is not an 18 regression |
I doubt that this is an llvm-objcopy/strip issue, given that using GNU |
@llvm/issue-subscribers-backend-risc-v Author: q66 (q66)
I started noticing that in my distribution binaries on riscv64 come out roughly 3.5 times larger than they should be. We compile with `-g2` by default and then process everything with `llvm-strip --strip-debug`. On all other architectures (x86_64, aarch64, ppc64le, ppc64) things come out more or less the same as before.
The set of flags used does not matter, other than the debug level. Dropping debug level to For instance, a build of Lua 5.4 package has an installed size of 3.5MB instead of 1MB on riscv64 now. It seems to apply to all packages in general. |
I've added the RISC-V label, since I reckon that it's in this area that any issue will be present. |
yes, i also suspect all these NOTYPE local symbols are the issue |
I agree that this is a RISC-V issue instead of an llvm-objcopy issue. These empty name symbols are generated for assembler directives related to .eh_frame/.debug_line. gas uses a fake label name I created #89693 to match gas. I was aware of the behavior difference but did not think hard about the size concern when ld/objcopy -X are concerned. For distributions, As a workaround, you can apply |
I started noticing that in my distribution binaries on riscv64 come out roughly 3.5 times larger than they should be. We compile with
-g2
by default and then process everything withllvm-strip --strip-debug
. On all other architectures (x86_64, aarch64, ppc64le, ppc64) things come out more or less the same as before.The set of flags used does not matter, other than the debug level. Dropping debug level to
-g0
produces small binaries. Usingstrip
without arguments likewise produces small binaries;--strip-debug
does not, however.For instance, a build of Lua 5.4 package has an installed size of 3.5MB instead of 1MB on riscv64 now. It seems to apply to all packages in general.
The text was updated successfully, but these errors were encountered: