Repository navigation
Shrink NSIS stubs and plugins with gc-sections, size-optimize makensis - #423
Conversation
|
Since this PR has no checks here: the same branch ( |
|
I approved your workflow so it should now run, and also any future PRs you make |
|
Thanks, @MarcroSoft! I pushed a fixup that backs off some of your changes, being a little more conservative. More important for I'm ready to merge this if you're satisfied. Any thoughts, @Peter0x44, since you're here? |
|
Thanks, that all makes sense — happy with the more conservative version, and good catch on stripping makensis. Fine to merge from my side. |
-fno-asynchronous-unwind-tables is unsafe for the stubs on x64, and -Oz costs speed for little size. A more conservative version is pending upstream as skeeto#423 and will arrive with the next upstream merge.
Stubs drop from ~117 KB to ~52 KB on x86 and from ~133 KB to ~51 KB on x64, mostly by discarding unreferenced libuuid.a constants, and every installer shrinks by as much. See the patch header for details. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GCC-built NSIS stubs are ~116 KB versus ~38 KB for the official MSVC builds, and every generated installer carries one. Most of the gap is mingw-w64's monolithic
libuuid.a;-ffunction-sections+-Wl,--gc-sectionsplus-Oz,-fno-identand-fno-asynchronous-unwind-tablesbring stubs to ~50 KB on x86. Plugins get the same flags except the unwind one (NSISdl uses C++ exceptions). makensis switches from-O2to-Os.-fdata-sectionsis deliberately left out; see the patch header.Verified on x86: zlib/lzma/bzip2 installers built with the patched stubs install correctly.