Bloated dll files in the SP distros.
I first became aware of this during the later stages of the https://github.com/brechtsanders/winlibs_mingw/issues/10 discussion.
The good news is that the bloating (AFAIK) does not impact upon performance, but the extent of the additional space unnecessarily consumed is a little disconcerting.
The problem is that many (all ?) of the dll files that ship with Strawberry Perl contain a block where the string "<code>GCC: (MinGW-W64 x86_64-ucrt-posix-seh, built by Brecht Sanders, r8) 13.2.0 </code>" is repeated multiple times.
In SP-5.42.0-PDL build, if you open (eg)<code> c/bin/libcrypto-3-x64__.dll</code>in Windows notepad you'll find a 76,555 bytes section where that string is repeated (around 1000 times).
For <code>c/bin/libgmp-10.dll</code> it's a 40,954 bytes block, and for <code>c/bin/libmpfr-6.dll</code> it's a 24,576 bytes block.
This undesirable feature filters through to the perl dll files too - eg <code>perl/vendor/lib/auto/Math/GMP/GMP.xs.dll </code> (18,314 bytes) and <code>perl/vendor/lib/auto/Math/MPFR/MPFR.xs.dll </code> (39,194 bytes) .... and doubtless many, many more .
For the perl542.dll it's 8,714 bytes, and for the perl.exe it's a mere 2,314 bytes.
My own builds of perl are afflicted with the same thing - not surprising as I've also been using winlibs compilers.
The solution apparently involves using the <code>-fno-ident</code> compiler flag, and the latest Winlibs builds of gcc-15.2 (release 5) have been built using that flag throughout.
But I don't think Brecht has gone back and reworked builds for the earlier gcc versions.
For my latest build of perl-5.43.7, built using that "corrected" (release 5) gcc-15.2.0 compiler, the string occurs exactly 3 times in the perl.exe and
exactly 3 times in the perl543.dll.
I didn't actually build that perl with the <code>-fno-ident</code> flag. Perhaps the occurrence of the string would have been further reduced if I had invoked that flag. (I'll find that out when I build perl-5.43.8 later this month.)
I did add <code>-fno-ident</code> to my perl CCFLAGS, but it seems that I'll need to rebuild my C libraries (gmp, mpfr, etc.) before that excessive repetition in my Math::GMP. Math::MPFR, etc. dll files is significantly reduced.
(I'll test that out over the following months, too.)
As I said earlier, I don't believe this hampers performance - so feel free to close this issue if it's therefore deemed to be not worth fretting over.
6 条评论