Log in

View Full Version : [SOLVED] How-to "shrink" MinGW-w64 builds?


filler56789
25th August 2016, 19:32
For learning purposes (or at least I think so),
I (tried and managed) to build the MinGW+w64&&GCC toolchains through Zeranoe's scripts
(here (https://ffmpeg.zeranoe.com/blog/?cat=4) and here (https://files.1f0.de/mingw/scripts/)).
The problem now is, their filesize is much bigger than the filesize of nevcairiel's and komisar's releases
(for example, nevcairiel's gcc 4.9.3 set is ~ 420MiB, whereas the gcc 4.9.4 that I got is above 1GiB :scared: ).
So my question is, ¿is there an automated way to combine the 32-bit and the 64-bit compilers into a single directory?
OR, who knows, did I miss something when I ran the building scripts? :confused:

nevcairiel
25th August 2016, 22:29
Maybe thats the debugging information? You might need to strip everything to get rid of it.

For automated combination - I have a tiny script for that, but all it really does is copy the two in the same folder, nothing more.

filler56789
25th August 2016, 23:23
Maybe thats the debugging information? You might need to strip everything to get rid of it.

You are right :goodpost: , --strip-unneeded is the root of all good.

Because :stupid: , I assumed :o that you and komisar simply discarded some (many) "unnecessary files" :rolleyes: ,
— besides removing duplicated headers, libraries & etc., of course.

RiCON
27th August 2016, 14:41
They're unnecessary for people that don't need debugging, which is probably a minority of those that build for themselves.

You can't regain debugging information back if it's been stripped, so it's better to just leave it unless you're distributing final apps to non-devs.

nevcairiel
27th August 2016, 16:16
You are right :goodpost: , --strip-unneeded is the root of all good

--strip-unneeded can break some things, personally I stick with just stripping debug information (-g)

filler56789
28th August 2016, 14:16
--strip-unneeded can break some things, personally I stick with just stripping debug information (-g)

Thanks for the info, I wasn't aware of that.

So, I applied --strip-debug to all the .EXEs in the bin directories, but not to the .EXEs in the libexec directory.
Then I UPXed :devil: all of the pesky binaries... and voilà,
now the «non-archived» MinGW-w64 release of GCC 6.2 weighs only 402MB :cool: