News for hackers. Stuff that matters.
Re:Bzip2 crate switches from C to 100% rust by guappa on Wednesday June 18, 2025 @03:39AM (#44307513)
Static linking produces huge binaries, it lets you do LTO but the amount of optimisation you can actually do is limited by your RAM. Static linking also causes the entire archive to need constant rebuilds.
Re:Bzip2 crate switches from C to 100% rust by TuxSH on Wednesday June 18, 2025 @08:36AM (#44309339)
You don't need LTO to trim static binaries (though LTO will do it), `-ffunction-sections -fdata-sections` in compiler flags combined with `--gc-section` (or equivalent) in linker flags will do it.

This way you can get small binaries with readable assembly.

Re:Bzip2 crate switches from C to 100% rust by eru on Thursday June 19, 2025 @07:39PM (#44323523)
> Static linking also causes the entire archive to need constant rebuilds.

Only relinking, which you can make cheap for your non-release builds.

Dynamic linking needs relinking everytime you run the program!