2 ms·
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
by guappa 1y ago
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.
- TuxSH 1y agoYou 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.
- eru 1y ago> 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!