I'm currently porting a library (not written by myself, I'm "only" porting it) to use the MinGW compiler. The library is a real heavyweight, with all kinds of C++ "black magic" (multiple inheritance, templates of templates of templates, very macro heavy, etc.).
Now, after some weeks, I get everything compiled fine and it also seems to work well (unit tests work, as do the demos).
What bugs me, though, is the sheer size of the MinGW binaries in contrast to the MSVC binaries. I know that MinGW binaries are generally slightly bigger due to having to include the own non-MS system libraries, but we're talking about 33 MB for MinGW vs 13 MB for MSVC. And that is the "release" (-O3 and -s flags) version!
Those are the flags I compile with in MinGW:
-c -O3 -s -MMD -march=native -frtti
And for the linker it is this:
-shared -s -static-libgcc -static-libstdc++
I know that rtti adds some size, but it also has to be in the MSVC binaries. And the static libgcc and libstdc++ libraries can't be that big... or can they?
What am I missing here? Normally, the size difference between MinGW and MSVC isn't that big.