PXPerl + MinGW: the DLL files are too big

bart on 2006-02-19T10:14:11

Eek. I hate this. It's one of the reasons why I dispise working with C.

The DLLs built with PXPerl+MinGW are just too big. I tried this code:

use Inline C => <<'END_OF_C_CODE';

END_OF_C_CODE
That's right, an empty library, and the resulting DLL was a whopping 249k!

Urgh, not that nightmare again...

So I checked more DLLs includes with the distribution, and those built by MinGW, and the latter are all huge. For example, the DLL for HTML::Parser that comes in the distro, version 3.45, is 60kB... the one built with MinGW, using
test GAAS/HTML-Parser-3.45.tar.gz
in the CPAN shell, is 347kB!!!

WTF is all this junk, and is it possible to make this much smaller?


Strip

bart on 2006-02-19T10:44:27

Scanning the web a little, plus my previous (bad) experiences with C compilers, made me look up a "strip" option, to "remove (debugging) symbols from the executables". I found that for MinGW, I need the -s flag.

So I edited the "linker flags for DLLs", from
-mdll
to
-mdll -s
(For this, you have to run configure_pxperl.)

Now, the HTML::Parser DLL is reduced to 40k (yay! I never expected it to work so well!), and the empty Inline DLL is 7k. Great.

This should be a standard enabled option in PXPerl's configuration.

Re: PXPerl + MinGW: the DLL files are too big

fireartist on 2006-02-20T11:50:50

I just checked, and VanillaPerl, which is built with mingw using perl5.8.8's win32/Makefile, has this option on by default.

I downloaded and built HTML-Parser v3.45; the dll is 38.5kB.

Re: VanillaPerl

bart on 2006-02-20T16:30:57

Thanks for pointing me to VanillaPerl, I hadn't heard of it before. Well, seen it has had only 7 downloads until today, I think I'm not the only one. But it looks promising. A MinGW compiled perl that includes the compiler it was built with, is always very interesting.

So CamelPack is a SourceForge project now, is it? Nice. And VanillaPerl is part of the grand project. Also nice.

I am still planning on pushing forward with this PXPerl+MinGW combination. If I don't, it looks like nobody will. And that would be a shame.

Re: VanillaPerl

fireartist on 2006-02-20T16:46:44

PXPerl definitely has a different target 'audience' than VanillaPerl, which was just put together for Adam Kennedy's recent beer challenge; it's just the core modules; so it won't meet everyone's requirements.

I'm currently just sending as many rt.cpan bug reports as I can, with the hope of getting as many modules as possible working on windows with cpan.pm, rather than start maintaining yet-another perl distro.

Re: VanillaPerl

bart on 2006-02-20T17:21:25

Ah, so that is where I heard the name before. It all clicks together, now.

Re: PXPerl + MinGW: the DLL files are too big

Ron Savage on 2006-04-19T10:17:08

Off topic I know but: Any ideas on how to use MinGW and dmake to compile Apache under Windows?

ron@savage.net.au